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

# List transactions

> Returns a paginated list of transactions, newest first. Combine any of
the filters below; a transaction must match all of them.

Supports offset pagination (`limit` + `offset`) and cursor pagination
(`starting_after`). When `has_more` is true, the response includes
`next_cursor`: the last returned transaction's id. Pass it as
`starting_after` to fetch the next page. The two forms cannot be
combined in one request. When you filter by `merchant_reference`,
`client_reference_id`, or `invoice`, the cursor must be a transaction
with the same values. Every filter still applies to the returned rows.

Set `include_summary=true` to also receive `total_count`,
`status_counts`, and `net_volume_by_currency`, ignoring pagination.
`net_volume_by_currency` is omitted when no succeeded, partially
refunded, or refunded transaction matches.
`total_count` and `net_volume_by_currency` use every filter.
`status_counts` uses every filter except `status`, so it can show how
many transactions each status would add.




## OpenAPI

````yaml /openapi/transactions.yaml get /transactions
openapi: 3.0.3
info:
  title: Ionic Transactions API
  version: '2026-05-01'
  description: |
    Transactions: one read-only record per payment, combining the payment
    intent, its latest charge, the checkout session it came from, the customer,
    and the payment method.

    Use the list endpoint to search and filter payments across your account.
    Use the retrieve endpoint to get a single transaction with its line items,
    charges, and refunds. A transaction shares its id (`pi_…`) with the payment
    intent it describes.

    The `status` field summarizes the outcome in one value. It is
    `partially_refunded` or `refunded` once money has been returned, `failed`,
    `declined`, or `uncertain` when the latest charge ended that way, and the
    payment intent status otherwise.

    All timestamps in the `created_at` and `updated_at` style fields are Unix
    epoch seconds. Amounts are integers in the smallest currency unit, such as
    cents. Identifiers are opaque, prefixed strings.

    Authentication uses a secret key (`sk_…`) or a restricted key (`rk_…`) as a
    bearer token, and the key needs the `payments:read` permission. The mode of
    the key (test or live) scopes which transactions it can see. These endpoints
    act on the account that owns the key, and they do not accept the
    `Ionic-Account` header or a platform key.

    Errors are returned as `{ "error": { "code": "...", "message": "..." } }`.
servers:
  - url: '{baseUrl}/v1'
    variables:
      baseUrl:
        default: https://api.ionicfi.com
        description: API base URL for your environment.
security:
  - secretKey: []
tags:
  - name: Transactions
    description: Search and retrieve the payments on your account.
