查询数字货币币价

介绍

此接口用于查询On ramp的币价查询。若您希望您的用户在跳转ramp页面前预估买币的币价和能得到的数量,可以用此接口查询

接口说明

路径:POST /open/api/v4/merchant/order/quote

❗️该接口只能在服务端被调用

Header参数:

参数名必选类型说明
appidYstring应用的唯一标识
timestampYstring当前 UTC 13位时间戳, 5分钟内有效
signYstring签名,签名方式可参考这里

Body参数:

参数名必选类型说明
cryptoYstring数字货币币种
networkYstring网络
fiatYstring3字母法币code
amountYBigdecimalBUY时为购买法币金额 / SELL时为卖出crypto的数量
payWayCodeNstring支付方式 side为SELL忽略此参数
sideYstring订单方向:BUY、SELL
typeCstring数据类型:ONE、ALL,默认是ONE side为SELL忽略此参数

示例

请求参数:

{
    "crypto": "USDT",
    "network": "ETH",
    "fiat": "USD",
	  "country": "US",
    "amount": "100",
    "payWayCode": "10001",
	  "side": "BUY"
}

返回参数:

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "crypto": "USDT", // crypto
        "cryptoPrice": "1.0001", // crypto当前价格
        "cryptoQuantity": "100.11", // crypto可以购买的预估数量
		    "fiat": "USD", //法币单位
		    "rampFee": "4.93", // 预估通道费用
		    "networkFee": "0.29" // 预估网络费用
    }
}

# side为BUY,type为ALL 返回参数
{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": [
        {
            "cryptoPrice": "14893.45",
            "rampFee": "20950.00",
            "cryptoQuantity": "31.87514642",
            "networkFee": "4319.10",
            "fiat": "IDR",
            "crypto": "USDT",
            "payWayCode": "10004"
        },
        {
            "cryptoPrice": "14893.45",
            "rampFee": "20950.00",
            "cryptoQuantity": "31.87514642",
            "networkFee": "4319.10",
            "fiat": "IDR",
            "crypto": "USDT",
            "payWayCode": "10006"
        },
        {
            "cryptoPrice": "14893.45",
            "rampFee": "20950.00",
            "cryptoQuantity": "31.87514642",
            "networkFee": "4319.10",
            "fiat": "IDR",
            "crypto": "USDT",
            "payWayCode": "10005"
        }
    ]
}

# side为SELL返回参数
{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "cryptoPrice": "7.84981500000000000000", // 加密货币换算成法币的单价 单位为法币
        "rampFee": "29.4368", // 手续费 单位为法币
        "cryptoQuantity": null,
        "networkFee": null,
        "fiat": "HKD",
        "crypto": "USDT",
        "fiatQuantity": "784.9815" // 卖币得到的法币金额 未减去rampFee 单位为法币
    }
}

支付方式说明 点击这里

FAQ

  1. 得到以下返回值时

原因是查询的法币或者数字货币没有配置到该appId下,请联系相关人员添加配置。