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

# Get Upcoming Invoice

> Preview the next invoice for the current subscription from Stripe: recurring plan cost, metered usage overage, and the authoritative total.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/billing/subscription/upcoming-invoice
openapi: 3.1.0
info:
  title: Diga API
  version: 0.1.0
servers:
  - url: https://api.diga.io
    description: Production
security: []
paths:
  /v1/billing/subscription/upcoming-invoice:
    get:
      tags:
        - Billing - Subscriptions
      summary: Get Upcoming Invoice
      description: >-
        Preview the next invoice for the current subscription from Stripe:
        recurring plan cost, metered usage overage, and the authoritative total.
      operationId: get_upcoming_invoice_v1_billing_subscription_upcoming_invoice_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpcomingInvoiceSchema'
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              example:
                status: error
                error_code: INTERNAL_SERVER_ERROR
                message: Missing required permissions
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '404':
          description: Paid Subscription Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
              example:
                status: error
                error_code: PAID_SUBSCRIPTION_NOT_FOUND
                message: 'Error: Paid Subscription Not Found'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                status: error
                error_code: INTERNAL_SERVER_ERROR
                message: 'Error: Internal Server Error'
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
      security:
        - CustomHTTPBearer: []
components:
  schemas:
    UpcomingInvoiceSchema:
      properties:
        plan_amount:
          type: number
          title: Plan Amount
          description: Recurring plan cost of the upcoming invoice
        extra_usage_amount:
          type: number
          title: Extra Usage Amount
          description: Metered usage overage billed on the upcoming invoice (0 if none)
        total_due:
          type: number
          title: Total Due
          description: Total amount Stripe will charge on the upcoming invoice
        currency:
          type: string
          title: Currency
          description: Currency of the upcoming invoice
        next_payment_date:
          type: string
          format: date-time
          title: Next Payment Date
          description: Date the upcoming invoice will be charged
      type: object
      required:
        - plan_amount
        - extra_usage_amount
        - total_due
        - currency
        - next_payment_date
      title: UpcomingInvoiceSchema
    ErrorResponseSchema:
      properties:
        status:
          type: string
          title: Status
          description: Status of the response, always 'error' for error responses
          default: error
        error_code:
          type: string
          title: Error Code
          description: Machine-readable error code in SCREAMING_SNAKE_CASE format
          examples:
            - PROJECT_NOT_FOUND
            - INVALID_EMAIL
            - UNAUTHORIZED_ROLE
        message:
          type: string
          title: Message
          description: Human-readable error message with details
          examples:
            - Project with id 550e8400-e29b-41d4-a716-446655440000 not found
            - The email invalid@email is not valid
            - Insufficient permissions to perform this action
      type: object
      required:
        - error_code
        - message
      title: ErrorResponseSchema
      description: Standard error response format for all API errors.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    CustomHTTPBearer:
      type: http
      scheme: bearer

````