---
title: "Get Swap Quote"
method: POST
path: "/swap/quote"
tags: ["swap"]
---

# Get Swap Quote

`POST /swap/quote`

Get a quote for swapping between two currencies

## Headers

- `X-API-KEY` string, required

## Request body

- SwapQuoteRequest
  - `metadata` OrderMetadata
    - `items` MetadataItems[]
      - `name` string, nullable
      - `description` string, nullable
      - `image` string, nullable
      - `quantity` integer, nullable
      - `unit_price` number, nullable
      - `currency` string, nullable
    - `refund` MetadataRefund
      - `name` string, nullable
      - `reason` string, nullable
      - `additional_info` string, nullable
      - `refund_amount` number, nullable
      - `currency` string, nullable
  - `intent` SwapIntent, required
    - `payment_rail` 'CRYPTO' | 'FIAT'
    - `destination_currency` CurrencyBase, required
      - `address` string, nullable
      - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
    - `amount` string, required
    - `swap_mode` 'ExactIn' | 'ExactOut', required
    - `receiving_address` string, nullable
    - `crypto` CryptoSwapInput
      - `slippage_bps` integer, nullable
      - `source_currency` CurrencyBase, required
        - `address` string, nullable
        - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
      - `sender_address` string, nullable
    - `source_currency` CurrencyBase
      - `address` string, nullable
      - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
    - `sender_address` string, nullable — Use crypto.sender_address

## Response `200`

Swap quote retrieved successfully

- SwapQuoteResponse
  - `input` QuoteWithBalance, required
    - `id` string, required
    - `address` string, nullable
    - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
    - `decimals` integer, required
    - `name` string, required
    - `ticker` string, required
    - `image_uri` string, nullable
    - `price_usd` number, nullable
    - `currency_amount` CurrencyAmount, required
      - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
      - `ui_amount_display` string, required
      - `raw_amount` string, required — A big integer represented as a string to preserve precision
      - `value_usd` number, required
    - `amount_out_minimum` CurrencyAmount
      - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
      - `ui_amount_display` string, required
      - `raw_amount` string, required — A big integer represented as a string to preserve precision
      - `value_usd` number, required
    - `total` CurrencyAmount, required
      - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
      - `ui_amount_display` string, required
      - `raw_amount` string, required — A big integer represented as a string to preserve precision
      - `value_usd` number, required
    - `base` CurrencyAmount, required
      - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
      - `ui_amount_display` string, required
      - `raw_amount` string, required — A big integer represented as a string to preserve precision
      - `value_usd` number, required
    - `fees` FeeBreakdown
      - `total_fee` CurrencyAmount, required
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
      - `protocol_fee` CurrencyAmount
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
      - `custom_fee` CurrencyAmount
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
      - `relayer_fee` CurrencyAmount
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
    - `gas` CurrencyAmount
      - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
      - `ui_amount_display` string, required
      - `raw_amount` string, required — A big integer represented as a string to preserve precision
      - `value_usd` number, required
    - `balance` CurrencyAmount
      - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
      - `ui_amount_display` string, required
      - `raw_amount` string, required — A big integer represented as a string to preserve precision
      - `value_usd` number, required
  - `output` CurrencyWithAmount, required
    - `id` string, required
    - `address` string, nullable
    - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
    - `decimals` integer, required
    - `name` string, required
    - `ticker` string, required
    - `image_uri` string, nullable
    - `price_usd` number, nullable
    - `currency_amount` CurrencyAmount, required
      - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
      - `ui_amount_display` string, required
      - `raw_amount` string, required — A big integer represented as a string to preserve precision
      - `value_usd` number, required
    - `amount_out_minimum` CurrencyAmount
      - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
      - `ui_amount_display` string, required
      - `raw_amount` string, required — A big integer represented as a string to preserve precision
      - `value_usd` number, required
  - `swap_mode` 'ExactIn' | 'ExactOut', required
  - `providers` string[]
  - `slippage_bps` integer, nullable
  - `price_impact` number, required

## Other responses

- `401` — Unauthorized - Authentication required
- `403` — Forbidden - Card payments are not enabled
- `422` — Unprocessable Entity - Invalid request body format, missing source currency, or unsupported Stripe onramp region
- `500` — Internal Server Error

---

[API](https://skmtc.net/coinvoyage/apis/coinvoyage-api.md) · [All operations](https://skmtc.net/coinvoyage/apis/coinvoyage-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coinvoyage/coinvoyage-api/versions/29e628200554/schema)
