API REFERENCE
Query Exchange Rate
Use this API to query real-time conversion rates for WeChat Pay and Alipay. Exchange rates fluctuate between 09:00 and 11:00. CNY is the settlement currency.
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | Cashier account UID | Required |
| sign | String | Signature | Required |
| method | String | v3.QueryExchangeRate | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| settlement_currency | String | Currency; see the currency details below | Required |
| sub_method | String | WeChat Pay,Alipay | Required |
- Currencies
| Currency | Currency code | Notes |
|---|---|---|
| Singapore | SGD | |
| Norwegian krone | NOK | |
| UAE dirham | AED | Queries are not supported by WeChat Pay |
| Philippine peso | PHP | Queries are not supported by WeChat Pay |
| Swedish krona | SEK | |
| New Zealand dollar | NZD | |
| Czech koruna | CZK | Queries are not supported by WeChat Pay |
| Malaysia | MYR | Queries are not supported by WeChat Pay |
| Pound sterling | GBP | |
| Danish krone | DKK | |
| Euro | EUR | |
| Indonesian rupiah | IDR | Queries are not supported by WeChat Pay |
| Sri Lankan rupee | LKR | Queries are not supported by WeChat Pay |
| Thai baht | THB | |
| South Africa | ZAR | Queries are not supported by WeChat Pay |
| US dollar | USD | |
| Macao, China | MOP | Queries are not supported by WeChat Pay |
| Canadian dollar | CAD | |
| Japanese yen | JPY | |
| Russian ruble | RUB | |
| South Korea | KRW | |
| Saudi Arabia | AUD | |
| Taiwan, China | TWD | Queries are not supported by WeChat Pay |
| Swiss franc | CHF | |
| Hong Kong dollar | HKD |
Signature example:
Sorted parameters concatenated into a URL-style query string
"method=v3.QueryExchangeRate&settlement_currency=EUR&sub_method=Alipay&time=1546588959&user=YOUR_CASHIER_UID"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.QueryExchangeRate",
"time": 1546588959,
"data": {
"settlement_currency": "EUR",
"sub_method": "Alipay"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"exchange_rate": "7.850000"
},
"message": ""
}
