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

# Retrieve a Payment Session

> Retrieve a payment session



## OpenAPI

````yaml GET /collect/payment_sessions/{id}
openapi: 3.1.0
info:
  version: 1.0.0
  title: Payment Sessions API
  description: Payment Sessions API
  contact:
    name: Moment
    url: https://momentco.net
    email: support@momentco.net
servers:
  - url: https://api.momentpay.net
security: []
tags:
  - name: Event Model
    x-displayName: Event Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/event" />
  - name: Payment Sessions
    x-displayName: Payment Sessions
    description: >-
      A `Payment Session` represents a single interaction for initiating and
      managing a payment, tracking its status, outcome, and associated metadata.
  - name: Payment Session Model
    x-displayName: Payment Session Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/payment_session" />
  - name: Problem Detail Model
    x-displayName: Problem Detail Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/problem_detail" />
externalDocs:
  description: Read the full API documentation
  url: https://momentco.net/docs
paths:
  /collect/payment_sessions/{id}:
    get:
      tags:
        - Payment Sessions
      summary: Retrieve a payment session
      description: Retrieve a payment session
      operationId: retrieve_payment_session
      parameters:
        - name: id
          in: path
          description: The unique identifier for the payment session.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Payment session retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/payment_session'
          headers:
            Request-Id:
              $ref: '#/components/headers/request_id'
        '400':
          $ref: '#/components/responses/bad_request'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/not_found'
        '500':
          $ref: '#/components/responses/internal_server_error'
      security:
        - bearer_auth: []
