Exchange API

Exchange API

API Information

ItemDescription
MethodPOST
Path/apis/v1/balance/selfExchange
Content-Typeapplication/json
AuthenticationRequired. 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:

ParameterRequiredTypeDescription
fromCoinYesstringSource coin to deduct. Supported values: USDT, USDC, USD, VND
recipientCoinYesstringTarget coin to receive. Supported values: USDT, USDC, USD, VND. Must be different from fromCoin
recipientAmountYesstringThe exact amount to receive. The system calculates the corresponding deduction amount

Response

The standard response structure is R<object>.

data fields:

FieldTypeDescription
orderIdstringSelf-exchange order ID (internal transfer ID)
typestringOrder type. Always Convert for self-exchange
sendingCoinstringSource coin that was deducted
sendingAmountstringActual amount deducted
coinstringTarget coin received
amountstringActual amount received
feestringFee amount
feeCoinstringFee coin
createOnstringOrder creation time, format yyyy-MM-dd HH:mm:ss
paramsobjectAdditional 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"
    }
  }
}