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

# Start a card checkout

> Open a card purchase and return the hosted URL to render.

Opens the purchase and returns both the hosted card URL to render and the
order to poll. Amount, currency, payment method and country are locked in
before the buyer sees the page, so it opens on the payment step. Poll
[Get a card order](/api/card/order) for settlement.


## OpenAPI

````yaml api/openapi.json POST /v1/card/checkout
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/checkout:
    post:
      summary: Start a card checkout
      description: >-
        Starts a card purchase for the `wallet` in the body. Returns the order
        to poll and the hosted card URL to render, with the amount, currency,
        payment method and country already applied and locked so the widget
        opens on the payment step.
      operationId: checkoutCard
      requestBody:
        content:
          application/json:
            schema:
              properties:
                amount:
                  pattern: ^\d{1,12}(\.\d{1,8})?$
                  type: string
                country:
                  pattern: ^[A-Z]{2}$
                  type: string
                currency:
                  enum:
                    - USD
                    - GBP
                    - EUR
                  type: string
                destination_chain:
                  enum:
                    - 1
                    - 8453
                    - 999
                    - 1337
                    - 4326
                    - 143
                    - 137
                    - 42161
                  type: number
                destination_token:
                  enum:
                    - USDC
                    - USDm
                    - AUSD
                    - USDC.e
                  type: string
                payment_method:
                  pattern: ^[a-z0-9-]{2,32}$
                  type: string
                trade_type:
                  default: EXACT_INPUT
                  enum:
                    - EXACT_INPUT
                    - EXACT_OUTPUT
                  type: string
                wallet:
                  pattern: ^0x[a-fA-F0-9]{40}$
                  type: string
              required:
                - destination_chain
                - destination_token
                - currency
                - amount
                - country
                - payment_method
                - wallet
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  order_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
                  url:
                    format: uri
                    type: string
                required:
                  - order_id
                  - url
                type: object
          description: The started card checkout.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            Bad Request — `error.code` includes: amount_below_minimum,
            publishable_key_missing, unsupported_chain, 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.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Too Many Requests — `error.code` includes: rate_limited.'
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Bad Gateway — `error.code` includes: quote_unavailable.'
      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

````