跳到主要内容

汇率查询

请求地址

[POST] /v1/mid-open-api/exchange/rate
需要验证签名

接口描述

查询支持的币种之间的汇率

提示
  1. 支持的货币对需要在接入时联系PingPong产品经理沟通确认后,由PingPong配置。
  2. 查询到的汇率需要在过期时间之前使用。

请求头

ParameterTypeRequiredDescription
AuthorizationstringMaccess_token
Content-TypestringMapplication/json

请求参数

ParameterTypeRequiredDescription
client_idstring(64)M客户ID,客户在平台唯一ID
sell_currencystring(3)M卖出币种 ,不可与买入币种一致
buy_currencystring(3)M买入币种 ,不可与卖出币种一致
extra_infostring(128)O预留扩展字段

返回响应

ParameterTypeRequiredDescription
client_idstring(64)M客户在PP唯一ID
sell_currencystring(3)M卖出币种
buy_currencystring(3)M买入币种
rate_idlongM汇率ID
ratedecimal(18,9)M汇率
expire_timelongM汇率过期时间,毫秒

返回示例

{
"code": 200,
"message": "SUCCESS",
"data": {
"rate": 0.912659,
"client_id": "IT8623081103775418152",
"sell_currency": "USD",
"buy_currency": "EUR",
"rate_id": 1699260141909504002,
"expire_time": 1693970280068
}
}

错误码

错误码描述解决方案
900000system error系统错误,请联系PingPong技术人员核查
900002illegal param参数有误,请根据提示更正信息
953003exchange rate not found汇率未查询到,联系PingPong技术人员核查是否配置相应货币对
953004inquire exchange rate error汇率查询错误,请稍后重试或联系PingPong技术人员核查