创建换汇订单
该API用于创建换汇订单
在完成汇率查询后,必须在30 秒内使用返回的quote_id执行换汇订单。
[!TIP|style:flat]
获取
quote_id后,需在30 秒内提交并执行外汇订单。若超过有效时间,需重新调用汇率查询接口获取新的报价。
请使用专有账号
user=040268
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方式并排序后的字符串
"method=v3.ExecuteFXOrder&order_id=202603051019-16"e_id=83e96dc0-8f8e-48c7-9bc4-6acc1019fced&reference=YB test&request_id=203040950640690239603690g-24&time=1546588959&user=040268"
得到的 stringA 使用 secret_key做签名
得到的签名如下:
"72d38337ce72430dbd06a3fea74d1b718208e591e35d25d9840394c6d95a2330"
提交示例:
{
"user": "040268",
"sign": "72d38337ce72430dbd06a3fea74d1b718208e591e35d25d9840394c6d95a2330",
"method": "v3.ExecuteFXOrder",
"time": 1546588959,
"data": {
"order_id": "202603051019-16",
"quote_id": "83e96dc0-8f8e-48c7-9bc4-6acc1019fced",
"reference": "YB test",
"request_id": "203040950640690239603690g-24"
}
}
返回示例:
{
"status": true,
"code": "200",
"data": {
"booking_status": "pending",
"settlement_status": "pending",
"sell_currency": "GBP",
"buy_currency": "DKK",
"sold_currency": "GBP",
"sold_amount": "1.00",
"bought_currency": "DKK",
"bought_amount": "8.54",
"tenor": "TOD",
"exchange_rate": "8.544924729",
"order_id": "202603051019-16",
"quote_id": "83e96dc0-8f8e-48c7-9bc4-6acc1019fced",
"trade_id": "6e5cf660fb58455cd68a413a8249061a",
"reference": "YB test"
},
"message": "",
"response_id": "202603181703581985574708"
}
更多信息:
返回结果:
- 调用成功,则返回
"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 |