查询数字货币币价
介绍
此接口用于查询On ramp的币价查询。若您希望您的用户在跳转ramp页面前预估买币的币价和能得到的数量,可以用此接口查询
接口说明
路径:POST /open/api/v3/merchant/order/quote
❗️该接口只能在服务端被调用
Header参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
appid | Y | string | 应用的唯一标识 |
timestamp | Y | string | 当前 UTC 13位时间戳, 5分钟内有效 |
sign | Y | string | 将appId,timeStamp,和请求的参数按字母排序进行签名,签名方式可参考这里 |
Body参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
crypto | Y | string | 数字货币币种 |
network | Y | string | 网络 |
fiat | Y | string | 3字母法币code |
country | Y | string | 2字母国家code |
amount | Y | Bigdecimal | BUY时为购买法币金额 / SELL时为卖出crypto的数量 |
payWayCode | N | string | 支付方式 side 为SELL忽略此参数 |
side | Y | string | 订单方向:BUY、SELL |
type | C | string | 数据类型: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": {
"cryptoPrice": "1.005",// crypto当前价格
"rampFee": "4.39",// 预估通道费用
"cryptoNetworkFee": "17.48",
"cryptoQuantity": "77.66432835",// crypto可以购买的预估数量
"networkFee": "17.55",// 预估网络费用
"rebateFiatAmount": "0.00",//返佣数量(法币计价)
"fiat": "USD",//法币单位
"rebateUsdAmount": "0.00",//返佣数量(USD计价)
"crypto": "USDT",
"payWayCode": "701",
"rampFeeInUSD": "4.39"//预估网络费用(USD计价)
},
"traceId": "65ead7efaf51f85e7df2be0eea35f249"
}
# side为BUY,type为ALL 返回参数
{
"success": true,
"returnCode": "0000",
"returnMsg": "SUCCESS",
"extend": "",
"data": [
{
"cryptoPrice": "1.005",
"rampFee": "4.39",
"cryptoNetworkFee": "14.67",
"cryptoQuantity": "80.47432835",
"networkFee": "14.73",
"rebateFiatAmount": "0.00",
"fiat": "USD",
"rebateUsdAmount": "0.00",
"crypto": "USDT",
"payWayCode": "501",
"rampFeeInUSD": "4.39"
},
{
"cryptoPrice": "1.005",
"rampFee": "4.39",
"cryptoNetworkFee": "14.67",
"cryptoQuantity": "80.47432835",
"networkFee": "14.73",
"rebateFiatAmount": "0.00",
"fiat": "USD",
"rebateUsdAmount": "0.00",
"crypto": "USDT",
"payWayCode": "701",
"rampFeeInUSD": "4.39"
},
{
"cryptoPrice": "1.005",
"rampFee": "4.39",
"cryptoNetworkFee": "14.67",
"cryptoQuantity": "80.47432835",
"networkFee": "14.73",
"rebateFiatAmount": "0.00",
"fiat": "USD",
"rebateUsdAmount": "0.00",
"crypto": "USDT",
"payWayCode": "10001",
"rampFeeInUSD": "4.39"
}
],
"traceId": "65ead98b7c71e3e632e88873583e65a7"
}
# 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
得到以下返回值时
原因是查询的法币或者数字货币没有配置到该appId下,请联系相关人员添加配置。
Updated 10 months ago