> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexprice.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get upcoming credit grant applications

> Use when showing upcoming or pending credits for a subscription (e.g. in a portal or for forecasting).



## OpenAPI

````yaml /api-reference/openapi.json get /subscriptions/{id}/grants/upcoming
openapi: 3.0.1
info:
  title: Flexprice API
  description: Flexprice API Service
  contact:
    name: API Support
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1.0'
servers:
  - url: https://us.api.flexprice.io/v1
    description: US Region
  - url: https://api.cloud.flexprice.io/v1
    description: India Region
security: []
paths:
  /subscriptions/{id}/grants/upcoming:
    get:
      tags:
        - Subscriptions
      summary: Get upcoming credit grant applications
      description: >-
        Use when showing upcoming or pending credits for a subscription (e.g. in
        a portal or for forecasting).
      operationId: getSubscriptionUpcomingGrants
      parameters:
        - name: id
          in: path
          description: Subscription ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCreditGrantApplicationsResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ListCreditGrantApplicationsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CreditGrantApplicationResponse'
        pagination:
          $ref: '#/components/schemas/types.PaginationResponse'
    errors.ErrorResponse:
      type: object
      properties:
        code:
          type: string
          enum:
            - not_found
            - already_exists
            - version_conflict
            - validation_error
            - invalid_operation
            - permission_denied
            - http_client_error
            - database_error
            - system_error
            - internal_error
            - service_unavailable
        details:
          type: object
          additionalProperties:
            type: object
        http_status_code:
          type: integer
        message:
          type: string
      x-speakeasy-name-override: ErrorResponse
    CreditGrantApplicationResponse:
      type: object
      properties:
        application_reason:
          $ref: '#/components/schemas/types.CreditGrantApplicationReason'
        application_status:
          $ref: '#/components/schemas/types.ApplicationStatus'
        applied_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
        credit_grant_id:
          type: string
        credits:
          type: number
        environment_id:
          type: string
        failure_reason:
          type: string
        id:
          type: string
        idempotency_key:
          type: string
        metadata:
          $ref: '#/components/schemas/types.Metadata'
        period_end:
          type: string
          format: date-time
        period_start:
          type: string
          format: date-time
        retry_count:
          type: integer
        scheduled_for:
          type: string
        status:
          $ref: '#/components/schemas/types.Status'
        subscription_id:
          type: string
        subscription_status_at_application:
          $ref: '#/components/schemas/types.SubscriptionStatus'
        tenant_id:
          type: string
        updated_at:
          type: string
          format: date-time
        updated_by:
          type: string
    types.PaginationResponse:
      type: object
      properties:
        limit:
          type: integer
        offset:
          type: integer
        total:
          type: integer
      x-speakeasy-name-override: PaginationResponse
    types.CreditGrantApplicationReason:
      type: string
      enum:
        - first_time_recurring_credit_grant
        - recurring_credit_grant
        - onetime_credit_grant
      x-enum-varnames:
        - ApplicationReasonFirstTimeRecurringCreditGrant
        - ApplicationReasonRecurringCreditGrant
        - ApplicationReasonOnetimeCreditGrant
      x-speakeasy-name-override: CreditGrantApplicationReason
    types.ApplicationStatus:
      type: string
      enum:
        - applied
        - failed
        - pending
        - skipped
        - cancelled
      x-enum-varnames:
        - ApplicationStatusApplied
        - ApplicationStatusFailed
        - ApplicationStatusPending
        - ApplicationStatusSkipped
        - ApplicationStatusCancelled
      x-speakeasy-name-override: ApplicationStatus
    types.Metadata:
      type: object
      additionalProperties:
        type: string
      x-speakeasy-name-override: Metadata
    types.Status:
      type: string
      enum:
        - published
        - deleted
        - archived
      x-enum-varnames:
        - StatusPublished
        - StatusDeleted
        - StatusArchived
      x-speakeasy-name-override: Status
    types.SubscriptionStatus:
      type: string
      enum:
        - active
        - paused
        - cancelled
        - incomplete
        - trialing
        - draft
      x-enum-varnames:
        - SubscriptionStatusActive
        - SubscriptionStatusPaused
        - SubscriptionStatusCancelled
        - SubscriptionStatusIncomplete
        - SubscriptionStatusTrialing
        - SubscriptionStatusDraft
      x-speakeasy-name-override: SubscriptionStatus
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Enter your API key in the format *x-api-key &lt;api-key&gt;**
      name: x-api-key
      in: header

````