Swap
Swap one cryptocurrency for another.
Endpoint: POST /trade/swap
Fees
Fees are taken from the token you swap from (from).
Request Parameters
Parameter
Type
Required
Description
amount
integer
Yes
Amount of the source token to convert (must be greater than 0)
from
string
Yes
Token to convert (e.g. btc, eth). USDT is not allowed — use buy/sell
to
string
Yes
Token to receive after conversion. USDT is not allowed, use buy/sell
Example Request
curl -X POST https://service.roqqu.com/v1/trade/swap \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "amount=200" \
-d "from=usdt" \
-d "to=btc"Example Response
{
"status": "success",
"message": "swap operation successful",
"data": null
}Swap is a ledger operation. It does not emit a webhook. Confirm via balances / history.
Error Responses
USDT not allowed in swap:
Invalid from token:
Invalid to token:
Swap not enabled for from token:
Swap not enabled for to token:
Insufficient balance:
Fee too high:
Below minimum / above maximum:
Amount must be positive:
Last updated