本接口适用于查询法币与加密货币之间的实时汇率,支持多种币对的汇率查询,仅限Gate Pay商户调用。
数据类型:JSON (content-type:application/json)
请求⽅式:POST
路径Path: /v1/pay/currency/exchange/rate/query
验证方式:签名验证
请求体内容:
| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
| sourceCurrency | string | 是 | 基准货币, 支持币种:EUR/GBP/USD/CNY/JPY/AUD/CAD/CHF |
| targetCurrency | string | 是 | 目标货币, 支持币种:USDT |
| 字段名 | 类型 | 说明 |
|---|---|---|
| sourceCurrency | string | 基准货币 |
| targetCurrency | string | 目标货币 |
| rate | string | 基准货币/目标货币的汇率 |
| updateTime | long | 报价时间 |
CURL 请求
curl --location 'https://openplatform.gateapi.io/v1/pay/currency/exchange/rate/query' \
--header 'X-GatePay-Certificate-ClientId: mZ96D37oKk-HrWJc' \
--header 'Content-Type: application/json' \
--header 'X-GatePay-Timestamp: 1726027137585' \
--header 'X-GatePay-Nonce: 2290830087' \
--header 'X-GatePay-Signature: 601d560c54d53412aca5901256f101e7078b5779f61f30bedfe9a5f0b92f049589952a151ea477371e4a99ac0e1c3cc8dec62654b3c6a1794ef981efe19232bc' \
--data '{
"sourceCurrency":"PHP",
"targetCurrency":"USDT"
}'
响应:
{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"sourceCurrency": "EUR",
"targetCurrency": "USDT",
"rate":"0.021",
"updateTime":12324324324323
}
}
| 错误码 | 描述 | 解决方案 |
|---|---|---|
400007 | 不⽀持的media type | 查看接⼝⽀持的media type |
400001 | 无效请求参数 | 请检查请求参数是否合法 |
400002 | 无效签名 | 检查签名算法是否正确 |
400500 | 不支持货币 | 其它异常码参考官方文档 |