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:

ParameterRequiredTypeDescription
appidYstringThe unique identifier for the application
timestampYstringCurrent UTC 13-digit timestamp, valid for 5 minutes
signYstringSignature, refer to here for signing method

Body Parameters:

ParameterRequiredTypeDescription
cryptoYstringCryptocurrency
networkYstringNetwork
fiatYstring3-letter fiat currency code(ISO 4217)
amountYBigdecimalAmount of fiat for BUY / Quantity of crypto for SELL
sideYstringTransaction 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
    }
}