Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

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/):

{
    "token" : "<ВАШ ТОКЕН>",
    "iso" : ["UAH", "USD"]
}

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
                    }
                ]
            }
        ]
    }
}
  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.