Create Swap
Swaps one token for another from the account’s wallet, or converts between fiat currencies in the account’s ledger at the mid-market rate. Crypto swaps finish in the background — check the swap for its status.
Authorizations
An Account API key, account-scoped JWT, App API key, or user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************.
Headers
A unique key that makes this request safe to retry. See Idempotent requests.
255"d9105228-4a08-46b1-8b91-42fed586d383"
Body
Business or user account ID (biz_* / user_*).
Source token contract address or ticker symbol, such as "USDT".
Destination token contract address or ticker symbol, such as "XAUT".
Source token amount. Required for crypto swaps. For fiat pairs: the amount of from_token to convert at the mid-market rate; omit (along with to_amount) to repay the full negative to_token balance instead.
Source chain name or chain ID. Defaults to the source token's chain when omitted.
Maximum slippage tolerance in basis points.
Fiat pairs only: sizes a partial repayment of the negative to_token balance, denominated in to_token. Must not exceed the debt. Mutually exclusive with amount.
Destination chain name or chain ID. Defaults to the destination token's chain when omitted.
Response
swap created
Account ID that owns the wallet used for the swap.
swap Swap status. Crypto swaps start queued; fiat conversions return complete, or working while a stablecoin repayment settles.
queued, working, complete, failed Fiat pairs only: amount of the source currency converted. Null while a stablecoin repayment is processing.
Fiat pairs only: amount credited in the destination currency. Null while a stablecoin repayment is processing.
Expected destination token amount.
Minimum destination amount after slippage.
Fiat pairs only: the source currency.
Swap ID. Poll GET /swaps/:id for status.
Quoted exchange rate used to create the swap.
Destination chain for the swap.
Fiat pairs only: the destination currency.

