Currency Tutorial

Supported currencies

The Emporix e-commerce system supports all existing currencies.

When creating a tenant on the Emporix Developer Portal, you can choose one of the following currencies:

  • EUR — Euro

  • GBP — Pound sterling

  • NOK — Norwegian krone

  • USD — United States dollar

If your business operates in a currency that's not listed on the Emporix Developer Portal, you need to perform the following steps:

  1. Choose one of the available currencies and finish creating your tenant.

  2. Get your Emporix API keys from the Emporix Developer Portal.

  3. Change your tenant's currency configuration.

Currency configurations

Currencies are configured both tenant-wide and independently for particular sites.

Currency codes defined in currency configurations must be compliant with the ISO 4217 standard.

Your tenant's currency configuration is stored under the project_curr key in the Emporix API Configuration Service. Check out the following example:

{
  "key": "project_curr",
  "value": "[{\"id\":\"EUR\",\"label\":\"Euro\",\"default\":true,\"required\":true},{\"id\":\"GBP\",\"label\":\"Pound sterling\",\"default\":false,\"required\":false}]"
}

Site-specific currency configuration is stored in the currency field, inside the Site object. Check out the following example:

{
  "currency": "EUR"
}

Managing currency configurations through Emporix API

Check out the following tutorials to learn more about currency configuration with Emporix API.

How to check which currencies are configured for your tenant

To retrieve your tenant's currency configuration, you need to send a request to the Retrieving a configuration endpoint.

API Reference
curl -L \
  --url 'https://api.emporix.io/configuration/{tenant}/configurations/{propertyKey}' \
  --header 'Accept: */*'

How to change your tenant's currency configuration

To change your tenant's currency configuration, you need to send a request to the Updating a configuration endpoint with updated currency information in the request body.

API Reference
curl -L \
  --request PUT \
  --url 'https://api.emporix.io/configuration/{tenant}/configurations/{propertyKey}' \
  --header 'Content-Type: application/json' \
  --data '{
    "key": "project_curr",
    "secured": false,
    "value": [
    {
      "id": "PLN",
      "label": "Polish zloty",
      "default": "true",
      "required": "true"
    }
    "version": 1
  }'

How to check which currency is configured for a particular site

To retrieve a particular site's currency configuration, you need to call the Retrieving a site endpoint. The currency configuration will be returned under the currency field in the response body.

API Reference
curl -L \
  --url 'https://api.emporix.io/site/{tenant}/sites/{siteCode}' \
  --header 'Accept: */*'

How to change a particular site's currency configuration

To change a particular site's currency configuration, you need to call the Partially updating a site endpoint with the currency code of your choice in the request body.

API Reference
curl -L \
  --request PATCH \
  --url 'https://api.emporix.io/site/{tenant}/sites/{siteCode}' \
  --header 'Content-Type: application/json' \
  --data '{
    "defaultLanguage": "en"
    "currency": "PLN"
  }'

Last updated

Was this helpful?