Convert funds

Convert assets inside a wallet

POST

https://api.fps.pro/balances/convert

Request formatapplication/json

wallet

required

string

Merchant ID where the asset is converted. Use the "Personal" ID for your personal balance

from_token

required

string

from_network

required

string

Source network ID (see the network list)

to_token

required

string

to_network

required

string

Target network ID (see the network list)

amount

required

string

Amount of the asset to convert

Request examples

curl --request POST 'https://api.fps.pro/balances/convert' \
  --header 'Content-Type: application/json' \
  --header 'X-Client-Id: YOUR_CLIENT_ID' \
  --header 'X-Timestamp: 1720000000' \
  --header 'X-Signature: YOUR_HMAC_SHA256_SIGNATURE' \
  --data '{
  "wallet": "42",
  "from_token": "tether",
  "from_network": "tron",
  "to_token": "btc",
  "to_network": "btc",
  "amount": "100"
}'

Successful response

{
  "status": 200,
  "message": "convert success"
}

Errors

Detailed authorization errors are listed in Authorization - Errors

{
  "status": 422,
  "message": "Validation Error",
  "errors": [
    {
      "field": "wallet",
      "message": "wallet is required"
    }
  ]
}
{
  "status": 400,
  "message": "Bad balance"
}
{
  "status": 400,
  "message": "Amount exceeds available balance"
}
{
  "status": 500,
  "message": "Internal Server Error"
}