Skip to main content
POST
/
swap
cURL
curl --request POST \
  --url https://api.bestflow.xyz/swap \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from": "<string>",
  "to": "<string>",
  "fromNetwork": "<string>",
  "toNetwork": "<string>",
  "toAddress": "<string>",
  "amount": 123,
  "memo": "<string>"
}
'
{
  "id": "<string>",
  "from": "<string>",
  "to": "<string>",
  "fromNetwork": "<string>",
  "toNetwork": "<string>",
  "sendAmount": 123,
  "sendAddress": "<string>",
  "sendMemo": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.bestflow.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Optional Bearer authentication using an API key provided as a Bearer token. Required for unlimited requests and revenue sharing.

Body

application/json

Swap creation details

exchange
enum<string>
required

Exchange to use for the swap

Available options:
swapter,
etzswap,
pegasusswap
from
string
required

Source currency ticker

to
string
required

Destination currency ticker

fromNetwork
string
required

Source network identifier

toNetwork
string
required

Destination network identifier

toAddress
string
required

Destination wallet address

amount
number
required

Amount to swap

memo
string

Optional memo/tag for destination address

Response

Swap created successfully

id
string
required

Unique identifier for the swap

from
string
required

Source currency ticker

to
string
required

Destination currency ticker

fromNetwork
string
required

Source network identifier

toNetwork
string
required

Destination network identifier

sendAmount
number
required

Amount to send to complete the swap

sendAddress
string
required

Deposit address to send funds to

sendMemo
string | null
required

Memo/tag for the deposit; null when not required or not provided