Quote Query
Introduction
This API is used for querying the price of cryptocurrency for ramp transactions. If you want to allow your users to estimate the price and quantity of crypto. They can get before being redirected to the ramp page, you can use this API to retrieve that information.
API Description
Request Method: POST
Request Path:/open/api/v4/merchant/quotes
Header Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
appid | Y | string | The unique identifier for the application |
timestamp | Y | string | Current UTC 13-digit timestamp, valid for 5 minutes |
sign | Y | string | Signature, refer to here for signing method |
Body Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
crypto | Y | string | Cryptocurrency |
network | Y | string | Network |
fiat | Y | string | 3-letter fiat currency code(ISO 4217) |
amount | Y | Bigdecimal | Amount of fiat for BUY / Quantity of crypto for SELL |
side | Y | string | Transaction direction: BUY, SELL |
Example
Request:
{
"crypto": "USDT",
"network": "BSC",
"fiat": "USD",
"amount": "20",
"side": "BUY"
}
Response:
# Response for BUY side
{
"success": true,
"returnCode": "0000",
"returnMsg": "SUCCESS",
"extend": "",
"data": {
"crypto": "USDT",
"cryptoPrice": "1.0001", // Current crypto price
"cryptoQuantity": "100.11", // Estimated quantity of crypto to be purchased
"fiat": "USD", // Fiat currency
"rampFee": "4.93", // Estimated ramp fee
"networkFee": "0.29" // Estimated network fee
}
}
# Response for SELL side
{
"success": true,
"returnCode": "0000",
"returnMsg": "SUCCESS",
"extend": "",
"data": {
"cryptoPrice": "7.84981500000000000000", // Crypto-to-fiat rate, in fiat currency
"rampFee": "29.4368", // Fee, in fiat currency
"cryptoQuantity": null,
"networkFee": null,
"fiat": "HKD",
"crypto": "USDT",
"fiatQuantity": "784.9815" // Amount of fiat to be received, before subtracting ramp fee, in fiat currency
}
}
Updated about 2 months ago