Exchange API
API Information
| Item | Description |
|---|---|
| Method | POST |
| Path | /apis/v1/balance/selfExchange |
| Content-Type | application/json |
| Authentication | Required. Refer to 'Authorization Introduction' |
Description
This API is used to convert coins within the same merchant account (self-exchange), for example USDT <-> USDC <-> USD <-> VND.
The caller specifies the amount to receive (recipientAmount), and the system back-calculates the deduction amount based on the current exchange rate.
Request Parameters
Request body parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| fromCoin | Yes | string | Source coin to deduct. Supported values: USDT, USDC, USD, VND |
| recipientCoin | Yes | string | Target coin to receive. Supported values: USDT, USDC, USD, VND. Must be different from fromCoin |
| recipientAmount | Yes | string | The exact amount to receive. The system calculates the corresponding deduction amount |
Response
The standard response structure is R<object>.
data fields:
| Field | Type | Description |
|---|---|---|
| orderId | string | Self-exchange order ID (internal transfer ID) |
| type | string | Order type. Always Convert for self-exchange |
| sendingCoin | string | Source coin that was deducted |
| sendingAmount | string | Actual amount deducted |
| coin | string | Target coin received |
| amount | string | Actual amount received |
| fee | string | Fee amount |
| feeCoin | string | Fee coin |
| createOn | string | Order creation time, format yyyy-MM-dd HH:mm:ss |
| params | object | Additional info. Contains exchangeRate and amountBase |
Example Response
{
"code": "200",
"message": "success",
"data": {
"orderId": "a1b2c3d4e5f6g7h8i9j10k11lm",
"type": "Convert",
"sendingCoin": "USDT",
"sendingAmount": "41.23",
"coin": "VND",
"amount": "1000000",
"fee": "0",
"feeCoin": "USDT",
"createOn": "2026-07-09 10:00:00",
"params": {
"exchangeRate": "24250.00",
"amountBase": "TARGET_AMOUNT"
}
}
}