Create a swap
Create a token swap. A swap exchanges one stablecoin for another between a source wallet and a destination wallet (owned by a user or an external wallet).
The source and destination currency must be different. Provide exactly one of
source.amount or destination.amount — the other side is derived from the quote.
Provide exactly one of destination.walletId or destination.externalWalletId.
Depending on the pricing model, the swap may be created directly or returned in an
OPEN_QUOTE state that must be accepted before execution.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Swap details. Source and destination currencies must differ, exactly one of
source.amount / destination.amount must be provided, and exactly one of
destination.walletId / destination.externalWalletId must be provided.
Swap creation payload. Source and destination currencies must differ, exactly one
of source.amount / destination.amount must be set, and exactly one of
destination.walletId / destination.externalWalletId must be set.
Client-generated idempotency key. A UUID unique to this swap request.
"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
Source of the swap.
Destination of the swap. Provide exactly one of walletId or externalWalletId.
Optional destination units per source unit for a direct USDC/USDT swap. Sandbox validates and returns this value but does not delay simulated execution for it.
^(?=.*[1-9])\d+(?:\.\d{1,4})?$"0.9990"
Optional cancellation deadline in seconds for a direct USDC/USDT swap.
60 <= x <= 864003600
Response
Swap created successfully.
A token swap.
Public ID of the swap (prefixed with swap_).
"swap_7bV1aLcs3Kf9dQ2mNpXwZ"
Client-generated idempotency key supplied at creation.
"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
DRAFT, CREATED, PENDING, OPEN_QUOTE, QUOTE_FAILED, COMPLETED, FAILED, CANCELLED "OPEN_QUOTE"
User-facing error summary. Null unless the swap failed or was cancelled.
null
User-facing error details. Null unless the swap failed or was cancelled.
null
Whether a cancellation request can still win before execution starts.
true
Requested automatic cancellation deadline.
"2026-07-01T11:30:00.000Z"
Time manual cancellation was requested.
null
Source amount of the swap.
"100"
Resolved source of the swap.
Resolved destination of the swap.
On-chain receipt for the swap.
Commercial quote for the swap. Null until a quote has been generated.
"2026-07-01T10:30:00.000Z"
"2026-07-01T10:30:00.000Z"