> ## 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.

# Retrieve a transaction

> Returns a transaction with everything in the list item plus the payment
intent details, the invoice (when the payment was for one), the checkout
session, its line items, every charge attempt, and every refund.




## OpenAPI

````yaml /openapi/transactions.yaml get /transactions/{id}
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/{id}:
    get:
      tags:
        - Transactions
      summary: Retrieve a transaction
      description: |
        Returns a transaction with everything in the list item plus the payment
        intent details, the invoice (when the payment was for one), the checkout
        session, its line items, every charge attempt, and every refund.
      operationId: retrieveTransaction
      parameters:
        - name: id
          in: path
          required: true
          description: The transaction id (`pi_…`).
          schema:
            type: string
      responses:
        '200':
          description: The transaction with full detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDetail'
        '400':
          description: >
            Returns `ACCOUNT_CONTEXT_NOT_SUPPORTED` when the request includes an
            `Ionic-Account` header, which this endpoint does not accept.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: ACCOUNT_CONTEXT_NOT_SUPPORTED
                  message: >-
                    this endpoint does not accept the Ionic-Account header;
                    remove it, and the request acts on the account that owns
                    your API key
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: >-
            No transaction with that id exists in this mode on your account.
            Returns `PAYMENT_INTENT_NOT_FOUND`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: PAYMENT_INTENT_NOT_FOUND
                  message: transaction not found
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - secretKey:
            - payments:read
