API REFERENCE
Query Exchange Rate
This API queries exchange rates.
Before creating an FX order, you must call this API to obtain a quote and create the order within 30 seconds of receiving the quote.
Notes
Tip
Notes
Quote validity period
Each exchange rate quote returned is valid for 30 seconds. After it expires, you must query the exchange rate again.Settlement tenor (Tenor)
TOD: Real-time settlement, unaffected by public holidays.
SPOT: Settlement on T+2 business days. Before the settlement date, ensure that the account has sufficient funds for settlement. If settlement fails due to insufficient funds, a penalty may be charged based on the actual loss.
- SPOT access
You must apply in advance to use SPOT settlement, which is subject to credit limits.
Please use a dedicated account.
user=040268
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | Merchant-level UID | Required |
| sign | String | Signature | Required |
| method | String | v3.GetFXQuote | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| sell_currency | String | Currency to sell | Required |
| buy_currency | String | Currency to buy | Required |
| currency | String | Currency to sell if currency matches sell_currency; otherwise, the currency to buy | Required |
| amount | String | Amount to sell if currency matches sell_currency; otherwise, the amount to buy | Required |
| tenor | String | TOD or SPOT | Required |
| request_id | String | Unique request ID; a combination of at least 24 digits and letters is recommended | Required |
Signature example:
Sorted parameters concatenated into a URL-style query string
"amount=1&buy_currency=DKK¤cy=GBP&method=v3.GetFXQuote&request_id=20304095064069023960369000g-42&sell_currency=GBP&tenor=TOD&time=1546588959&user=040268"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "040268",
"sign": "YOUR_SIGNATURE",
"method": "v3.GetFXQuote",
"time": 1546588959,
"data": {
"sell_currency": "GBP",
"buy_currency": "DKK",
"currency": "GBP",
"amount": "1",
"tenor": "TOD",
"request_id": "20304095064069023960369000g-42"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"type": "sell",
"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,
"quote_id": "83e96dc0-8f8e-48c7-9bc4-6acc1019fced",
"expiry_time": 1773824647
},
"message": "",
"response_id": "202603181703362736334439"
}
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 |