paths:
  /transactions:
    get:
      tags:
        - Transactions
      summary: List transactions
      description: |
        Returns a paginated list of transactions, newest first. Combine any of
        the filters below; a transaction must match all of them.

        Supports offset pagination (`limit` + `offset`) and cursor pagination
        (`starting_after`). When `has_more` is true, the response includes
        `next_cursor`: the last returned transaction's id. Pass it as
        `starting_after` to fetch the next page. The two forms cannot be
        combined in one request. When you filter by `merchant_reference`,
        `client_reference_id`, or `invoice`, the cursor must be a transaction
        with the same values. Every filter still applies to the returned rows.

        Set `include_summary=true` to also receive `total_count`,
        `status_counts`, and `net_volume_by_currency`, ignoring pagination.
        `net_volume_by_currency` is omitted when no succeeded, partially
        refunded, or refunded transaction matches.
        `total_count` and `net_volume_by_currency` use every filter.
        `status_counts` uses every filter except `status`, so it can show how
        many transactions each status would add.
      operationId: listTransactions
      parameters:
        - name: limit
          in: query
          description: Page size (default 20, max 100).
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: offset
          in: query
          description: Number of records to skip. Cannot be combined with `starting_after`.
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: starting_after
          in: query
          description: >-
            Cursor: a transaction id (typically the previous response's
            `next_cursor`). Returns results strictly after it, newest first.
            Cannot be combined with `offset`.
          schema:
            type: string
        - name: status
          in: query
          description: >
            Return transactions with these statuses. Pass a comma-separated list

            or repeat the parameter. `refunded` also matches
            `partially_refunded`,

            and `incomplete` matches `requires_payment_method` and

            `requires_confirmation`.
          schema:
            type: string
            example: succeeded,failed
        - name: search
          in: query
          description: >-
            Matches part of a transaction, charge, or checkout session id, the
            customer's name, the customer's or buyer's email, the last four
            digits of the card, a product name, or the start of an amount.
          schema:
            type: string
        - name: created_gte
          in: query
          description: Return transactions created at or after this time (RFC 3339).
          schema:
            type: string
            format: date-time
        - name: created_lte
          in: query
          description: Return transactions created at or before this time (RFC 3339).
          schema:
            type: string
            format: date-time
        - name: include_summary
          in: query
          description: >-
            When `true`, `1`, or `yes`, the response includes `total_count`,
            `status_counts`, and `net_volume_by_currency`.
          schema:
            type: boolean
            default: false
        - name: customer
          in: query
          description: Return transactions for this customer id (`cus_…`).
          schema:
            type: string
        - name: guest_email
          in: query
          description: >-
            Return payments that have no customer record, whose latest charge
            succeeded or was refunded, and whose buyer billing email matches
            exactly, ignoring case. Failed, declined, and unfinished payments
            are not included.
          schema:
            type: string
        - name: payment_method
          in: query
          description: Return transactions paid with this payment method id (`pm_…`).
          schema:
            type: string
        - name: card_brand
          in: query
          description: >-
            Return transactions paid with this card brand, such as `visa` or
            `mastercard`.
          schema:
            type: string
        - name: last4
          in: query
          description: Return transactions paid with a card ending in these digits.
          schema:
            type: string
        - name: currency
          in: query
          description: >-
            Return transactions in this currency (three-letter ISO code,
            case-insensitive).
          schema:
            type: string
            example: USD
        - name: amount_gte
          in: query
          description: >-
            Return transactions of at least this amount, written in the
            currency's main unit with up to two decimals (for example `12.50`).
          schema:
            type: string
            example: '12.50'
        - name: amount_lte
          in: query
          description: >-
            Return transactions of at most this amount, written in the
            currency's main unit with up to two decimals (for example `99.00`).
            Must be at least `amount_gte` when both are set.
          schema:
            type: string
            example: '99.00'
        - name: amount_min
          in: query
          description: Alias of `amount_gte`. If both are sent, `amount_gte` is used.
          schema:
            type: string
        - name: amount_max
          in: query
          description: Alias of `amount_lte`. If both are sent, `amount_lte` is used.
          schema:
            type: string
        - name: decline_code
          in: query
          description: Return transactions that failed with this decline code.
          schema:
            type: string
        - name: decline_type
          in: query
          description: Return transactions that failed with this decline type.
          schema:
            type: string
        - name: checkout_session
          in: query
          description: Return the transaction for this checkout session id (`cs_…`).
          schema:
            type: string
        - name: payment_link
          in: query
          description: Return transactions that came from this payment link id (`pl_…`).
          schema:
            type: string
        - name: invoice
          in: query
          description: >-
            Return the transaction that paid this invoice (`inv_…`). Must be an
            exact invoice id. Send it once.
          schema:
            type: string
        - name: merchant_reference
          in: query
          description: >-
            Return transactions with exactly this reference (1 to 255
            characters). The match is exact and case-sensitive. Send it once.
          schema:
            type: string
            minLength: 1
            maxLength: 255
        - name: client_reference_id
          in: query
          description: >-
            Return transactions with exactly this client reference id (1 to 200
            characters). The match is exact and case-sensitive. Send it once.
          schema:
            type: string
            minLength: 1
            maxLength: 200
      responses:
        '200':
          description: A paginated list of transactions, newest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionList'
        '400':
          description: >
            The request was malformed or failed validation. Returns one of:


            - `INVALID_REQUEST`: `limit` or `offset` is not a valid integer or
            is out of range, the query string cannot be parsed,
            `merchant_reference`, `client_reference_id`, or `invoice` is sent
            more than once, `offset` is combined with `starting_after`, or a
            retired cursor parameter (`starting_after_time`,
            `starting_after_id`) is sent.

            - `INVALID_DATA`: a filter value is invalid. For example
            `amount_gte` or `amount_lte` is not a decimal amount with at most
            two places, `amount_gte` is greater than `amount_lte`, `created_gte`
            or `created_lte` is not RFC 3339 or `created_gte` is after
            `created_lte`, a reference or `invoice` filter is not valid, or
            `starting_after` is not a transaction with the same
            `merchant_reference`, `client_reference_id`, and `invoice` values as
            those filters.

            - `ACCOUNT_CONTEXT_NOT_SUPPORTED`: the request includes an
            `Ionic-Account` header, which this endpoint does not accept.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: INVALID_REQUEST
                  message: offset cannot be combined with starting_after
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - secretKey:
            - payments:read
