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

> ## Agent Instructions
> Money is always a decimal string at the currency's precision (for example "29.00"), paired with an ISO 4217 currency field. Never use minor units.
> Build against the sandbox first: base URL https://sandbox-api.bachs.io with sk_sandbox_ keys. Production is https://api.bachs.io with sk_live_ keys; going live is a key swap.
> Treat webhooks (for example collection.succeeded) as the source of truth for fulfilment, never client-side events or redirects.
> Subscriptions are created by completing a checkout for a recurring product. There is no direct create-subscription endpoint.
> IDs carry resource prefixes (cust_, prod_, sub_, chk_, inv_, ref_) and timestamps are ISO 8601 UTC.

# Retrieve a checkout session

> Retrieve the details of a checkout session by its ID, including resolved product line items and charge information.

The `charge` field is `null` while the session is `OPEN` and populated once the customer submits a payment.

Requires `payments:read` scope.



## OpenAPI

````yaml /docs/openapi/openapi.json get /v1/checkout-sessions/{checkout_id}
openapi: 3.0.3
info:
  title: Bachs API
  version: 1.0.0
  description: >-
    The Bachs API lets you accept payments, manage subscriptions, and move money
    across African markets.


    - **Authentication:** pass your secret key as `Authorization: Bearer
    sk_...`. See [Authentication](/authentication) for keys, scopes, and sandbox
    vs production.

    - **Errors:** errors use `detail` and `error_code`; `doc_url` and
    field-level `errors` are optional. See [Errors](/errors).

    - **Pagination:** list endpoints return `{ items, pagination }`. See
    [Pagination](/guides/pagination).

    - **Idempotency:** use `Idempotency-Key` on public `POST` and `PATCH`;
    reconcile uncertain write outcomes before retrying. See
    [Idempotency](/guides/idempotency).

    - **Base URLs and rate limits:** see the
    [Introduction](/api-reference/overview).
  contact:
    name: Bachs Support
    url: https://bachs.io
servers:
  - url: https://api.bachs.io
    description: Production
  - url: https://sandbox-api.bachs.io
    description: Sandbox
security:
  - ApiKeyAuth: []
tags:
  - name: Payments
    description: Accept payments from customers
  - name: Refunds
    description: Create and manage customer refunds
  - name: Disputes
    description: Respond to chargebacks and manage dispute evidence
  - name: Balances
    description: View balances and account information
  - name: Conversions
    description: Quote, execute, and query currency conversions
  - name: Payouts
    description: Withdraw funds to external accounts
  - name: Webhooks
    description: Receive real-time payment notifications
  - name: Authentication
    description: API key management and authentication
  - name: Customers
    description: Create and manage customers
  - name: Products
    description: Define and manage your billing catalog
  - name: Product Groups
    description: Bundle products for multi-plan checkout
  - name: Media
    description: Upload files and get an upload_id to attach to products
  - name: Checkouts
    description: Create and manage API-driven checkouts without products
  - name: Subscriptions
    description: >-
      Recurring billing. Subscriptions are created through checkout; manage them
      here.
  - name: Customer sessions
    description: >-
      Open a hosted portal session so a customer can manage their own
      subscriptions, invoices and cards.
  - name: Accounts
    description: >-
      Create the accounts your platform onboards, request their capabilities,
      walk them through their requirements, and read what they still owe.
  - name: Transfers
    description: Move funds between your platform and the accounts you own.
  - name: Platform Fees
    description: Read the platform's cut of an account's sale.
  - name: Virtual Accounts
    description: Create and read fixed bank account numbers for receiving deposits.
  - name: Files
