执行换汇订单
该API用于执行换汇订单
在完成第一步销售货币和兑换货币的汇率查询。后的30秒内执行外汇订单。
[!TIP|style:flat]
时间限制:在得到quote_id后的30秒内执行外汇订单。
API URL:https://mapi.yabandpay.com/Payments
Method:POST
POST data type:Json
| 参数 | 类型 | 描述 | 是否必填 |
|---|---|---|---|
| user | String | Merchant级的UID | 必填 |
| sign | String | 签名 | 必填 |
| method | String | v3.ExecuteFXOrder | 必填 |
| time | Long | 时间戳 | 必填 |
- 参数
| 参数 | 类型 | 描述 | 是否必填 |
|---|---|---|---|
| order_id | String | 外汇订单id | 必填 |
| quote_id | String | 询价的id | 必填 |
| request_id | String | 请求id需保持唯一,建议24以上位数字+字母 | 必填 |
| reference | String | 备注 | 非必填 |
签名示例:
拼接为URL方式并排序后的字符串
"amount=1000&buy_currency=EUR¤cy=USD&method=v3.ExecuteFXOrder&order_id=513456465135416545"e_id=78636c41-d214-4a8f-ae22-5c112ca0e1c7&reference=test&request_id=203040950640690239603690&sell_currency=USD&tenor=TOD&time=1546588959&user=016683"
得到的 stringA 使用 secret_key做签名
得到的签名如下:
"8d53a15c0f1790dd636962eecaac8e936f3344c44c215a988f8363821bc31eae"
提交示例:
{
"user": "016683",
"sign": "8d53a15c0f1790dd636962eecaac8e936f3344c44c215a988f8363821bc31eae",
"method": "v3.ExecuteFXOrder",
"time": 1546588959,
"data": {
"order_id": "513456465135416545",
"quote_id": "78636c41-d214-4a8f-ae22-5c112ca0e1c7",
"reference": "test",
"request_id": "203040950640690239603690"
}
}
返回示例:
{
"status": true,
"code": "200",
"data": {
"trade_id": "759418a7-acb0-0034-cc6c-3a557e35a127",
"status": "complete",
"booking_status": "pending",
"settlement_status": "pending",
"sell_currency": "USD",
"buy_currency": "EUR",
"sold_currency": "USD",
"sold_amount": 1000,
"bought_currency": "EUR",
"bought_amount": 830.58,
"tenor": "TOD",
"exchange_rate": 0.8305804,
"order_id": "513456465135416545",
"quote_id": "78636c41-d214-4a8f-ae22-5c112ca0e1c7",
"reference": "test",
"response_id": "203040950640690239603690"
},
"message": ""
}
更多信息:
返回结果:
- 调用成功,则返回
"status": true - 调用失败,则返回
"status": false
返回代码:
| Status | Code | Message |
|---|---|---|
| true | 200 | |
| false | -1000 | Internal error |
| false | -403 | The signature Error |
| false | -2001 | The UID not exist |
| false | -3001 | Required field is missing |
| false | -4118 | Incorrect request ID |