---
title: "Execute Swap"
method: POST
path: "/swap/execute"
tags: ["swap"]
---

# Execute Swap

`POST /swap/execute`

Create the payment details for a SWAP-mode order — returns the deposit instruction (payment block with steps to fund).

## Headers

- `X-API-KEY` string, required

## Request body

- SwapExecuteRequest
  - `trade_type` 'EXACT_INPUT' | 'EXACT_OUTPUT', required — Whether the source or destination amount is fixed.
  - `amount` string, required
  - `source` SwapSource, required
    - `currency` CurrencyBase, required
      - `address` string, nullable
      - `chain_id` 1 | 10 | 56 | 137 | 4663 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
    - `sender_address` string, nullable
    - `slippage_bps` integer, nullable
  - `destination` SwapDestination, required
    - `currency` CurrencyBase, required
      - `address` string, nullable
      - `chain_id` 1 | 10 | 56 | 137 | 4663 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
    - `recipient` string, nullable
  - `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
  - `use_deposit_address` boolean — When true, steps[] always carries a deposit instruction; when omitted steps can be of various types depending on the swap route.

## Response `200`

Swap order created; fund the deposit

- SwapExecuteResponse
  - `order_id` string, required
  - `status` 'PENDING' | 'EXPIRED' | 'FAILED' | 'AWAITING_PAYMENT' | 'OPTIMISTIC_CONFIRMED' | 'AWAITING_CONFIRMATION' | 'EXECUTING_ORDER' | 'COMPLETED' | 'REFUNDED' | 'PARTIAL_PAYMENT', required
  - `data` PaymentView, required
    - `payment_rail` 'CRYPTO' | 'FIAT', required
    - `input` QuoteInput, required
      - `currency` Currency, required
        - `id` string, required
        - `chain_id` 1 | 10 | 56 | 137 | 4663 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
        - `address` string, nullable
        - `symbol` string, required
        - `name` string
        - `decimals` integer, required
        - `image_uri` string, nullable
        - `chain_image_uri` string, nullable
        - `price_usd` number, nullable
      - `amount` Amount, required
        - `ui` string, required
        - `raw` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, nullable
      - `balance` Amount
        - `ui` string, required
        - `raw` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, nullable
      - `breakdown` QuoteBreakdown
        - `total` Amount, required
          - `ui` string, required
          - `raw` string, required — A big integer represented as a string to preserve precision
          - `value_usd` number, nullable
        - `base` Amount, required
          - `ui` string, required
          - `raw` string, required — A big integer represented as a string to preserve precision
          - `value_usd` number, nullable
        - `fees` QuoteFees
          - `total_fee` Amount, required
            - `ui` string, required
            - `raw` string, required — A big integer represented as a string to preserve precision
            - `value_usd` number, nullable
          - `protocol_fee` Amount
            - `ui` string, required
            - `raw` string, required — A big integer represented as a string to preserve precision
            - `value_usd` number, nullable
          - `custom_fee` Amount
            - `ui` string, required
            - `raw` string, required — A big integer represented as a string to preserve precision
            - `value_usd` number, nullable
          - `relayer_fee` Amount
            - `ui` string, required
            - `raw` string, required — A big integer represented as a string to preserve precision
            - `value_usd` number, nullable
        - `gas` Amount
          - `ui` string, required
          - `raw` string, required — A big integer represented as a string to preserve precision
          - `value_usd` number, nullable
    - `output` QuoteOutput, required
      - `currency` Currency, required
        - `id` string, required
        - `chain_id` 1 | 10 | 56 | 137 | 4663 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
        - `address` string, nullable
        - `symbol` string, required
        - `name` string
        - `decimals` integer, required
        - `image_uri` string, nullable
        - `chain_image_uri` string, nullable
        - `price_usd` number, nullable
      - `amount` Amount, required
        - `ui` string, required
        - `raw` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, nullable
      - `amount_out_minimum` Amount
        - `ui` string, required
        - `raw` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, nullable
    - `funding` PaymentFunding
      - `required_amount` Amount, required
        - `ui` string, required
        - `raw` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, nullable
      - `received_amount` Amount, required
        - `ui` string, required
        - `raw` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, nullable
      - `remaining_amount` Amount, required
        - `ui` string, required
        - `raw` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, nullable
      - `transactions` PaymentFundingTransaction[], required
        - `tx_hash` string, required
        - `amount` Amount, required
          - `ui` string, required
          - `raw` string, required — A big integer represented as a string to preserve precision
          - `value_usd` number, nullable
    - `recipient` string, required
    - `steps` PaymentStep[], required
      - `id` string
      - `purpose` string
      - `status` string
      - `expires_at` string, nullable
      - `rail` 'CRYPTO' | 'FIAT', required
      - `kind` 'deposit' | 'transaction' | 'stripe_onramp', required
      - `action` string
      - `description` string
      - `data` union
        - DepositStepData
          - `deposit_address` string, required
          - `currency` CurrencyBase, required
            - `address` string, nullable
            - `chain_id` 1 | 10 | 56 | 137 | 4663 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
          - `amount` string, required — A big integer represented as a string to preserve precision
        - union
          - EVMPaymentData
            - `from` string, required
            - `to` string, required
            - `data` string, required
            - `value` string, required
            - `chainId` 1 | 10 | 56 | 137 | 4663 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
            - `maxFeePerGas` string
            - `maxPriorityFeePerGas` string
          - BitcoinPaymentData
            - `transaction` string, required — Serialized Bitcoin transaction.
          - SolanaPaymentData
            - `transaction` string, required — Serialized Solana transaction.
          - SuiPaymentData
            - `transaction` string, required — Base64 BCS transaction kind.
        - StripeOnrampPaymentData
          - `session_id` string
          - `stripe_publishable_key` string, required
          - `status` string, required
          - `source_currency` 'usd' | 'eur' — Fiat source currency for Stripe embedded onramp intents
          - `destination_currency` 'usdc' | 'usdb' | 'usdsui' | 'usdt' | 'phantom_cash', required
          - `destination_network` 'arbitrum' | 'base' | 'bitcoin' | 'ethereum' | 'polygon' | 'solana' | 'sui' | 'tempo' | 'worldchain', required
          - `destination_amount` string, required
          - `wallet_address` string, required
    - `expires_at` string, date-time, required
    - `estimated_duration_seconds` number, nullable
    - `source_tx_hash` string, nullable
    - `destination_tx_hash` string, nullable
    - `fee_tx_hash` string, nullable
    - `refund` PaymentRefund
      - `address` string, nullable
      - `tx_hash` string, nullable
      - `reason` string, nullable

## Other responses

- `401` — Unauthorized
- `403` — Recipient or sender address is sanctioned
- `422` — Invalid request body
- `500` — Internal Server Error

---

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