Skip to main content
POST
/
swaps
Create Swap
curl --request POST \
  --url https://{defaultHost}/swaps \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "account_id": "<string>",
  "amount": "<string>",
  "from_token": "<string>",
  "to_token": "<string>",
  "from_chain": "<string>",
  "to_chain": "<string>",
  "slippage_bps": 123
}
'
{
  "object": "swap",
  "id": "<string>",
  "account_id": "<string>",
  "status": "<string>",
  "to_chain": "<string>",
  "amount_out_expected": "<string>",
  "amount_out_min": "<string>",
  "rate": "<string>"
}

Authorizations

Authorization
string
header
required

An account API key, account scoped JWT, app API key, or user OAuth token.

Body

application/json
account_id
string
required

Business or user account ID (biz_* / user_*).

amount
string
required

Source token amount.

from_token
string
required

Source token contract address or ticker symbol, such as "USDT".

to_token
string
required

Destination token contract address or ticker symbol, such as "XAUT".

from_chain

Source chain name or chain ID. Defaults to the source token's chain when omitted.

to_chain

Destination chain name or chain ID. Defaults to the destination token's chain when omitted.

slippage_bps
integer | null

Maximum slippage tolerance in basis points.

Response

swap created

object
enum<string>
required
Available options:
swap
id
string
required

Swap ID. Poll GET /swaps/:id for status.

account_id
string
required

Account ID that owns the wallet used for the swap.

status
string
required

Initial swap status.

to_chain
string

Destination chain for the swap.

amount_out_expected
string

Expected destination token amount.

amount_out_min
string

Minimum destination amount after slippage.

rate
string

Quoted exchange rate used to create the swap.