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

# Open a Stripe onramp session

> Open the onramp session the rest of the flow runs against.

Opens the onramp session that the rest of the flow runs against. Returns
Stripe's `session_id` for the client SDK's `performCheckout`, plus a Calm
`order_id` to poll at [Get a Stripe onramp order](/api/stripe/order).


## OpenAPI

````yaml api/openapi.json POST /v1/stripe/session
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/stripe/session:
    post:
      summary: Open a Stripe onramp session
      description: >-
        Opens a headless onramp session. Returns Stripe's `session_id` (fed to
        the client SDK's `performCheckout`) alongside a Calm `order_id` to poll
        via `GET .../stripe/order/:id`. Every chain is a valid
        `destination_chain`. Pass exactly one of `source_amount` /
        `destination_amount`.
      operationId: createStripeSession
      requestBody:
        content:
          application/json:
            schema:
              properties:
                crypto_customer_id:
                  minLength: 1
                  type: string
                destination_amount:
                  pattern: ^\d+(\.\d+)?$
                  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_token:
                  minLength: 1
                  type: string
                source_amount:
                  pattern: ^\d+(\.\d+)?$
                  type: string
                source_currency:
                  const: USD
                  default: USD
                  type: string
                wallet:
                  pattern: ^0x[a-fA-F0-9]{40}$
                  type: string
              required:
                - crypto_customer_id
                - payment_token
                - wallet
                - destination_chain
                - destination_token
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  destination_amount:
                    type:
                      - string
                      - 'null'
                  order_id:
                    type: string
                  quote_expires_at:
                    type:
                      - number
                      - 'null'
                  session_id:
                    type: string
                  source_amount:
                    type:
                      - string
                      - 'null'
                  status:
                    type: string
                required:
                  - order_id
                  - session_id
                  - status
                  - quote_expires_at
                  - source_amount
                  - destination_amount
                type: object
          description: The opened onramp session.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            Bad Request — `error.code` includes:
            crypto_onramp_unsupportable_customer,
            crypto_onramp_unsupported_country, deposit_address_unavailable,
            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.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            Not Found — `error.code` includes: customer_not_registered,
            resource_missing.
        '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 — an upstream dependency failed; the body carries the
            standard error envelope with a cause-specific `error.code`.
      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

````