API REFERENCE
Create an FX order
This API creates an FX order.
After querying the exchange rate, you must execute the FX order using the returned quote_id within 30 seconds.
Tip
After obtaining quote_id, submit and execute the FX order within 30 seconds.
If the quote expires, call the exchange rate query API again to obtain a new quote.
Please use a dedicated account.
user=040268
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | Merchant-level UID | Required |
| sign | String | Signature | Required |
| method | String | v3.ExecuteFXOrder | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| order_id | String | FX order ID | Required |
| quote_id | String | Quote ID | Required |
| request_id | String | Unique request ID; a combination of at least 24 digits and letters is recommended | Required |
| reference | String | Remarks | Optional |
Signature example:
Sorted parameters concatenated into a URL-style query string
"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"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "040268",
"sign": "YOUR_SIGNATURE",
"method": "v3.ExecuteFXOrder",
"time": 1546588959,
"data": {
"order_id": "YOUR_ORDER_ID",
"quote_id": "83e96dc0-8f8e-48c7-9bc4-6acc1019fced",
"reference": "YB test",
"request_id": "203040950640690239603690g-24"
}
}
Response example:
{
"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": "YOUR_ORDER_ID",
"quote_id": "83e96dc0-8f8e-48c7-9bc4-6acc1019fced",
"trade_id": "6e5cf660fb58455cd68a413a8249061a",
"reference": "YB test"
},
"message": "",
"response_id": "202603181703581985574708"
}
Additional information:
Response result:
- If the call succeeds, "status": true is returned.
- If the call fails, "status": false is returned.
Response codes:
| 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 |