components:
  schemas:
    payment_session:
      title: Payment Session Object
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the payment session.
          example: ps_kfAWZgfQIoeG0q
        type:
          $ref: '#/components/schemas/type'
        amount:
          $ref: '#/components/schemas/amount'
        currency:
          $ref: '#/components/schemas/currency'
        status:
          type: string
          enum:
            - active
            - completed
            - expired
            - cancelled
          description: |
            The current status of the payment session.
              - `active`: The session is in progress. The customer is interacting with the payment flow or the payment (via `session_url`), or the payment is being processed programmitcally using a saved payment method. Dependendent on the payment session type.
              - `completed`: The session completed successfully.
              - `expired`: The session expired due to inactivity or a timeout.
              - `cancelled`: The session was cancelled by the customer or merchant.
        payment_status:
          type: string
          enum:
            - paid
            - unpaid
            - pending
          deprecated: true
          description: >
            Deprecated. Use `payment_outcome` instead.


            The status of the payment associated with the session:

            - `paid`: The payment succeeded.

            - `unpaid`: The payment failed or has not yet succeeded.

            - `pending`: The payment is still being processed and has not
            succeeded yet.
        payment_outcome:
          $ref: '#/components/schemas/payment_outcome'
        customer_id:
          $ref: '#/components/schemas/customer_id'
        payment_method_id:
          $ref: '#/components/schemas/payment_method_id'
        checkout_session_id:
          type:
            - 'null'
            - string
          example: chk_456789abc123def
          description: >
            The ID of the associated checkout session (for `one_time` or
            `first_in_series` types).
        payment_id:
          $ref: '#/components/schemas/payment_id'
        session_url:
          type: string
          format: uri
          example: https://moment.dev.momentpay.io/checkout/cktNnkWtk7p5GJd85
          description: >
            The URL where the customer is redirected to complete their payment
            in a secure payment flow. The customer can choose from a list of
            available payment methods, complete the payment, and is returned to
            the `return_url` once the session is complete.

            - Only returned for `one_time` and `first_in_series` types where
            where the customer is present in the flow and needs to complete the
            payment.

            - Not returned for `subsequent` payments where the customer is not
            present in the flow, and payment is completed automatically.
        return_url:
          $ref: '#/components/schemas/return_url'
        last_payment_error:
          $ref: '#/components/schemas/last_payment_error'
        mode:
          type: string
          enum:
            - live
            - test
          description: >
            Indicates whether the payment session is in live or test mode:

            - **`test`**: Used for testing and development. Payments are
            simulated, and no real transactions are processed. You can use test
            credit cards and accounts to ensure your integration works as
            expected before going live.

            - **`live`**: Used in production to process real payments. Real
            credit cards and accounts are used, and actual transactions occur.
            This mode is for accepting real money from customers.
        external_reference:
          $ref: '#/components/schemas/external_reference'
        payment_allocation:
          allOf:
            - $ref: '#/components/schemas/payment_allocation'
              description: >-
                🚧 **Coming Soon.** Restricts collections to specific days of
                the week or month.
        metadata:
          $ref: '#/components/schemas/metadata_fields'
        created_at:
          $ref: '#/components/schemas/created_at'
        updated_at:
          $ref: '#/components/schemas/updated_at'
      additionalProperties: false
    type:
      title: Session Type
      type: string
      enum:
        - one_time
        - first_in_series
        - next_in_series
      description: >
        The type of payment session (defaults to `one_time`):

        - `one_time`: A one-time payment where the customer is present in the
        flow and completes the payment. Optionally, the payment method can be
        saved for future use where the customer is present in the flow. For
        example, buying a product and optionally saving the card for later
        one-off purchases.

        - `first_in_series`: The first payment where the customer is present in
        the flow, representing the first payment in a series of future
        next_in_series payments where the payment method is saved for future use
        when the customer is not present in the flow. A mandate is recorded for
        compliance purposes. For example, setting up a subscription or
        installment plan for a product or service.

        - `next_in_series`: A subsequent payment where the customer is not
        present in the flow, representing the next payment in a series of
        payments, and is charged automatically using a saved payment method
        (`payment_method_id`) and the associated customer (`customer_id`). For
        example, the next payment on a subscription or installment plan for a
        product or service.
    amount:
      title: Amount
      type: integer
      description: >
        The amount to be charged in the smallest currency unit. For example,
        *20.00 ZAR* is represented as *2000 cents*.   Learn more about [minor
        units](/api-reference/basics/monetary_amounts#minor-units-explained).
      example: 1000
    currency:
      title: Currency
      type: string
      description: The ISO 4217 currency code for the payment.
      example: ZAR
    payment_outcome:
      title: Payment Outcome
      type: string
      enum:
        - not_started
        - pending
        - paid
        - unpaid
        - reserved
        - payment_method_verified
      description: >
        The outcome of the payment associated with the session:

        - `not_started`: Payment has not been initiated. A draft payment object
        may exist but nothing is awaiting an outcome.

        - `pending`: Payment has been initiated and is awaiting a final outcome.
        May be waiting on customer action (for example, authentication,
        redirect, voucher) or provider confirmation (for example, bank, network,
        async settlement).

        - `paid`: Payment succeeded. Terminal.

        - `unpaid`: Payment failed, expired, or was cancelled. Terminal.

        - `reserved`: Funds were authorised successfully and are reserved on the
        payment method. Applies to `capture_method: manual` flows. The session
        outcome remains `reserved` even after subsequent capture or void
        operations, which are tracked on the underlying payment resource.

        - `payment_method_verified`: No payment was taken. Payment method was
        verified and vaulted via a supported `amount: 0` `one_time` or
        `first_in_series` session. Terminal. Only applicable when `amount: 0` on
        those supported session types.
    customer_id:
      title: Customer ID
      type: string
      description: The ID of the customer associated with the payment session.
    payment_method_id:
      title: Payment Method ID
      type: string
      description: >-
        The ID of the saved payment method for a customer associated with this
        payment session.
    payment_id:
      type: string
      description: Unique identifier for a payment
      example: p_xyz789abc123def456
    return_url:
      title: Return URL
      type: string
      format: uri
      example: https://callback.merchant-shop.com
      description: >
        The URL where the customer that is present in the payment flow is
        redirected to after completing the payment.

        Only applicable to `one_time` and `first_in_series` payment session
        types where the customer is present in the flow. 

        The customer is typically redirected on success, cancellation or
        expiration.
    last_payment_error:
      title: Last Payment Error
      type: object
      description: Details of last error that occurred during a payment attempt.
      properties:
        error_code:
          type: string
          description: A short code representing the type of error (e.g. `card_declined`).
        decline_code:
          type: string
          description: >
            A code that explains why a card transaction was declined, typically
            provided by the issuing bank, payment processor, or credit card
            network. (e.g. `insufficient_funds`)
        message:
          type: string
          description: A human-readable message describing the error.
          example: General Error
        timestamp:
          type: string
          format: date-time
          description: The timestamp of when the error occurred.
      additionalProperties: false
    external_reference:
      type: string
      description: |
        External reference for reconciliation or tracking purposes.
        Must be unique within your merchant account.
      maxLength: 255
      pattern: ^[a-zA-Z0-9_-]+$
      example: INV-2024-001
    payment_allocation:
      title: Payment Allocation
      type: object
      description: >
        The purpose and target of the payment. Immutable once the session is
        created. See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      properties:
        purpose:
          type: string
          enum:
            - purchase
            - wallet_funding
            - gaming_deposit
            - settlement
            - invoice_payment
            - merchant_defined
          description: >
            The reason the payment is being made. See [Payment
            Allocation](/documentation/collect/payment-sessions/payment-allocation)
            for details.
        applies_to:
          oneOf:
            - $ref: '#/components/schemas/allocation_target_customer'
            - $ref: '#/components/schemas/allocation_target_account'
            - $ref: '#/components/schemas/allocation_target_bill'
            - $ref: '#/components/schemas/allocation_target_payment_request'
            - $ref: '#/components/schemas/allocation_target_wallet'
            - $ref: '#/components/schemas/allocation_target_merchant_wallet'
            - $ref: '#/components/schemas/allocation_target_merchant_gaming_account'
            - $ref: '#/components/schemas/allocation_target_merchant_invoice'
            - $ref: '#/components/schemas/allocation_target_merchant_defined'
            - $ref: '#/components/schemas/allocation_target_unstructured'
      required:
        - purpose
      additionalProperties: false
    metadata_fields:
      type: object
      description: >
        Set of key-value pairs that you can attach to an object. This can be
        useful

        for storing additional information about the object in a structured
        format.

        NEW

        **Limitations:**

        - Maximum 20 keys

        - Key names must be strings (max 40 characters)

        - Values must be strings (max 500 characters)
      additionalProperties:
        type: string
      example:
        customer_id: cust_123456
        order_id: ord_789012
    created_at:
      type: string
      format: date-time
      description: ISO 8601 timestamp when the resource was created
      example: '2025-06-16T10:30:00Z'
    updated_at:
      type: string
      format: date-time
      description: ISO 8601 timestamp when the resource was last updated
      example: '2025-06-16T10:30:00Z'
    problem_detail:
      title: Problem Detail Object
      type: object
      properties:
        type:
          type: string
          description: >
            A URI reference that identifies the problem type. This URI should
            provide human-readable documentation for the problem type.
        title:
          type: string
          description: |
            A short, human-readable summary of the problem type.
        status:
          type: integer
          description: |
            The HTTP status code applicable to this problem.
        detail:
          type: string
          description: >
            A human-readable explanation specific to this occurrence of the
            problem.
        instance:
          type: string
          description: >
            A URI reference that identifies the specific occurrence of the
            problem.
        code:
          type: string
          description: A machine-readable code that describes the specific error condition
          enum:
            - bad_request
            - conflict
            - unauthorized
            - missing_authorization
            - operation_not_allowed
            - resource_not_found
            - resource_already_exists
            - bill_already_voided
            - internal_server_error
            - payment_not_found
          example: bad_request
      required:
        - type
        - title
        - status
      description: |
        A standardized format for problem details, following RFC 9457.
    allocation_target_customer:
      title: Customer
      type: object
      description: >
        Applied to a Moment-managed customer. Moment resolves which bills or
        payment requests to settle. See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - customer
          description: |
            A Moment-managed customer. `id` must be a Moment customer object ID.
        id:
          type: string
          description: Moment customer object ID, prefixed with `cust_`.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          additionalProperties:
            type: string
          description: >
            Free-form key-value pairs stamped onto the customer record at
            settlement time. Not evaluated by Moment for compliance. Maximum 20
            keys. Key names must be strings (max 40 characters). Values must be
            strings (max 500 characters).
      additionalProperties: false
    allocation_target_account:
      title: Account
      type: object
      description: >
        Applied to a Moment-managed account. Moment resolves which bills or
        payment requests to settle. See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - account
          description: |
            A Moment-managed account. `id` must be a Moment account object ID.
        id:
          type: string
          description: Moment account object ID, prefixed with `acc_`.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          additionalProperties:
            type: string
          description: >
            Free-form key-value pairs stamped onto the account record at
            settlement time. Not evaluated by Moment for compliance. Maximum 20
            keys. Key names must be strings (max 40 characters). Values must be
            strings (max 500 characters).
      additionalProperties: false
    allocation_target_bill:
      title: Bill
      type: object
      description: >
        Applied to a Moment-managed bill. See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - bill
          description: >
            A Moment-managed bill. `id` must be a Moment bill ID with the
            `bill_` prefix.
        id:
          type: string
          description: Moment bill ID, prefixed with `bill_`.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          additionalProperties:
            type: string
          description: >
            Free-form key-value pairs stamped onto the bill record at settlement
            time. Not evaluated by Moment for compliance. Maximum 20 keys. Key
            names must be strings (max 40 characters). Values must be strings
            (max 500 characters).
      additionalProperties: false
    allocation_target_payment_request:
      title: Payment Request
      type: object
      description: >
        Applied to a Moment-managed payment request. See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - payment_request
          description: >
            A Moment-managed payment request. `id` must be a Moment payment
            request ID with the `pr_` prefix.
        id:
          type: string
          description: Moment payment request ID, prefixed with `pr_`.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          additionalProperties:
            type: string
          description: >
            Free-form key-value pairs stamped onto the payment request record at
            settlement time. Not evaluated by Moment for compliance. Maximum 20
            keys. Key names must be strings (max 40 characters). Values must be
            strings (max 500 characters).
      additionalProperties: false
    allocation_target_wallet:
      title: Wallet
      type: object
      description: >
        Applied to a Moment-managed wallet. No compliance attributes required.
        See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - wallet
          description: |
            A Moment-managed wallet. `id` must be a Moment wallet object ID.
        id:
          type: string
          description: Moment wallet object ID.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          additionalProperties:
            type: string
          description: >
            Free-form key-value pairs stamped onto the wallet funding record at
            transaction time. Not evaluated by Moment for compliance. Maximum 20
            keys. Key names must be strings (max 40 characters). Values must be
            strings (max 500 characters).
      additionalProperties: false
    allocation_target_merchant_wallet:
      title: Merchant Wallet
      type: object
      description: >
        Applied to a wallet in the merchant system or an external platform.
        Compliance attributes required for AML and sanctions screening. See
        [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
        - id
        - attributes
      properties:
        type:
          type: string
          enum:
            - merchant_wallet
          description: >
            A wallet held in the merchant system or an external platform. `id`
            is the merchant-defined identifier.
        id:
          type: string
          description: Merchant-defined wallet identifier.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          required:
            - recipient
            - jurisdiction
          additionalProperties: false
          properties:
            recipient:
              $ref: '#/components/schemas/attributes_recipient'
            jurisdiction:
              type: string
              description: >
                Regulatory jurisdiction of the wallet scheme. Typically an ISO
                3166-1 alpha-2 country code (for example `ZA`), but may be a
                sub-national region or other regulatory zone where the licensing
                authority is not at country level. May differ from
                `recipient.country`.
            account:
              $ref: '#/components/schemas/attributes_account'
      additionalProperties: false
    allocation_target_merchant_gaming_account:
      title: Merchant Gaming Account
      type: object
      description: >
        Applied to a gaming or gambling account in the merchant system.
        Compliance attributes required. Payments blocked for self-excluded
        players. See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
        - id
        - attributes
      properties:
        type:
          type: string
          enum:
            - merchant_gaming_account
          description: >
            A gaming or gambling account in the merchant system. `id` is the
            merchant-defined identifier.
        id:
          type: string
          description: Merchant-defined player or account identifier.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          required:
            - recipient
            - jurisdiction
            - gaming
          additionalProperties: false
          properties:
            recipient:
              $ref: '#/components/schemas/attributes_recipient'
            gaming:
              $ref: '#/components/schemas/attributes_gaming'
            jurisdiction:
              type: string
              description: >
                Regulatory jurisdiction of the gaming operator. Typically an ISO
                3166-1 alpha-2 country code (for example `ZA` or `CW`), but may
                be a sub-national region or other regulatory zone where the
                licensing authority is not at country level. Drives regulatory
                rule selection. May differ from `recipient.country` when a
                player in one country uses a platform licensed in another.
            account:
              $ref: '#/components/schemas/attributes_account'
      additionalProperties: false
    allocation_target_merchant_invoice:
      title: Merchant Invoice
      type: object
      description: >
        Applied to an invoice in the merchant system or an external platform.
        See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - merchant_invoice
          description: >
            An invoice in the merchant system or an external platform. `id` is
            the merchant-defined identifier.
        id:
          type: string
          description: Merchant-defined invoice identifier.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          properties:
            invoice_number:
              type: string
              description: Invoice reference in the merchant system.
            purchase_order:
              type: string
              description: Purchase order number if applicable.
          additionalProperties: false
      additionalProperties: false
    allocation_target_merchant_defined:
      title: Merchant Defined
      type: object
      description: >
        Applied to a custom target defined by the merchant. See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - merchant_defined
          description: |
            A custom target type defined by the merchant.
        id:
          type: string
          description: Merchant-defined identifier for the target.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          additionalProperties:
            type: string
          description: >
            Free-form key-value pairs for merchant-defined compliance or
            operational data. Maximum 20 keys. Key names must be strings (max 40
            characters). Values must be strings (max 500 characters).
      additionalProperties: false
    allocation_target_unstructured:
      title: Unstructured
      type: object
      description: >
        Applied to a target with no structured identifier. Requires at least one
        of `description` or `attributes`. See [Payment
        Allocation](/documentation/collect/payment-sessions/payment-allocation)
        for details.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - unstructured
          description: >
            An unstructured target with no identifier. Use `description` or
            `attributes` to describe the target.
        description:
          type: string
          description: Human-readable description of the target.
        attributes:
          type: object
          additionalProperties:
            type: string
          description: >
            Free-form key-value pairs for merchant-defined data about the
            target. Maximum 20 keys. Key names must be strings (max 40
            characters). Values must be strings (max 500 characters).
      additionalProperties: false
    attributes_recipient:
      title: Recipient
      description: >-
        Identity of the payment recipient. Used for AML, PEP, and sanctions
        screening.
      type: object
      additionalProperties: false
      required:
        - name
        - country
      properties:
        name:
          type: string
          description: Full legal name of the recipient.
        first_name:
          type: string
          description: >-
            First name. Optional complement to `name` for providers that require
            split name fields.
        middle_name:
          type: string
          description: >-
            Middle name. Used for identity disambiguation where first and last
            name collisions are common.
        last_name:
          type: string
          description: >-
            Last name. Optional complement to `name` for providers that require
            split name fields.
        country:
          $ref: '#/components/schemas/country_code'
          description: Country of residence of the recipient.
        date_of_birth:
          type: string
          format: date
          description: >-
            Date of birth in `yyyy-mm-dd` format. Required by some regulators
            for age verification.
        identification:
          $ref: '#/components/schemas/attributes_identification'
        address:
          $ref: '#/components/schemas/address'
    attributes_account:
      title: Account
      description: Wallet or account metadata for risk classification and program routing.
      type: object
      additionalProperties: false
      properties:
        type:
          type: string
          description: >-
            Type of wallet or account (for example `savings`, `current`,
            `ewallet`).
        program:
          type: string
          description: Program or scheme identifier for the wallet or account.
    attributes_gaming:
      title: Gaming Compliance
      description: >-
        Responsible gambling and regulatory compliance attributes for gaming
        deposits.
      type: object
      additionalProperties: false
      required:
        - kyc_status
        - player_status
        - deposit_limit_applied
      properties:
        kyc_status:
          type: string
          enum:
            - verified
            - pending
            - unverified
          description: KYC verification status of the player.
        player_status:
          type: string
          enum:
            - active
            - suspended
            - self_excluded
          description: Account status of the player.
        deposit_limit_applied:
          type: boolean
          description: >-
            Whether deposit limits have been checked and applied for this
            player.
        tier:
          type: string
          description: Player classification or VIP tier.
    country_code:
      title: Country Code
      type: string
      description: ISO 3166-1 alpha-2 country code.
      pattern: ^[A-Z]{2}$
      example: ZA
    attributes_identification:
      title: Identification
      description: Identity document details for the recipient.
      type: object
      additionalProperties: false
      properties:
        type:
          $ref: '#/components/schemas/identity_document_type'
          description: Type of identity document.
        number:
          type: string
          description: Identity document number.
        issuing_country:
          $ref: '#/components/schemas/country_code'
          description: >-
            Country that issued the identity document. May differ from `country`
            for foreign nationals.
    address:
      title: Address
      type: object
      description: Postal address.
      properties:
        line1:
          type: string
          description: First line of the address (street, PO Box, etc.)
          maxLength: 200
          example: 123 Main Street
        line2:
          type: string
          description: Second line of the address (apartment, suite, floor, etc.)
          maxLength: 200
        city:
          type: string
          description: City or locality.
          maxLength: 100
        state:
          type: string
          description: State, province, or region.
          maxLength: 100
        postal_code:
          type: string
          description: Postal code or ZIP code.
          maxLength: 20
        pin:
          type: string
          description: 'Deprecated: use `postal_code` instead.'
          deprecated: true
          maxLength: 20
        country:
          $ref: '#/components/schemas/country_code'
          description: Country of the address.
      additionalProperties: false
    identity_document_type:
      title: Identity Document Type
      type: string
      description: Type of identity document used for KYC and AML verification.
      enum:
        - national_id
        - passport
        - drivers_license
        - asylum_seeker_permit
        - other
  headers:
    request_id:
      description: >
        A unique identifier for the request, used for tracing and debugging
        purposes.

        This `Request-Id` is included in every response to enable request
        tracing across multiple services or systems.

        It helps correlate logs and track the flow of requests through
        distributed systems.

        The value is typically a universally unique identifier (UUID) to ensure
        uniqueness across requests.
      schema:
        type: string
        examples:
          - 63efe730-f599-40a5-afb7-9dda5fc31773
  responses:
    bad_request:
      description: Invalid input or parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/problem_detail'
          example:
            type: https://docs.momentco.io/errors/bad_request
            title: Invalid Request
            status: 400
            detail: The currency field must be a valid ISO 4217 currency code.
            instance: /payment_sessions
      headers:
        Request-Id:
          $ref: '#/components/headers/request_id'
    unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/problem_detail'
          example:
            type: https://docs.momentco.io/errors/unauthorized
            title: Unauthorized
            status: 401
            detail: The API key provided is invalid.
            instance: /payment_sessions
      headers:
        Request-Id:
          $ref: '#/components/headers/request_id'
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/problem_detail'
          example:
            type: https://docs.momentco.io/errors/not_found
            title: Resource Not Found
            status: 404
            detail: The requested payment session does not exist.
            instance: /payment_sessions/12345
      headers:
        Request-Id:
          $ref: '#/components/headers/request_id'
    internal_server_error:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/problem_detail'
          example:
            type: https://docs.momentco.io/errors/internal_server_error
            title: Internal Server Error
            status: 500
            detail: An unexpected error occurred. Please try again later.
            instance: /payment_sessions
      headers:
        Request-Id:
          $ref: '#/components/headers/request_id'
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Authentication using Bearer tokens. Include your API key in the
        Authorization header.


        **Key Types:**

        - **Test Keys**: `sk_test_*` for development and testing

        - **Live Keys**: `sk_*` for production environments

        - **Public Keys**: `pk_test_*` or `pk_*` for client-side operations



        > 📩 **Need access?** [Contact Support](/documentation/support) to
        request your API keys.



        **Usage:**

        ```http

        Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc

        ```

````