components:
  schemas:
    TransactionList:
      type: object
      description: A page of transactions.
      required:
        - data
        - has_more
      properties:
        data:
          type: array
          description: The transactions on this page, newest first.
          items:
            $ref: '#/components/schemas/Transaction'
        has_more:
          type: boolean
          description: Whether more transactions follow this page.
        next_cursor:
          type: string
          description: >-
            The last returned transaction's id. Present when `has_more` is true;
            pass it as `starting_after` on the next request.
        total_count:
          type: integer
          description: >-
            Number of transactions that match the filters. Present when
            `include_summary` is set.
        status_counts:
          type: object
          description: >-
            Number of transactions per status, plus an `all` total, using every
            filter except `status`. Present when `include_summary` is set.
          additionalProperties:
            type: integer
        net_volume_by_currency:
          type: object
          description: >-
            Matching volume per currency code in the smallest currency unit,
            after refunds, counting succeeded, partially refunded, and refunded
            transactions. Present when `include_summary` is set and at least one
            of those transactions matches; omitted otherwise.
          additionalProperties:
            type: integer
            format: int64
      example:
        data:
          - id: pi_2k9Lw3QmXb7TnR4s
            object: transaction
            payment_intent: pi_2k9Lw3QmXb7TnR4s
            merchant_reference: order-1042
            client_reference_id: null
            checkout_session: cs_8hF2vYp1NcZ6aD0e
            latest_charge: ch_5tR8uJq3WmK1xB7c
            source:
              type: payment_link
              label: Payment link
              checkout_mode: payment
              checkout_ui_mode: hosted
              payment_link: pl_4dN7sGb2HzE9yA3k
            livemode: false
            amount: 4900
            amount_refunded: 0
            currency: USD
            status: succeeded
            payment_intent_status: succeeded
            charge_status: succeeded
            checkout_status: complete
            payment_status: paid
            refund_count: 0
            customer:
              id: cus_6bV3mTq8LrP2wD5x
              email: jane@example.com
              first_name: Jane
              last_name: Doe
              name: Jane Doe
            payment_method:
              id: pm_3yH9cKs7QeU4nF1j
              type: card
              usage: reusable
              status: active
              brand: visa
              last4: '4242'
              exp_month: 12
              exp_year: 2030
              fingerprint: null
              funding: credit
              issuer: null
              country: US
              iin: '424242'
              billing_name: Jane Doe
              billing_email: jane@example.com
              billing_phone: null
              billing_address:
                line1: 123 Main St
                line2: null
                city: San Francisco
                state: CA
                postal_code: '94103'
                country: US
            payment_context: null
            product_summary:
              item_count: 1
              label: Starter plan
              names:
                - Starter plan
            decline_code: null
            decline_type: null
            failure_message: null
            created_at: 1790294400
            updated_at: 1790294412
        has_more: true
        next_cursor: pi_2k9Lw3QmXb7TnR4s
        total_count: 128
        status_counts:
          all: 128
          succeeded: 117
          failed: 6
          refunded: 5
        net_volume_by_currency:
          USD: 512300
    Error:
      type: object
      description: The error response envelope.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: A stable, machine-readable error code.
            message:
              type: string
              description: A human-readable explanation of the error.
    Transaction:
      type: object
      description: >-
        One payment, combining its payment intent, latest charge, checkout
        session, customer, and payment method.
      required:
        - merchant_reference
        - client_reference_id
        - id
        - object
        - payment_intent
        - checkout_session
        - latest_charge
        - source
        - livemode
        - amount
        - amount_refunded
        - currency
        - status
        - payment_intent_status
        - charge_status
        - checkout_status
        - payment_status
        - refund_count
        - customer
        - payment_method
        - payment_context
        - product_summary
        - decline_code
        - decline_type
        - failure_message
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: The transaction id (`pi_…`). It is the same as `payment_intent`.
        object:
          type: string
          enum:
            - transaction
          description: Always `transaction`.
        payment_intent:
          type: string
          description: The payment intent id (`pi_…`).
        merchant_reference:
          type: string
          nullable: true
          description: Your reference for the payment. Null when none was set.
        client_reference_id:
          type: string
          nullable: true
          description: >-
            The client reference id from the checkout session. Null when none
            was set.
        checkout_session:
          type: string
          nullable: true
          description: >-
            The checkout session id (`cs_…`) the payment came from. Null for
            payments made outside checkout.
        latest_charge:
          type: string
          nullable: true
          description: >-
            The id (`ch_…`) of the most recent charge attempt. Null when no
            charge was attempted.
        source:
          $ref: '#/components/schemas/TransactionSource'
        livemode:
          type: boolean
          description: True for live-mode transactions, false for test mode.
        amount:
          type: integer
          format: int64
          description: Amount in the smallest currency unit.
        amount_refunded:
          type: integer
          format: int64
          description: Total refunded so far, in the smallest currency unit.
        currency:
          type: string
          description: Three-letter ISO currency code, such as `USD`.
        status:
          type: string
          description: >-
            The overall outcome: `refunded`, `partially_refunded`, `failed`,
            `declined`, `uncertain`, or the payment intent status, such as
            `succeeded`, `processing`, `requires_payment_method`, or `canceled`.
        payment_intent_status:
          type: string
          description: The status of the payment intent.
        charge_status:
          type: string
          nullable: true
          description: The status of the latest charge. Null when no charge was attempted.
        checkout_status:
          type: string
          nullable: true
          description: >-
            The status of the checkout session. Null for payments made outside
            checkout.
        payment_status:
          type: string
          nullable: true
          description: >-
            The payment status of the checkout session. Null for payments made
            outside checkout.
        refund_count:
          type: integer
          description: Number of refunds on this payment.
        customer:
          allOf:
            - $ref: '#/components/schemas/TransactionCustomer'
          nullable: true
          description: The customer who made the payment. Null for guest payments.
        payment_method:
          allOf:
            - $ref: '#/components/schemas/TransactionPaymentMethod'
          nullable: true
          description: The payment method used. Null when none was attached.
        payment_context:
          allOf:
            - $ref: '#/components/schemas/PaymentContext'
          nullable: true
        product_summary:
          $ref: '#/components/schemas/TransactionProductSummary'
        decline_code:
          type: string
          nullable: true
          description: The decline code when the payment was declined. Null otherwise.
        decline_type:
          type: string
          nullable: true
          description: The decline type when the payment was declined. Null otherwise.
        failure_message:
          type: string
          nullable: true
          description: A readable explanation when the payment failed. Null otherwise.
        created_at:
          type: integer
          format: int64
          description: Unix timestamp in seconds when the transaction was created.
        updated_at:
          type: integer
          format: int64
          description: Unix timestamp in seconds when the transaction last changed.
      example:
        id: pi_2k9Lw3QmXb7TnR4s
        object: transaction
        payment_intent: pi_2k9Lw3QmXb7TnR4s
        merchant_reference: order-1042
        client_reference_id: null
        checkout_session: cs_8hF2vYp1NcZ6aD0e
        latest_charge: ch_5tR8uJq3WmK1xB7c
        source:
          type: payment_link
          label: Payment link
          checkout_mode: payment
          checkout_ui_mode: hosted
          payment_link: pl_4dN7sGb2HzE9yA3k
        livemode: false
        amount: 4900
        amount_refunded: 0
        currency: USD
        status: succeeded
        payment_intent_status: succeeded
        charge_status: succeeded
        checkout_status: complete
        payment_status: paid
        refund_count: 0
        customer:
          id: cus_6bV3mTq8LrP2wD5x
          email: jane@example.com
          first_name: Jane
          last_name: Doe
          name: Jane Doe
        payment_method:
          id: pm_3yH9cKs7QeU4nF1j
          type: card
          usage: reusable
          status: active
          brand: visa
          last4: '4242'
          exp_month: 12
          exp_year: 2030
          fingerprint: null
          funding: credit
          issuer: null
          country: US
          iin: '424242'
          billing_name: Jane Doe
          billing_email: jane@example.com
          billing_phone: null
          billing_address:
            line1: 123 Main St
            line2: null
            city: San Francisco
            state: CA
            postal_code: '94103'
            country: US
        payment_context: null
        product_summary:
          item_count: 1
          label: Starter plan
          names:
            - Starter plan
        decline_code: null
        decline_type: null
        failure_message: null
        created_at: 1790294400
        updated_at: 1790294412
    TransactionSource:
      type: object
      description: Where the payment came from.
      required:
        - type
        - label
      properties:
        type:
          type: string
          description: >-
            One of `api`, `checkout`, `payment_link`, `invoice`, or
            `subscription`.
        label:
          type: string
          description: A readable name for the source, such as `Payment link` or `Invoice`.
        checkout_mode:
          type: string
          description: >-
            The checkout session mode. Omitted when there is no checkout
            session.
        checkout_ui_mode:
          type: string
          description: >-
            How checkout was presented. Omitted when there is no checkout
            session.
        payment_link:
          type: string
          description: >-
            The payment link id (`pl_…`). Omitted when the payment did not come
            from a payment link.
        payment_link_type:
          type: string
          description: >-
            The payment link type. Omitted when the payment did not come from a
            payment link.
        invoice:
          type: string
          description: >-
            The invoice id (`inv_…`). Omitted when the payment is not for an
            invoice.
        subscription:
          type: string
          description: >-
            The subscription id (`sub_…`). Omitted when the payment is not a
            subscription renewal.
    TransactionCustomer:
      type: object
      description: The customer on a transaction.
      required:
        - id
        - email
        - first_name
        - last_name
        - name
      properties:
        id:
          type: string
          description: The customer id (`cus_…`).
        email:
          type: string
          nullable: true
          description: The customer's email address.
        first_name:
          type: string
          nullable: true
          description: The customer's first name.
        last_name:
          type: string
          nullable: true
          description: The customer's last name.
        name:
          type: string
          nullable: true
          description: The customer's full name.
    TransactionPaymentMethod:
      type: object
      description: >-
        The payment method used for a transaction. Card fields are null for
        other payment method types.
      required:
        - id
        - type
        - usage
        - status
        - brand
        - last4
        - exp_month
        - exp_year
        - fingerprint
        - funding
        - issuer
        - country
        - iin
        - billing_name
        - billing_email
        - billing_phone
        - billing_address
      properties:
        id:
          type: string
          description: The payment method id (`pm_…`).
        type:
          type: string
          description: The payment method type, such as `card`.
        usage:
          type: string
          nullable: true
          description: >-
            How the payment method can be reused, such as `single_use` or
            `reusable`.
        status:
          type: string
          nullable: true
          description: The payment method status.
        brand:
          type: string
          nullable: true
          description: The card brand, such as `visa`.
        last4:
          type: string
          nullable: true
          description: The last four digits of the card.
        exp_month:
          type: integer
          nullable: true
          description: The card's expiration month.
        exp_year:
          type: integer
          nullable: true
          description: The card's expiration year.
        fingerprint:
          type: string
          nullable: true
          description: >-
            A stable identifier for the card, the same across payment methods
            that use the same card.
        funding:
          type: string
          nullable: true
          description: The card funding type, such as `credit` or `debit`.
        issuer:
          type: string
          nullable: true
          description: The bank that issued the card.
        country:
          type: string
          nullable: true
          description: The two-letter country code of the card.
        iin:
          type: string
          nullable: true
          description: The first digits of the card number that identify the issuer.
        billing_name:
          type: string
          nullable: true
          description: The billing name.
        billing_email:
          type: string
          nullable: true
          description: The billing email address.
        billing_phone:
          type: string
          nullable: true
          description: The billing phone number.
        billing_address:
          allOf:
            - $ref: '#/components/schemas/TransactionBillingAddress'
          nullable: true
          description: The billing address. Null when none was provided.
    PaymentContext:
      type: object
      description: How and where this payment attempt was made. Null for older payments.
      required:
        - version
        - channel
        - flow
        - wallet
        - wallet_evidence
        - initiated_by
        - card_brand
        - card_funding
        - card_entry_method
        - observed_at
      properties:
        version:
          type: integer
          enum:
            - 1
          description: Version of the payment context format.
        channel:
          type: string
          description: >-
            Where the attempt originated, such as `api`, `dashboard`,
            `virtual_terminal`, `hosted_checkout`, `embedded_checkout`,
            `terminal`, or `automatic_billing`. `unknown` when not recorded.
        flow:
          type: string
          description: >-
            The kind of sale the attempt belongs to: `one_time`, `payment_link`,
            `invoice`, or `subscription`. `unknown` when not recorded.
        wallet:
          type: string
          enum:
            - unknown
            - none
            - apple_pay
            - google_pay
          description: >-
            The digital wallet used for this attempt, or `none` for a direct
            card payment. `unknown` when not recorded.
        wallet_evidence:
          type: string
          enum:
            - unknown
            - client_reported
            - server
            - provider
          description: How `wallet` was established. `unknown` when `wallet` is unknown.
        initiated_by:
          type: string
          description: >-
            Who started the attempt: `customer`, `merchant`, or `system`.
            `unknown` when not recorded.
        checkout_session_id:
          type: string
          description: >-
            ID of the checkout session (`cs_…`) the payment came from. Omitted
            when there is none.
        payment_link_id:
          type: string
          description: >-
            ID of the payment link (`pl_…`) the payment came from. Omitted when
            there is none.
        invoice_id:
          type: string
          description: >-
            ID of the invoice (`inv_…`) the payment is for. Omitted when there
            is none.
        subscription_id:
          type: string
          description: >-
            ID of the subscription (`sub_…`) the payment is for. Omitted when
            there is none.
        card_brand:
          type: string
          description: >-
            Card brand for this attempt: `visa`, `mastercard`, `amex`, or
            `discover`. `unknown` when not recorded.
        card_funding:
          type: string
          description: >-
            Card funding type for this attempt: `credit`, `debit`, or `prepaid`.
            `unknown` when not recorded.
        card_entry_method:
          type: string
          description: >-
            How the card was read for this attempt: `chip`, `contactless`,
            `swipe`, `manual`, or `fallback`. `unknown` when not recorded.
        card_country:
          type: string
          description: Two-letter country code for the card. Omitted when not known.
        observed_at:
          type: string
          format: date-time
          description: ISO 8601 date-time when these observations were recorded.
    TransactionProductSummary:
      type: object
      description: A short description of what was purchased.
      required:
        - item_count
        - label
        - names
      properties:
        item_count:
          type: integer
          description: Total quantity purchased across all line items.
        label:
          type: string
          description: >-
            A short label, such as the first product name followed by `+ 1
            more`.
        names:
          type: array
          description: The product names. Empty when there are none.
          items:
            type: string
    TransactionBillingAddress:
      type: object
      description: A billing address.
      required:
        - line1
        - line2
        - city
        - state
        - postal_code
        - country
      properties:
        line1:
          type: string
          nullable: true
          description: Address line 1.
        line2:
          type: string
          nullable: true
          description: Address line 2.
        city:
          type: string
          nullable: true
          description: City.
        state:
          type: string
          nullable: true
          description: State or region.
        postal_code:
          type: string
          nullable: true
          description: Postal code.
        country:
          type: string
          nullable: true
          description: Two-letter country code.
  responses:
    Unauthorized:
      description: >
        Missing or invalid API key. Returns one of `AUTHENTICATION_REQUIRED`,
        `API_KEY_INVALID`, `API_KEY_REVOKED`, or `API_KEY_EXPIRED`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: AUTHENTICATION_REQUIRED
              message: API key is required
    Forbidden:
      description: >
        The key cannot use this endpoint. Returns one of:


        - `SECRET_KEY_REQUIRED`: the key is not a secret or restricted key.

        - `INSUFFICIENT_PERMISSIONS`: the key lacks the `payments:read`
        permission.

        - `ACCOUNT_CREDENTIAL_REQUIRED`: the key is a platform key. Call this
        endpoint with the account's own key.

        - `FORBIDDEN`: the key does not belong to an account, or access to the
        account is denied.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INSUFFICIENT_PERMISSIONS
              message: insufficient permissions
    RateLimited:
      description: >-
        Too many requests. Returns `RATE_LIMIT_EXCEEDED`. Honour the
        `Retry-After` header before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: RATE_LIMIT_EXCEEDED
              message: rate limit exceeded
    InternalError:
      description: >-
        The API could not return a response. Returns `INTERNAL_ERROR`. Retrying
        the request is safe.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INTERNAL_ERROR
              message: internal error
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >-
        A secret key (`sk_…`) or restricted key (`rk_…`) sent as `Authorization:
        Bearer <key>`.

````

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