# 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

{% hint style="warning" %}
*What if my business operates in a currency that's not on the list?*
{% endhint %}

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.

{% hint style="warning" %}
*What's the difference between a tenant's currency configuration and a site's currency configuration?*

Currency configured for a particular site needs to be one of the currencies configured for the whole tenant. In other words, your tenant's currency configuration must include all currencies configured for all of the sites.
{% endhint %}

Currency codes defined in currency configurations must be compliant with the [ISO 4217 standard](https://www.iso.org/iso-4217-currency-codes.html).

Your tenant's currency configuration is stored under the `project_curr` key in the Emporix API [Configuration Service](/api-references/api-guides/configuration/configuration-service.md). Check out the following example:

```json
{
  "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:

```json
{
  "currency": "EUR"
}
```

{% hint style="warning" %}
For more information on the `Site` object, check out the [*Site Settings Service guide*](/api-references/api-guides/configuration/site-settings-service.md)
{% endhint %}

### 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](https://developer.emporix.io/api-references/api-guides/configuration/configuration-service/api-reference/tenant-configurations#get-configuration-tenant-configurations-propertykey) endpoint.

{% hint style="success" %}
To test the endpoint, open the API reference or check the example of a curl request.
{% endhint %}

{% content-ref url="/pages/tdSQ3AsLz7TjdDcECwNM" %}
[API Reference](/api-references/api-guides/configuration/configuration-service/api-reference.md)
{% endcontent-ref %}

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

You can also get a list of all the currencies for your tenant by sending a request to the [Retrieving all currencies](https://developer.emporix.io/api-references/api-guides/configuration/currency-service/api-reference/currencies) endpoint.

{% hint style="success" %}
To test the endpoint, open the API reference or check the example of a curl request.
{% endhint %}

{% content-ref url="/pages/1reKlQvd3AGEfrkjoBha" %}
[API Reference](/api-references/api-guides/configuration/currency-service/api-reference.md)
{% endcontent-ref %}

```bash
curl -L 
  --url 'https://api.emporix.io/currency/{tenant}/currencies' 
  --header 'Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}' 
  --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](https://developer.emporix.io/api-references/api-guides/configuration/configuration-service/api-reference/tenant-configurations#put-configuration-tenant-configurations-propertykey) endpoint with updated currency information in the request body.

{% hint style="warning" %}
The id in the request body must be compliant with the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).
{% endhint %}

{% hint style="success" %}
To test the endpoint, open the API reference or check the example of a curl request.
{% endhint %}

{% content-ref url="/pages/tdSQ3AsLz7TjdDcECwNM" %}
[API Reference](/api-references/api-guides/configuration/configuration-service/api-reference.md)
{% endcontent-ref %}

```bash
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](https://developer.emporix.io/api-references/api-guides/configuration/site-settings-service/api-reference/site-settings#get-site-tenant-sites-sitecode) endpoint. The currency configuration will be returned under the `currency` field in the response body.

{% hint style="success" %}
To test the endpoint, open the API reference or check the example of a curl request.
{% endhint %}

{% content-ref url="/pages/tEh9PHeE6ZnfGCZRAjzE" %}
[API Reference](/api-references/api-guides/configuration/site-settings-service/api-reference.md)
{% endcontent-ref %}

```bash
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 ](https://developer.emporix.io/api-references/api-guides/configuration/site-settings-service/api-reference/site-settings#patch-site-tenant-sites-sitecode)endpoint with the currency code of your choice in the request body.

{% hint style="warning" %}
The currency code must be compliant with the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).
{% endhint %}

{% hint style="success" %}
To test the endpoint, open the API reference or check the example of a curl request.
{% endhint %}

{% content-ref url="/pages/tEh9PHeE6ZnfGCZRAjzE" %}
[API Reference](/api-references/api-guides/configuration/site-settings-service/api-reference.md)
{% endcontent-ref %}

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/api-references/api-guides/configuration/currency-service/currency.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
