Create Swap
Executes a swap from the account's wallet. Crypto swaps run asynchronously; poll GET /swaps/{id} for status. A pair of fiat currency codes instead converts ledger balances to repay a negative to_token balance: by default the conversion brings that balance exactly to zero, or pass amount to repay part of the debt. Fiat conversions complete synchronously, except when funding from USD on a stablecoin-rails account, which starts an asynchronous repayment (status "processing"). The id on a pending repayment is a reference to the repayment workflow; GET /swaps/{id} reports status for crypto swaps only, so watch the account balance for settlement instead of polling.
Headers
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
Response
swap created