components:
  schemas:
    TransactionDetail:
      description: >-
        A transaction with its payment intent details, invoice, checkout
        session, line items, charges, and refunds. Every field of `Transaction`
        is also present.
      allOf:
        - $ref: '#/components/schemas/Transaction'
        - type: object
          required:
            - payment_intent_details
            - checkout
            - line_items
            - charges
            - refunds
          properties:
            payment_intent_details:
              $ref: '#/components/schemas/TransactionPaymentIntent'
            invoice:
              allOf:
                - $ref: '#/components/schemas/TransactionInvoice'
              description: >-
                The invoice this payment was for. Omitted when the payment is
                not for an invoice.
            checkout:
              allOf:
                - $ref: '#/components/schemas/TransactionCheckout'
              nullable: true
              description: >-
                The checkout session behind the payment. Null for payments made
                outside checkout.
            line_items:
              type: array
              description: >-
                What was purchased. Empty when the payment has no checkout
                session.
              items:
                $ref: '#/components/schemas/TransactionLineItem'
            charges:
              type: array
              description: Every charge attempt for this payment.
              items:
                $ref: '#/components/schemas/TransactionCharge'
            refunds:
              type: array
              description: Every refund issued against this payment.
              items:
                $ref: '#/components/schemas/TransactionRefund'
    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
    TransactionPaymentIntent:
      type: object
      description: The payment intent behind a transaction.
      required:
        - id
        - status
        - amount
        - currency
        - capture_method
        - payment_method
        - customer
        - reference
        - metadata
      properties:
        id:
          type: string
          description: The payment intent id (`pi_…`).
        status:
          type: string
          description: The payment intent status.
        amount:
          type: integer
          format: int64
          description: Amount in the smallest currency unit.
        currency:
          type: string
          description: Three-letter ISO currency code, such as `USD`.
        capture_method:
          type: string
          description: When funds are captured, such as `automatic` or `manual`.
        payment_method:
          type: string
          nullable: true
          description: The payment method id (`pm_…`). Null when none was attached.
        customer:
          type: string
          nullable: true
          description: The customer id (`cus_…`). Null for guest payments.
        reference:
          type: string
          nullable: true
          description: Your reference for the payment. Null when none was set.
        metadata:
          type: object
          description: >-
            Key-value pairs you attached to the payment intent. Empty when there
            are none.
          additionalProperties: true
    TransactionInvoice:
      type: object
      description: The invoice a payment was for.
      required:
        - id
        - number
        - status
        - currency
        - total
        - amount_paid
        - amount_remaining
        - payment_intent
        - subscription
        - created_at
      properties:
        id:
          type: string
          description: The invoice id (`inv_…`).
        number:
          type: string
          nullable: true
          description: The invoice number. Null until the invoice is finalized.
        status:
          type: string
          description: The invoice status.
        currency:
          type: string
          description: Three-letter ISO currency code, such as `USD`.
        total:
          type: integer
          format: int64
          description: Invoice total in the smallest currency unit.
        amount_paid:
          type: integer
          format: int64
          description: Amount paid so far, in the smallest currency unit.
        amount_remaining:
          type: integer
          format: int64
          description: Amount still owed, in the smallest currency unit.
        payment_intent:
          type: string
          nullable: true
          description: The payment intent id (`pi_…`) for the invoice's current payment.
        subscription:
          type: string
          nullable: true
          description: >-
            The subscription id (`sub_…`) when the invoice belongs to a
            subscription.
        created_at:
          type: integer
          format: int64
          description: Unix timestamp in seconds when the invoice was created.
    TransactionCheckout:
      type: object
      description: The checkout session behind a transaction.
      required:
        - id
        - status
        - payment_status
        - url
        - customer_email
        - success_url
        - cancel_url
        - expires_at
        - completed_at
      properties:
        id:
          type: string
          description: The checkout session id (`cs_…`).
        status:
          type: string
          description: The checkout session status.
        payment_status:
          type: string
          description: The checkout session payment status.
        mode:
          type: string
          description: The checkout session mode. Omitted when not set.
        ui_mode:
          type: string
          description: How checkout was presented. Omitted when not set.
        submit_type:
          type: string
          description: The label shown on the pay button. Omitted when not set.
        payment_link_id:
          type: string
          description: >-
            The payment link id (`pl_…`). Omitted when the session did not come
            from a payment link.
        payment_link_type:
          type: string
          description: >-
            The payment link type. Omitted when the session did not come from a
            payment link.
        client_reference_id:
          type: string
          description: >-
            The client reference id set on the session. Omitted when none was
            set.
        url:
          type: string
          nullable: true
          description: The hosted checkout URL. Null when the session has none.
        customer_email:
          type: string
          nullable: true
          description: The email address collected or provided for the session.
        success_url:
          type: string
          nullable: true
          description: Where the buyer is sent after paying.
        cancel_url:
          type: string
          nullable: true
          description: Where the buyer is sent after canceling.
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 date-time when the session expires.
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 date-time when the session was completed.
    TransactionLineItem:
      type: object
      description: One purchased item.
      required:
        - id
        - item_type
        - name
        - description
        - quantity
        - unit_amount
        - amount
        - currency
        - price
        - product
        - fulfillment_type
        - price_nickname
        - product_name
      properties:
        id:
          type: string
          description: The line item id.
        item_type:
          type: string
          description: The kind of item.
        name:
          type: string
          description: The name shown to the buyer.
        description:
          type: string
          nullable: true
          description: A description of the item.
        quantity:
          type: integer
          description: Quantity purchased.
        unit_amount:
          type: integer
          format: int64
          description: Price per unit in the smallest currency unit.
        amount:
          type: integer
          format: int64
          description: Line total in the smallest currency unit.
        currency:
          type: string
          description: Three-letter ISO currency code, such as `USD`.
        price:
          type: string
          nullable: true
          description: The price id (`price_…`). Null for ad hoc items.
        product:
          type: string
          nullable: true
          description: The product id (`prod_…`). Null for ad hoc items.
        fulfillment_type:
          type: string
          description: How the item is fulfilled.
        price_nickname:
          type: string
          nullable: true
          description: The price's nickname in your catalog.
        product_name:
          type: string
          nullable: true
          description: The product's name in your catalog.
    TransactionCharge:
      type: object
      description: One charge attempt for a transaction.
      required:
        - payment_lifecycle
        - id
        - payment_intent
        - status
        - amount
        - amount_refunded
        - currency
        - card_number
        - card_exp
        - payment_method
        - payment_method_details
        - decline_code
        - decline_type
        - failure_code
        - failure_message
        - settled_at
        - created_at
        - updated_at
        - terminal
      properties:
        payment_lifecycle:
          $ref: '#/components/schemas/PaymentLifecycle'
        id:
          type: string
          description: The charge id (`ch_…`).
        payment_intent:
          type: string
          description: The payment intent id (`pi_…`).
        status:
          type: string
          description: The charge status.
        amount:
          type: integer
          format: int64
          description: Amount in the smallest currency unit.
        amount_refunded:
          type: integer
          format: int64
          description: Amount refunded from this charge, in the smallest currency unit.
        currency:
          type: string
          description: Three-letter ISO currency code, such as `USD`.
        card_number:
          type: string
          nullable: true
          description: The masked card number, such as `424242******4242`.
        card_exp:
          type: string
          nullable: true
          description: The card's expiration date.
        payment_method:
          type: string
          nullable: true
          description: The payment method id (`pm_…`) used for the charge.
        payment_method_details:
          allOf:
            - $ref: '#/components/schemas/TransactionPaymentMethod'
          nullable: true
          description: The payment method used for the charge. Null when none was attached.
        decline_code:
          type: string
          nullable: true
          description: The decline code when the charge was declined.
        decline_type:
          type: string
          nullable: true
          description: The decline type when the charge was declined.
        failure_code:
          type: string
          nullable: true
          description: A stable code when the charge failed.
        failure_message:
          type: string
          nullable: true
          description: A readable explanation when the charge failed.
        settled_at:
          type: integer
          format: int64
          nullable: true
          description: >-
            Unix timestamp in seconds when the charge settled. Null until it
            settles.
        created_at:
          type: integer
          format: int64
          description: Unix timestamp in seconds when the charge was created.
        updated_at:
          type: integer
          format: int64
          description: Unix timestamp in seconds when the charge last changed.
        terminal:
          type: string
          nullable: true
          description: >-
            The id of the terminal that took the payment. Null for online
            payments.
    TransactionRefund:
      type: object
      description: One refund issued against a transaction.
      required:
        - succeeded_at
        - id
        - charge
        - payment_intent
        - status
        - amount
        - currency
        - reason
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: The refund id (`re_…`).
        charge:
          type: string
          description: The charge id (`ch_…`) that was refunded.
        payment_intent:
          type: string
          description: The payment intent id (`pi_…`).
        status:
          type: string
          description: The refund status.
        amount:
          type: integer
          format: int64
          description: Amount refunded in the smallest currency unit.
        currency:
          type: string
          description: Three-letter ISO currency code, such as `USD`.
        reason:
          type: string
          nullable: true
          description: The reason given for the refund.
        succeeded_at:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 date-time when the refund succeeded. Null until it does.
        created_at:
          type: integer
          format: int64
          description: Unix timestamp in seconds when the refund was created.
        updated_at:
          type: integer
          format: int64
          description: Unix timestamp in seconds when the refund last changed.
    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
    PaymentLifecycle:
      type: object
      description: >-
        First observed lifecycle times. Null means not observed, including
        historical records; times are never inferred from later updates.
      required:
        - attempted_at
        - dispatched_at
        - authorized_at
        - captured_at
        - voided_at
        - finalized_at
      properties:
        attempted_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO 8601 date-time when the attempt was created. Null when not
            observed.
        dispatched_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO 8601 date-time when the attempt was sent for processing. Null
            when not observed.
        authorized_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO 8601 date-time when the payment was authorized. Null when not
            observed.
        captured_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO 8601 date-time when the payment was captured. Null when not
            observed.
        voided_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO 8601 date-time when the authorization was voided. Null when not
            observed.
        finalized_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO 8601 date-time when the attempt reached its final outcome. Null
            when not observed.
    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.