paths:
  /v1/checkout-sessions/{checkout_id}:
    get:
      tags:
        - Checkout Sessions
      summary: Retrieve a checkout session
      description: >-
        Retrieve the details of a checkout session by its ID, including resolved
        product line items and charge information.


        The `charge` field is `null` while the session is `OPEN` and populated
        once the customer submits a payment.


        Requires `payments:read` scope.
      operationId: getCheckoutSession
      parameters:
        - name: checkout_id
          in: path
          required: true
          schema:
            type: string
          description: The checkout ID returned when the session was created.
          example: chk_1M2N3o4P5q6R7s8T
      responses:
        '200':
          description: Checkout session retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionApiResponse'
              example:
                checkout_id: chk_1M2N3o4P5q6R7s8T
                status: completed
                recurring: null
                payment_status: succeeded
                source_type: CHECKOUT_SESSION
                amount: '50.00'
                currency: USD
                reference: order_9876
                charge:
                  payment_id: pay_1a2b3c4d5e
                  billing_reason: purchase
                  status: succeeded
                  amount: '29.00'
                  currency: USD
                  fee_usd: '0.59'
                payment_method: CARD
                customer:
                  id: cust_1a2b3c4d5e6f
                  email: jane@example.com
                  name: Jane Doe
                customer_details:
                  email: jane@example.com
                  name: Jane Doe
                success_url: https://yourapp.com/success
                cancel_url: https://yourapp.com/cancel
                products:
                  - product_id: prod_abc123
                    product_name: Premium Plan
                    quantity: 1
                    unit_amount: '50.00'
                    currency: USD
                    price_type: fixed
                    minimum_amount: null
                    maximum_amount: null
                    line_total: '50.00'
                billing_currency: NGN
                session_mode: CART
                metadata:
                  order_id: ORD-9876
                created_at: '2026-01-24T14:30:00.000Z'
                expires_at: '2026-01-24T15:30:00.000Z'
                completed_at: '2026-01-24T14:35:00.000Z'
                updated_at: '2026-01-24T14:35:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CheckoutSessionApiResponse:
      type: object
      description: >-
        Checkout session details returned by `GET
        /v1/checkout-sessions/{checkout_id}`.
      properties:
        checkout_id:
          type: string
          description: Unique checkout identifier.
          example: chk_1M2N3o4P5q6R7s8T
        status:
          type: string
          enum:
            - open
            - completed
            - expired
            - cancelled
          description: >-
            Current lifecycle status of the checkout session. `open`: awaiting
            customer payment, where every new session starts. `completed`:
            payment succeeded, a terminal state. `expired`: the session window
            elapsed before payment, a terminal state. `cancelled`: cancelled
            before completion, a terminal state.
          example: completed
        recurring:
          allOf:
            - $ref: '#/components/schemas/CheckoutRecurring'
          nullable: true
          description: >-
            Present only for a subscription checkout; `null` for a one-time
            checkout.
        payment_status:
          type: string
          description: >-
            Payment lifecycle for the checkout. `requires_payment_method`,
            `requires_confirmation`, `requires_action`, `processing`,
            `succeeded`, `failed`, or `canceled`.
          enum:
            - requires_payment_method
            - requires_confirmation
            - requires_action
            - processing
            - succeeded
            - failed
            - canceled
          nullable: true
          example: requires_payment_method
        source_type:
          type: string
          description: What created the checkout, e.g. `CHECKOUT_SESSION` or `API`.
          example: CHECKOUT_SESSION
          nullable: true
        amount:
          type: string
          description: Total amount in `currency`.
          example: '50.00'
        currency:
          type: string
          description: Base currency code.
          example: USD
        reference:
          type: string
          nullable: true
          description: >-
            The reference you set when you created the session. `null` if you
            set none.
          example: order_9876
        charge:
          allOf:
            - $ref: '#/components/schemas/PaymentResponse'
          nullable: true
          description: >-
            The payment created by this checkout, once payment has been
            attempted. `null` before then.
        payment_method:
          type: string
          description: >-
            The payment method selected for the checkout, if any. For every
            method except card, this is the exact corridor collected, such as
            `NGN_BANK_TRANSFER`, `MOMO_GHS`, or `CRYPTO`. Card charges report
            `CARD` rather than `USD_CARD` or `NGN_CARD`; read the currency to
            tell which card corridor collected it.
          example: NGN_BANK_TRANSFER
          nullable: true
        customer:
          $ref: '#/components/schemas/CheckoutCustomer'
        customer_details:
          allOf:
            - $ref: '#/components/schemas/CheckoutCustomerDetails'
          nullable: true
          description: >-
            What the buyer supplied; present whenever an identity was collected,
            record or no record. `null` before then.
        success_url:
          type: string
          nullable: true
          format: uri
          description: URL the customer is redirected to after successful payment.
          example: https://yourapp.com/success
        cancel_url:
          type: string
          nullable: true
          format: uri
          description: URL the customer is redirected to if they cancel.
          example: https://yourapp.com/cancel
        products:
          type: array
          nullable: true
          description: >-
            Resolved product line items. Populated for `CART` sessions; may be
            `null` for `SELECTION` sessions before the customer picks a product.
          items:
            $ref: '#/components/schemas/ResolvedProductItem'
        billing_currency:
          type: string
          nullable: true
          description: Currency the customer selected for billing.
          example: NGN
        platform_fee:
          type: string
          nullable: true
          description: >-
            The platform's cut of this sale, in the base currency of the sale.
            The key is always present; it reads `null`, not `"0.00"`, on a
            checkout that carries no fee, and on a checkout that split the sale
            with `transfer_data.amount` instead. See [Platform
            fees](/connect/platform-fees).
          example: '20000.00'
        destination_amount:
          type: string
          nullable: true
          description: >-
            The seller's contracted share of this sale, in the base currency of
            the sale. Null on a checkout that carries no split, and on one that
            split the sale with `platform_fee` instead.
          example: '80000.00'
        session_mode:
          type: string
          description: >-
            How products are presented. `CART` sums a fixed set of items;
            `SELECTION` lets the customer pick one from a group.
          enum:
            - CART
            - SELECTION
          nullable: true
          example: CART
        metadata:
          type: object
          nullable: true
          additionalProperties: true
          description: Public metadata you attached at session creation.
          example:
            order_id: ORD-9876
        created_at:
          type: string
          format: date-time
          description: ISO 8601 creation timestamp.
          example: '2026-01-24T14:30:00.000Z'
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 expiry timestamp.
          example: '2026-01-24T15:30:00.000Z'
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 timestamp when the session was completed.
          example: '2026-01-24T14:35:00.000Z'
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 last-updated timestamp.
          example: '2026-01-24T14:35:00.000Z'
      required:
        - checkout_id
        - status
        - amount
        - currency
        - customer
        - created_at
        - updated_at
    CheckoutRecurring:
      type: object
      description: >-
        The recurring cadence when the checkout starts a subscription. `null`
        for a one-time checkout.
      properties:
        interval:
          type: string
          description: The billing interval.
          enum:
            - day
            - week
            - month
            - year
          example: month
        interval_count:
          type: integer
          description: Number of intervals per billing cycle.
          example: 1
          default: 1
      required:
        - interval
    PaymentResponse:
      type: object
      description: Detailed payment response for API integrations.
      properties:
        reference:
          type: string
          nullable: true
          description: Checkout reference when available.
          example: order_9876
        payment_id:
          type: string
          description: Unique identifier for the payment.
          example: pay_1a2b3c4d5e
        billing_reason:
          type: string
          enum:
            - purchase
            - subscription_create
            - subscription_cycle
            - subscription_update
          description: >-
            Why this payment exists. `purchase`: a one-time purchase.
            `subscription_create`: the first cycle of a new subscription.
            `subscription_cycle`: a subscription renewal. `subscription_update`:
            an off-cycle charge from a mid-cycle plan change (proration).
          example: purchase
        checkout_id:
          type: string
          nullable: true
          description: Checkout identifier, when linked.
          example: chk_8T9u0V1w2X3y4Z5a
        status:
          type: string
          description: >-
            Current status of the payment. `created`: the charge exists and no
            attempt has succeeded yet. `processing`: an attempt is in flight and
            is being verified. `succeeded`: the payment is confirmed and settled
            in full. `accepted`: an underpayment or overpayment was accepted as
            final settlement. `failed`: the payment failed and no funds were
            captured. `expired`: the payment window elapsed before any payment
            arrived. `cancelled`: cancelled before completion. `refunded`: the
            full amount was returned to the customer. `partially_refunded`: part
            of the amount was returned to the customer. `auto_refunded`: we
            automatically returned the full amount to the customer. `underpaid`:
            the customer paid less than the amount owed. `overpaid`: the
            customer paid more than the amount owed.
          enum:
            - created
            - processing
            - succeeded
            - accepted
            - failed
            - expired
            - cancelled
            - refunded
            - partially_refunded
            - auto_refunded
            - underpaid
            - overpaid
          x-enum-descriptions:
            created: Charge created and awaiting payment.
            processing: Payment received and being verified.
            succeeded: Payment confirmed and fully settled.
            accepted: Payment accepted by the processor, pending final confirmation.
            failed: Payment failed; no funds captured.
            expired: Charge expired before payment was received.
            cancelled: Charge cancelled before completion.
            refunded: Full refund issued.
            partially_refunded: Partial refund issued.
            auto_refunded: Full refund issued automatically.
            underpaid: Payment received was less than the requested amount.
            overpaid: Payment received exceeded the requested amount.
          example: succeeded
        is_refundable:
          type: boolean
          nullable: true
          description: Whether this payment can currently be refunded.
          example: true
        amount:
          type: string
          description: Requested amount in `currency`.
          example: '10.00'
        amount_paid:
          type: string
          nullable: true
          description: Amount received so far.
          example: '10.00'
        amount_remaining:
          type: string
          nullable: true
          description: Remaining amount still expected.
          example: '0.00'
        currency:
          type: string
          description: Payment currency code.
          example: USD
        fee_usd:
          type: string
          description: >-
            Processing fee for this payment, converted to USD and expressed as a
            decimal string. `null` until the payment settles.
          example: '0.59'
          nullable: true
        fees:
          allOf:
            - $ref: '#/components/schemas/FeeInfo'
          nullable: true
          description: >-
            The processing fee on this payment, in the currency it was charged
            in. Prefer this over `fee_usd` when the payment was not collected in
            USD: `fee_usd` is a conversion of the same fee, this is the amount
            actually taken. `null` on a payment that carries no processing fee.
            See [Fees](/for-you/fees).
        merchant_bears_cost:
          type: boolean
          nullable: true
          description: Whether merchant bears processing cost.
          example: true
        platform_fee:
          type: string
          nullable: true
          description: >-
            What the platform took out of this sale, beside the gross it was
            taken from, in the base currency of the sale. `null` when the charge
            carried no platform fee, and on a charge that split the sale with
            `transfer_data.amount` instead. See [Platform
            fees](/connect/platform-fees).
          example: null
        destination_amount:
          type: string
          nullable: true
          description: >-
            The seller's contracted share of this sale, in the base currency of
            the sale. Null on a charge that carries no split, and on one that
            split the sale with `platform_fee` instead.
          example: null
        fee_paid_by:
          type: string
          nullable: true
          enum:
            - merchant
            - platform
          description: >-
            Who Bachs's processing fee actually came from on this charge, read
            back from the ledger posting rather than a flag decided in advance.
            `merchant`: the fee came out of the charge. `platform`: the
            platform's own balance covered it. On a destination charge this
            never reads `platform`; the fee always comes from the charge there.
            See [Processing fees](/connect/processing-fees).
          example: merchant
        payment_method:
          type: string
          nullable: true
          description: >-
            How the payment was collected, usually named by rail and currency
            together, such as `USD_CARD`, `NGN_CARD`, `NGN_BANK_TRANSFER`,
            `MOMO_GHS`, or `CRYPTO`. A payment requested with a general method
            name can return `BANK_TRANSFER` or `MOBILE_MONEY`, so accept both
            forms for the same rail; `null` means the payment never reached a
            provider.
          example: NGN_BANK_TRANSFER
        channel:
          type: string
          nullable: true
          description: Origin channel (for example `api`).
          example: checkout
        narration:
          type: string
          nullable: true
          description: payment description/narration.
          example: Pro plan
        meta:
          type: object
          nullable: true
          additionalProperties: true
          description: Public metadata stored for this payment.
          example:
            order_id: ORD-9876
        message:
          type: string
          nullable: true
          description: Human-readable payment message derived from status.
          example: Successful
        customer:
          type: object
          nullable: true
          description: Customer information when available.
          properties:
            name:
              type: string
              nullable: true
              description: >-
                Full name of the customer associated with this payment, when
                captured.
            email:
              type: string
              nullable: true
              description: >-
                Customer email address associated with this payment, when
                captured.
        line_items:
          type: array
          nullable: true
          description: The line items this payment covers.
          items:
            $ref: '#/components/schemas/PaymentProductItem'
        subscription_id:
          type: string
          nullable: true
          description: >-
            The subscription this payment belongs to, or `null` for a one-time
            purchase.
          example: null
        invoice:
          allOf:
            - $ref: '#/components/schemas/PaymentInvoiceInfo'
          nullable: true
          description: >-
            The invoice this payment collected. Present only for subscription
            payments; `null` for one-time purchases.
        refunds:
          type: array
          nullable: true
          description: >-
            IDs of any refunds issued for this payment. `null` if no refund has
            been created.
          items:
            type: string
          example:
            - ref_1a2b3c4d5e
        status_history:
          type: array
          nullable: true
          description: Chronological list of status changes for this payment.
          items:
            type: object
            properties:
              status:
                type: string
                description: Status at this point in time.
                example: succeeded
              occurred_at:
                type: string
                format: date-time
                description: When this status change occurred.
                example: '2026-01-24T14:35:00.000Z'
              reason:
                type: string
                nullable: true
                description: Human-readable reason for the status change, if available.
        payment_method_details:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Who paid and how, read from the attempt that succeeded. Returned on
            a single payment and on the `collection.succeeded` webhook, not on
            the payment list. `null` on payments taken before this field
            existed, and on payment methods that tell us nothing about the
            payer.


            The shape is keyed by `type`. For `bank_transfer`, the
            `bank_transfer` object carries `sender_name`, `sender_bank`,
            `sender_bank_code`, `sender_account_number` (the full account the
            money came from, which you need to send money back to the sender),
            `session_id` (the interbank reference for the transfer) and
            `narration`. Which of those are present depends on what the sending
            bank passed on, so treat each as optional. It also carries a
            `virtual_account` object naming the account number the money landed
            in: `id`, `account_number`, `bank_name`, `type` (`permanent` for an
            account you keep, `one_time` for a number created for a single
            checkout) and `expires_at`.
          example:
            type: bank_transfer
            bank_transfer:
              sender_name: JANE ADEYEMI
              sender_bank: Guaranty Trust Bank
              sender_account_number: '2294879124'
              session_id: '000013260922104115000821734502'
              virtual_account:
                id: va_8Hs2kQ4mZpXv
                account_number: '9902847361'
                bank_name: Globus Bank
                type: permanent
                expires_at: null
        created_at:
          type: string
          format: date-time
          description: Creation timestamp.
          example: '2026-04-27T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp.
          example: '2026-04-27T12:00:05Z'
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: Completion timestamp when available.
          example: '2026-04-27T12:00:05Z'
      required:
        - payment_id
        - status
        - amount
        - currency
        - created_at
        - updated_at
    CheckoutCustomer:
      type: object
      description: The customer attached to the checkout.
      properties:
        id:
          type: string
          description: >-
            The customer's ID, once resolved. `null` until a customer is matched
            or created.
          example: cust_1a2b3c4d5e6f
          nullable: true
        email:
          type: string
          description: >-
            The customer's email address. `null` until the buyer supplies it on
            the hosted page, on a checkout created without a `customer`.
          example: jane@example.com
          nullable: true
        name:
          type: string
          description: The customer's name. `null` when not provided.
          example: Jane Doe
          nullable: true
    CheckoutCustomerDetails:
      type: object
      description: >-
        What the buyer supplied, whether or not a customer record exists for
        them. Present whenever an identity was collected, `null` before then.
        Use it when you want the buyer's email and name and do not need an id
        you can pass back to the customers API. See [`customer` vs
        `customer_details`](/api-reference/checkout-sessions/object#customer-vs-customer-details).
      properties:
        email:
          type: string
          description: The email the buyer supplied.
          example: jane@example.com
          nullable: true
        name:
          type: string
          description: The name the buyer supplied. `null` when not given.
          example: Jane Doe
          nullable: true
    ResolvedProductItem:
      type: object
      description: A resolved product line item within a checkout session.
      properties:
        product_id:
          type: string
          description: Product identifier.
          example: prod_abc123
        product_name:
          type: string
          description: Product display name.
          example: Premium Plan
        quantity:
          type: integer
          description: Number of units.
          example: 1
        unit_amount:
          type: string
          description: Price per unit in `currency`.
          example: '50.00'
        currency:
          type: string
          description: Currency code for this line item.
          example: USD
        price_type:
          type: string
          enum:
            - fixed
            - free
            - custom
          description: >-
            How the product is priced. `fixed`: a set amount, given in `amount`.
            `free`: no charge. `custom`: the customer pays what they want,
            bounded by `minimum_amount` and `maximum_amount` with an optional
            `preset_amount` suggestion.
          example: fixed
        minimum_amount:
          type: string
          nullable: true
          description: Minimum allowed amount when `price_type` is true.
          example: '10.00'
        maximum_amount:
          type: string
          nullable: true
          description: Maximum allowed amount when `price_type` is true.
          example: '500.00'
        line_total:
          type: string
          description: Total for this line item (`unit_amount` × `quantity`).
          example: '50.00'
      required:
        - product_id
        - product_name
        - quantity
        - unit_amount
        - currency
        - price_type
        - line_total
    Error:
      type: object
      description: Standard error response format used across all API endpoints
      properties:
        detail:
          type: string
          description: Human-readable error message explaining what went wrong.
          example: Invalid request parameters
        error_code:
          type: string
          description: >-
            Machine-readable error code. Use this to handle errors
            programmatically. Common codes: VALIDATION_ERROR, UNAUTHORIZED,
            FORBIDDEN, NOT_FOUND, CONFLICT, TOO_MANY_REQUESTS,
            INTERNAL_SERVER_ERROR, BAD_GATEWAY, SERVICE_UNAVAILABLE.
          example: VALIDATION_ERROR
        errors:
          type: array
          description: >-
            Optional field-level details on some validation errors. Other
            validation responses contain only detail and error_code. Entry
            fields depend on the validation source.
          items:
            type: object
            properties:
              field:
                type: string
                description: The field that failed validation.
                example: amount
              message:
                type: string
                description: Description of the validation failure.
                example: Amount must be a positive decimal string
              type:
                type: string
                description: Error type identifier.
                example: value_error
              code:
                type: string
                description: >-
                  Optional requirement-field rejection code. Some validation
                  entries provide code instead of type.
                example: currency_not_supported
            required:
              - field
              - message
        doc_url:
          type: string
          description: Optional link to documentation for this error; some errors omit it.
          example: https://docs.bachs.io/api-reference/error-reference#general
      required:
        - detail
        - error_code
    FeeInfo:
      type: object
      description: >-
        The Bachs processing fee on a payment, in the currency it was charged
        in. Taken from the payment with no conversion applied, so it is the
        figure to reconcile against when the payment was not collected in USD.
      properties:
        amount:
          type: string
          description: The fee, as a decimal string in `currency`.
          example: '8.73'
        currency:
          type: string
          description: >-
            The currency the fee was charged in, as an [ISO
            4217](https://en.wikipedia.org/wiki/ISO_4217) code. This is the
            currency the payment was collected in, which is not always the
            currency it settles to.
          example: USD
      required:
        - amount
        - currency
    PaymentProductItem:
      type: object
      description: A product line item purchased in this payment.
      properties:
        product_id:
          type: string
          description: Product identifier.
          example: prod_abc123
        product_name:
          type: string
          description: Product display name.
          example: Premium Plan
        quantity:
          type: integer
          description: Number of units purchased.
          example: 1
        unit_amount:
          type: string
          description: Price per unit in `currency`.
          example: '50.00'
        currency:
          type: string
          description: Currency code for this line item.
          example: USD
        line_total:
          type: string
          description: Total for this line item (`unit_amount` × `quantity`).
          example: '50.00'
      required:
        - product_id
        - product_name
        - quantity
        - unit_amount
        - currency
        - line_total
    PaymentInvoiceInfo:
      type: object
      description: A subscription invoice this payment collected.
      properties:
        invoice_id:
          type: string
          description: The invoice's identifier.
          example: inv_9a8b7c6d5e
        number:
          type: string
          nullable: true
          description: Human-facing invoice number, if assigned.
          example: inv_9a8b7c6d5e
        subscription_id:
          type: string
          nullable: true
          description: The subscription the invoice belongs to.
          example: sub_1a2b3c4d5e
        period_start:
          type: string
          format: date-time
          description: Start of the billing period, UTC.
          example: '2026-04-01T00:00:00Z'
        period_end:
          type: string
          format: date-time
          description: End of the billing period, UTC.
          example: '2026-05-01T00:00:00Z'
        kind:
          type: string
          enum:
            - cycle
            - proration
          description: >-
            `cycle`: a regular subscription-period invoice. `proration`: an
            off-cycle mid-cycle change.
          example: cycle
      required:
        - invoice_id
  responses:
    Unauthorized:
      description: >-
        Unauthorized - Invalid, missing, or expired API key. Verify your API key
        is correctly formatted and included in the Authorization header as
        `Bearer sk_sandbox_...` or `Bearer sk_live_...`. Check that your key
        hasn't been revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Invalid API key
            error_code: UNAUTHORIZED
      headers:
        X-RateLimit-Limit:
          description: Maximum number of requests allowed per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Number of requests remaining in the current window
          schema:
            type: integer
            example: 95
        X-RateLimit-Reset:
          description: Unix timestamp when the rate limit window resets
          schema:
            type: integer
            example: 1706102400
    Forbidden:
      description: >-
        Forbidden - API key does not have permission for the requested resource.
        Verify you're using the correct account's API key and that you're not
        trying to access another account's data.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: API key does not have permission for this operation
            error_code: FORBIDDEN
      headers:
        X-RateLimit-Limit:
          description: Maximum number of requests allowed per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Number of requests remaining in the current window
          schema:
            type: integer
            example: 95
        X-RateLimit-Reset:
          description: Unix timestamp when the rate limit window resets
          schema:
            type: integer
            example: 1706102400
    NotFound:
      description: >-
        Not Found - The requested resource does not exist. Verify the resource
        ID is correct and that it belongs to your account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Resource not found
            error_code: NOT_FOUND
      headers:
        X-RateLimit-Limit:
          description: Maximum number of requests allowed per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Number of requests remaining in the current window
          schema:
            type: integer
            example: 95
        X-RateLimit-Reset:
          description: Unix timestamp when the rate limit window resets
          schema:
            type: integer
            example: 1706102400
    TooManyRequests:
      description: >-
        Too Many Requests - Rate limit exceeded. Standard tier allows 100
        requests per minute per API key. Wait a few seconds before retrying.
        Check X-RateLimit-Reset header for when the window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Rate limit exceeded. Please retry after a few seconds.
            error_code: TOO_MANY_REQUESTS
      headers:
        X-RateLimit-Limit:
          description: Maximum number of requests allowed per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Number of requests remaining in the current window (will be 0)
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: Unix timestamp when the rate limit window resets
          schema:
            type: integer
            example: 1706102400
        Retry-After:
          description: Number of seconds to wait before retrying
          schema:
            type: integer
            example: 30
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Bearer token authentication. Pass your API key as `Authorization: Bearer
        sk_...`. See [Authentication](/authentication) for keys, scopes, and
        sandbox vs production.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.