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

# Quote an exchange withdrawal

> Price a withdrawal from the connected exchange.

Prices a withdrawal from the connected exchange into the chosen destination
chain. The returned `id` is the handle
[Execute an exchange withdrawal](/api/exchange/withdraw) runs against.


## OpenAPI

````yaml api/openapi.json POST /v1/exchange/{exchange}/withdraw/quote
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/exchange/{exchange}/withdraw/quote:
    post:
      summary: Quote an exchange withdrawal
      description: >-
        Quotes a USDC withdrawal from the connected exchange to a deposit
        address that settles to the chosen destination. The returned `id` is the
        handle the withdraw call executes.
      operationId: createExchangeWithdrawQuote
      parameters:
        - in: path
          name: exchange
          required: true
          schema:
            enum:
              - coinbase
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                amount:
                  pattern: ^\d+(\.\d+)?$
                  type: string
                asset:
                  minLength: 1
                  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
                origin_chain:
                  enum:
                    - 1
                    - 8453
                    - 999
                    - 1337
                    - 4326
                    - 143
                    - 137
                    - 42161
                  type: number
                wallet:
                  pattern: ^0x[a-fA-F0-9]{40}$
                  type: string
              required:
                - wallet
                - asset
                - amount
                - origin_chain
                - destination_chain
                - destination_token
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  amount:
                    type: string
                  amount_no_fee:
                    type:
                      - number
                      - 'null'
                  amount_with_fee:
                    type:
                      - number
                      - 'null'
                  asset:
                    type: string
                  estimated_fee:
                    type:
                      - number
                      - 'null'
                  estimated_total:
                    type:
                      - number
                      - 'null'
                  expires_at:
                    format: date-time
                    type: string
                  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
                  network:
                    type: string
                required:
                  - id
                  - asset
                  - network
                  - amount
                  - amount_with_fee
                  - amount_no_fee
                  - estimated_fee
                  - estimated_total
                  - expires_at
                type: object
          description: The withdrawal quote.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            Bad Request — `error.code` includes: deposit_address_unavailable,
            generic_invalid_request, generic_validation_error,
            publishable_key_missing, unsupported_asset, unsupported_network,
            validation_error, withdrawal_amount_above_maximum,
            withdrawal_amount_below_minimum, withdrawal_asset_not_supported,
            withdrawal_email_unverified, withdrawal_insufficient_balance,
            withdrawal_insufficient_balance_for_fee, withdrawal_invalid_address,
            withdrawal_kyc_required, withdrawal_network_not_supported,
            withdrawal_too_many_addresses.
        '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.'
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Conflict — `error.code` includes: exchange_reconnect_required.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            Too Many Requests — `error.code` includes: rate_limited,
            withdrawal_rate_limit_exceeded.
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            Bad Gateway — `error.code` includes:
            apikey_insufficient_permissions, exchange_provider_error,
            generic_internal_server_error, generic_unauthorized,
            wallet_invalid_credentials, withdrawal_provider_error.
      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

````