Currency/export function (http://<DOMAIN>/api/currency/export/)
Parameters:
- token - authorisation key obtained through the auth function
- iso - ISO code of currency or ISO codes of currencies (pass in array) for unloading - not obligatory parameter
- id - unload currencies by identifier(s) (pass in array in this case) - optional parameter
- enabledOnly - unload only currencies enabled in the frontend (by default this parameter is enabled). If this parameter is specified - the iso parameter will be ignored
Response:
- status - status of the function execution
- OK - currency rates were successfully unloaded
- EMPTY - the query failed
- response.currency[] - currency discount
- response.currency[i].id - currency identifier in the system
- response.currency[i].iso - international ISO code of currency
- response.currency[i].title - readable currency name
- response.currency[i].exchangeRates[] - currency rates
- response.currency[i].exchangeRates[n].relatedId - currency identifier for which the exchange rate is specified
- response.currency[i].exchangeRates[n].relatedIso - international ISO code of the currency against which the exchange rate is specified
- response.currency[i].exchangeRates[n].currentExchangeAmount - value of the amount of the source currency (response.currency[i].id) against which the exchange rate is calculated
- response.currency[i].exchangeRates[n].relatedExchangeAmount - value of the current currency amount (response.currency[i].exchangeRates[n].relatedId) against which the rate is calculated
- response.currency[i].exchangeRates[n].exchangeCourse - exchange rate of the currency relative to 1 currency unit of the original currency and the current currency (response.currency[i].exchangeRates[n].currentExchangeAmount / response.currency[i].exchangeRates[n].relatedExchangeAmount)
Request example to (http://<DOMAIN>/api/currency/export/):
Response example:
{ "status": "OK", "response": { "currency": [ { "id": 1, "iso": "UAH", "title": "Гривна", "exchangeRates": [ { "relatedId": 2, "relatedIso": "EUR", "currentExchangeAmount": 26, "relatedExchangeAmount": 1, "exchangeCourse": 26 }, { "relatedId": 3, "relatedIso": "USD", "currentExchangeAmount": 22.5, "relatedExchangeAmount": 1, "exchangeCourse": 22.5 } ] }, { "id": 2, "iso": "EUR", "title": "Евро", "exchangeRates": [ { "relatedId": 1, "relatedIso": "UAH", "currentExchangeAmount": 1, "relatedExchangeAmount": 26, "exchangeCourse": 0.038461538461538 }, { "relatedId": 3, "relatedIso": "USD", "currentExchangeAmount": 0.87, "relatedExchangeAmount": 1, "exchangeCourse": 0.87 } ] } ] } }
0 Comments