Get All Exchange Rates
Retrieves the store's exchange rates. Each record has a base currency and a list of conversion rates. Add activeCurrency=true to get only the rates currently used for the store's additional currencies.
HTTP Request
- URL:
/exchangeRate - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope: None. Any valid access token can call this endpoint.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Number | Page number to retrieve. Default is 1. |
limit | Number | Number of records per page. Default is 10. |
activeCurrency | Boolean | Set to true to get the rates used for the store's additional currencies. |
cURL Example
curl --location '<BASE_URL>/exchangeRate?page=1&limit=10' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The exchange rates were returned successfully.
- 400 Bad Request: The request could not be completed.
Sample JSON Response
{
"success": true,
"data": [
{
"id": "66f1a2b3c4d5e6f708192a3b",
"baseCurrency": "USD",
"rates": [
{ "id": "66f1a2b3c4d5e6f708192a3c", "currency": "EUR", "rate": 0.9214 },
{ "id": "66f1a2b3c4d5e6f708192a3d", "currency": "GBP", "rate": 0.7712 },
{ "id": "66f1a2b3c4d5e6f708192a3e", "currency": "CAD", "rate": 1.3651 }
],
"updatedAt": "2024-10-13T00:00:02.415Z",
"createdAt": "2024-09-23T17:41:07.902Z"
}
]
}
Sample JSON Response with activeCurrency=true
{
"success": true,
"data": {
"updatedAt": "2024-10-14T09:30:11.204Z",
"baseCurrency": "USD",
"rates": [
{
"currency": "EUR",
"symbol": "€",
"symbolPosition": "left",
"decimalDigits": 2,
"rate": 0.9214,
"source": "live"
},
{
"currency": "CAD",
"symbol": "$",
"symbolPosition": "left",
"decimalDigits": 2,
"rate": 1.35,
"source": "manual"
}
]
}
}
Response Details
Exchange Rate Data
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the exchange rate record. |
baseCurrency | String | Currency the rates convert from, for example USD. |
rates | Array | Conversion rates. See below. |
updatedAt | String | Date and time the rates were last updated (ISO 8601). |
createdAt | String | Date and time the record was created (ISO 8601). |
Rate Object
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the rate. |
currency | String | Currency code, for example EUR. |
rate | Number | How much of this currency equals 1 unit of the base currency. |
Active Currency Data
Returned when activeCurrency=true. data is null if the store has no additional currencies.
| Field | Type | Description |
|---|---|---|
updatedAt | String | Date and time the rates were last refreshed (ISO 8601). |
baseCurrency | String | Currency the rates convert from. |
rates[].currency | String | Currency code. |
rates[].symbol | String | Currency symbol. |
rates[].symbolPosition | String | Where the symbol is shown. |
rates[].decimalDigits | Number | Number of decimal places. |
rates[].rate | Number | Rate in use. |
rates[].source | String | live for automatically updated rates, or manual for a fixed rate set in the store settings. |
Notes
- Live exchange rates are updated automatically on a regular schedule.