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

# Retrieve a checkout session

> Returns the session and the payment it created. Use this to confirm the outcome after the payer returns to your `return_url`.



## OpenAPI

````yaml /api-reference/openapi.json get /payment/checkouts/{checkoutId}
openapi: 3.1.0
info:
  title: Orqex Orchestrate API
  version: 1.0.0
  description: >-
    The Orqex Orchestrate API for collecting payments and sending payouts.


    Authenticate with a secret key as a bearer token; the key also selects the
    environment. Amounts are in major units everywhere: `50` means 50.00. Writes
    accept an `X-Idempotency-Key` header. Lists are cursor-paginated.


    Which countries, currencies and payment methods are available depends on
    your project configuration: read them from the discovery endpoints at
    payment time, or look them up in your dashboard.
  contact:
    name: Orqex Orchestrate
    url: https://orqex.com
servers:
  - url: https://api.orqex.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Checkout
    description: Hosted checkout sessions.
  - name: Payment intents
    description: Payments, discovery and reconciliation.
  - name: Payment attempts
    description: Collecting a payment and confirming it.
  - name: Refunds
    description: Returning money to a payer.
  - name: Payouts
    description: Sending money out.
  - name: Utilities
    description: Exchange rates and method status.
paths:
  /payment/checkouts/{checkoutId}:
    get:
      tags:
        - Checkout
      summary: Retrieve a checkout session
      description: >-
        Returns the session and the payment it created. Use this to confirm the
        outcome after the payer returns to your `return_url`.
      operationId: getCheckout
      parameters:
        - name: checkoutId
          in: path
          required: true
          description: The checkout session id.
          schema:
            type: string
      responses:
        '200':
          description: The checkout session.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      checkout:
                        $ref: '#/components/schemas/Checkout'
                      payment:
                        oneOf:
                          - $ref: '#/components/schemas/PaymentIntent'
                          - type: 'null'
        '401':
          description: Missing, invalid, inactive or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The request address is not on the API key's allowlist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded (100 requests per minute per key).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Checkout:
      type: object
      properties:
        id:
          type: string
          example: cs_3Nq8Zt
        status:
          type: string
          enum:
            - open
            - completed
            - expired
        environment:
          type:
            - string
            - 'null'
          enum:
            - live
            - sandbox
            - null
        url:
          type: string
          description: Send the payer here.
          example: https://pay.orqex.com/cs_3Nq8Zt
        restriction:
          type:
            - object
            - 'null'
          description: Present only when the session is restricted.
          properties:
            country:
              oneOf:
                - $ref: '#/components/schemas/Country'
                - type: 'null'
            phone:
              type:
                - string
                - 'null'
              description: Obfuscated form of the restricted number.
        appearance:
          $ref: '#/components/schemas/Appearance'
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
    PaymentIntent:
      type: object
      properties:
        id:
          type: string
          example: pi_7Ba4Xq
        amount:
          $ref: '#/components/schemas/Amount'
        customer:
          $ref: '#/components/schemas/Customer'
        status:
          type: string
          enum:
            - pending
            - completed
            - failed
            - expired
            - refunded
            - partially_refunded
        description:
          type:
            - string
            - 'null'
          example: 'Order #1042'
        return_url:
          type:
            - string
            - 'null'
        webhook_url:
          type:
            - string
            - 'null'
        statement_descriptor:
          type:
            - string
            - 'null'
        receipt_email:
          type:
            - string
            - 'null'
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
        refunds_summary:
          $ref: '#/components/schemas/RefundsSummary'
        active_attempt:
          oneOf:
            - $ref: '#/components/schemas/PaymentAttempt'
            - type: 'null'
          description: Present when the attempt has been loaded.
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
    Error:
      type: object
      properties:
        message:
          type: string
    Country:
      type: object
      properties:
        code:
          type: string
          example: US
        name:
          type: string
          example: United States
        flag:
          type:
            - string
            - 'null'
    Appearance:
      type: object
      description: Resolved appearance actually applied to the hosted page.
      properties:
        template:
          type: string
        color:
          type: object
          properties:
            primary:
              type: object
              properties:
                hex:
                  type: string
                rgb:
                  type: string
            contrast:
              type: object
              properties:
                hex:
                  type: string
                rgb:
                  type: string
        font:
          type: object
          additionalProperties: true
        border_style:
          type: string
        display_platform_badge:
          type: boolean
        brand:
          type:
            - string
            - 'null'
        icon_url:
          type:
            - string
            - 'null'
        lang:
          type:
            - string
            - 'null'
    Amount:
      type: object
      properties:
        value:
          type:
            - number
            - 'null'
          example: 50
        formatted:
          type:
            - string
            - 'null'
          example: $50.00
        short:
          type:
            - string
            - 'null'
          example: $50
        currency:
          type:
            - string
            - 'null'
          example: USD
    Customer:
      type:
        - object
        - 'null'
      properties:
        id:
          type: string
          example: cus_2f8Kd1
        first_name:
          type:
            - string
            - 'null'
          example: Ada
        last_name:
          type:
            - string
            - 'null'
          example: Lovelace
        email:
          type:
            - string
            - 'null'
          example: ada@example.com
        avatar_url:
          type:
            - string
            - 'null'
    RefundsSummary:
      type: object
      description: >-
        Refund position of this payment. `refundable_amount` is authoritative:
        it already reserves in-flight refunds, so a refund up to that amount is
        the one guaranteed not to be rejected on balance.
      properties:
        refunded_amount:
          $ref: '#/components/schemas/Amount'
        pending_amount:
          $ref: '#/components/schemas/Amount'
        refundable_amount:
          $ref: '#/components/schemas/Amount'
        has_pending_refund:
          type: boolean
    PaymentAttempt:
      type: object
      properties:
        id:
          type: string
          example: att_9Kd12f
        method:
          $ref: '#/components/schemas/PaymentMethod'
        amount:
          $ref: '#/components/schemas/Amount'
        exchange_rate:
          type:
            - number
            - 'null'
        correction_rate:
          type:
            - number
            - 'null'
        status:
          type: string
          enum:
            - processing
            - action_required
            - completed
            - failed
            - expired
        gateway:
          $ref: '#/components/schemas/GatewayTransaction'
        next_action:
          $ref: '#/components/schemas/NextAction'
        failure:
          $ref: '#/components/schemas/Failure'
        failover:
          $ref: '#/components/schemas/Failover'
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        failed_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
    PaymentMethod:
      type: object
      description: >-
        A payment method available for this payment. Method codes are discovered
        at runtime and must not be hard-coded.
      properties:
        value:
          type: string
          description: The code to send as `method_code`.
          example: test
        label:
          type: string
        description:
          type:
            - string
            - 'null'
        icon_url:
          type:
            - string
            - 'null'
        category:
          type:
            - string
            - 'null'
          description: Broad family the method belongs to.
        requires_phone:
          type: boolean
          description: Whether a payer phone number must be supplied.
    GatewayTransaction:
      type: object
      properties:
        transaction:
          type: object
          properties:
            id:
              type:
                - string
                - 'null'
            reference:
              type:
                - string
                - 'null'
            external_id:
              type:
                - string
                - 'null'
            status:
              type:
                - string
                - 'null'
    NextAction:
      type:
        - object
        - 'null'
      description: >-
        What the payer must do next. The keys present depend on `type`; see the
        Next actions guide. Only `collect_otp` and `complete_with_sdk` require a
        call to confirm or authorize — the others resolve asynchronously.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - none
            - approve_on_phone
            - collect_otp
            - redirect_to_url
            - embed_iframe
            - scan_qr_code
            - display_payment_instructions
            - complete_with_sdk
        message:
          type:
            - string
            - 'null'
        instructions:
          type:
            - array
            - 'null'
          items:
            type: string
        dial_code:
          type:
            - string
            - 'null'
          description: Shortcode the payer can dial. `approve_on_phone`, `collect_otp`.
        digits:
          type:
            - integer
            - 'null'
          description: Expected OTP length. `collect_otp`.
        is_strict:
          type:
            - boolean
            - 'null'
          description: Whether the OTP length is enforced. `collect_otp`.
        fields:
          type:
            - array
            - 'null'
          items:
            type: object
            additionalProperties: true
          description: Inputs to collect, or key/value pairs to display.
        url:
          type:
            - string
            - 'null'
          description: '`redirect_to_url`, `embed_iframe`.'
        method:
          type:
            - string
            - 'null'
          description: HTTP method for the redirect. `redirect_to_url`.
        post_data:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Form body to post with the redirect. `redirect_to_url`.
        can_auto_redirect:
          type:
            - boolean
            - 'null'
          description: '`redirect_to_url`.'
        content:
          type:
            - string
            - 'null'
          description: QR payload. `scan_qr_code`.
        image_url:
          type:
            - string
            - 'null'
          description: Rendered QR image. `scan_qr_code`.
        title:
          type:
            - string
            - 'null'
          description: '`display_payment_instructions`.'
        provider:
          type:
            - string
            - 'null'
          description: '`complete_with_sdk`.'
        sdk_url:
          type:
            - string
            - 'null'
          description: '`complete_with_sdk`.'
        public_key:
          type:
            - string
            - 'null'
          description: '`complete_with_sdk`.'
        client_params:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: '`complete_with_sdk`.'
        container_id:
          type:
            - string
            - 'null'
          description: '`complete_with_sdk`.'
    Failure:
      type: object
      properties:
        code:
          type:
            - object
            - 'null'
          properties:
            value:
              type: string
              description: Stable identifier for the failure.
            category:
              type: string
              description: Branch on this rather than on `value`.
              enum:
                - CUSTOMER_ERROR
                - GATEWAY_ERROR
                - TELCO_ERROR
                - MERCHANT_CONFIG_ERROR
                - PLATFORM_ERROR
                - SECURITY_ERROR
            message:
              type:
                - string
                - 'null'
              description: Message written for the payer.
        message:
          type:
            - string
            - 'null'
    Failover:
      type: object
      description: >-
        Diagnostic information about whether this attempt was retried
        automatically. Informational only — do not branch on it.
      properties:
        is_failover:
          type:
            - boolean
            - 'null'
        decision:
          type:
            - object
            - 'null'
          additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your secret key, e.g. `sk_live_...` or `sk_sandbox_...`.

````