---
title: "Get Swap Data"
method: POST
path: "/swap/data"
tags: ["swap"]
---

# Get Swap Data

`POST /swap/data`

Get transaction data for executing a swap

## Headers

- `X-API-KEY` string, required

## Request body

- SwapDataRequest
  - `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
  - `receiving_address` string, required

## Response `200`

Swap data retrieved successfully

- SwapDataResponse
  - `payorder_id` string, required
  - `status` 'PENDING' | 'EXPIRED' | 'FAILED' | 'AWAITING_PAYMENT' | 'OPTIMISTIC_CONFIRMED' | 'AWAITING_CONFIRMATION' | 'EXECUTING_ORDER' | 'COMPLETED' | 'REFUNDED' | 'PARTIAL_PAYMENT', required
  - `data` PaymentDataBase, required
    - `payment_rail` 'CRYPTO' | 'FIAT'
    - `src` QuoteWithCurrency, 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
    - `dst` 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
    - `estimated_duration_seconds` number, nullable
    - `receiving_address` string, required
    - `refund_address` string, nullable
    - `source_tx_hash` string, nullable
    - `destination_tx_hash` string, nullable
    - `refund_tx_hash` string, nullable
    - `refunded_reason` string, nullable
    - `fee_tx_hash` string, nullable
    - `deposit_address` string, required — Use steps
    - `steps` PaymentStep[], required
      - `rail` 'CRYPTO' | 'FIAT', required
      - `kind` 'deposit' | 'transaction' | 'stripe_onramp', required
      - `deposit_address` string — Use data.deposit_address instead
      - `data` union, required
        - DepositStepData
          - `deposit_address` string, required
          - `currency` CurrencyBase, required
            - `address` string, nullable
            - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
          - `amount` string, required — A big integer represented as a string to preserve precision
        - ChainPaymentData
          - `evm` EVMPaymentData
            - `from` string, required
            - `to` string, required
            - `data` string, required
            - `value` string, required
            - `chainId` integer, required
            - `maxFeePerGas` string
            - `maxPriorityFeePerGas` string
          - `bitcoin` BitcoinPaymentData
            - `psbt` string, required
          - `solana` SolanaPaymentData
            - `transaction` union, required — Serialized Solana transaction object returned by the solana-go SDK.
              - …
          - `sui` SuiPaymentData
            - `transaction` union, required — Serialized Sui transaction object returned by the sui-go-sdk.
              - …
        - StripeOnrampPaymentData
          - `session_id` string, required
          - `stripe_publishable_key` string, required
          - `client_secret` string, required
          - `status` string, required
          - `hosted_url` string, nullable
          - `source_currency` string, nullable
          - `destination_currency` 'btc' | 'eth' | 'pol' | 'sol' | 'usdc', required
          - `destination_network` 'base' | 'ethereum' | 'optimism' | 'polygon' | 'solana', required
          - `destination_amount` string, required
          - `wallet_address` string, required
          - `quote` StripeOnrampQuote
            - `source_currency` string, nullable
            - `source_amount` string, nullable
            - `source_total_amount` string, nullable
            - `destination_currency` 'btc' | 'eth' | 'pol' | 'sol' | 'usdc', required
            - `destination_network` 'base' | 'ethereum' | 'optimism' | 'polygon' | 'solana', required
            - `destination_amount` string, required
            - `exchange_rate` string, nullable
            - `network_fee_amount` string, nullable
            - `transaction_fee_amount` string, nullable
    - `expires_at` string, date-time, required

## Other responses

- `401` — Unauthorized - Authentication required
- `403` — Forbidden - Card payments are not enabled or a provided address is sanctioned
- `422` — Unprocessable Entity - Invalid request body format, missing source currency, or unsupported Stripe onramp configuration
- `500` — Internal Server Error
- `501` — Not Implemented - Stripe is not configured

---

[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)
