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

# Get a card order

> Return the status of a single card order.

The state of one card order. Poll it after checkout until the order reaches a
terminal state.

<Warning>
  The terminal states are `order_broadcasted` and `order_cancelled`.
</Warning>

An order opens at `payment_pending` and stays there until the first callback
from the payment rail.

| Status              | Terminal | Meaning                                                |
| ------------------- | -------- | ------------------------------------------------------ |
| `payment_pending`   | No       | The payment is being taken.                            |
| `order_completed`   | No       | The payment was captured. The asset has not been sent. |
| `order_broadcasted` | Yes      | The payout was sent to the wallet.                     |
| `order_cancelled`   | Yes      | The order will not settle.                             |

An order never moves between the two terminal states.


## OpenAPI

````yaml api/openapi.json GET /v1/card/orders/{id}
openapi: 3.1.0
info:
  description: Fiat-to-USDC onramp API. The URL prefix (`/v1`) is the version contract.
  license:
    identifier: LicenseRef-Proprietary
    name: Proprietary
  title: Calm API
  version: v1
servers:
  - description: Production
    url: https://api.calmtreasury.xyz
  - description: Sandbox
    url: https://api.sandbox.calmtreasury.xyz
security: []
paths:
  /v1/card/orders/{id}:
    get:
      summary: Get card order
      description: >-
        Returns the status of one card order, scoped to the `wallet` in the
        query.
      operationId: getCardOrder
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            type: string
        - in: query
          name: wallet
          required: true
          schema:
            pattern: ^0x[a-fA-F0-9]{40}$
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  created_at:
                    format: date-time
                    type: string
                  destination:
                    properties:
                      chain:
                        enum:
                          - 1
                          - 8453
                          - 999
                          - 1337
                          - 4326
                          - 143
                          - 137
                          - 42161
                        type: number
                      token:
                        type: string
                      wallet:
                        pattern: ^0x[a-fA-F0-9]{40}$
                        type: string
                    required:
                      - wallet
                      - chain
                      - token
                    type: object
                  id:
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    type: string
                  source:
                    properties:
                      amount:
                        type: string
                      card_brand:
                        type:
                          - string
                          - 'null'
                      card_last_four:
                        type:
                          - string
                          - 'null'
                      currency:
                        type: string
                      wallet:
                        pattern: ^0x[a-fA-F0-9]{40}$
                        type: string
                    required:
                      - wallet
                      - currency
                      - amount
                      - card_brand
                      - card_last_four
                    type: object
                  status:
                    description: >-
                      `payment_pending` until the first provider callback, then
                      the status it carries. Poll until `order_broadcasted` or
                      `order_cancelled`.
                    enum:
                      - payment_pending
                      - order_completed
                      - order_broadcasted
                      - order_cancelled
                    type: string
                required:
                  - id
                  - status
                  - source
                  - destination
                  - created_at
                type: object
          description: The card order.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            Bad Request — `error.code` includes: publishable_key_missing,
            validation_error.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Unauthorized — `error.code` includes: invalid_publishable_key.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Forbidden — `error.code` includes: origin_not_allowed.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Not Found — `error.code` includes: order_not_found.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Too Many Requests — `error.code` includes: rate_limited.'
      security:
        - publishableKey: []
components:
  schemas:
    Error:
      properties:
        error:
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
  securitySchemes:
    publishableKey:
      description: Publishable key identifying the calling app.
      in: header
      name: x-calm-publishable-key
      type: apiKey

````