# Country Tutorial

## Supported countries

The Emporix e-commerce system does not impose any restrictions as to which countries can be configured as your business's locations.

## Country configurations

The countries where your business is located are specified both tenant-wide and independently for particular sites.

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

A tenant's country configuration specifies where your business's headquarters are located.

A particular site's country configuration specifies where that site is located.
{% endhint %}

Country codes defined in country configurations must be compliant with the [ISO 3166-1 alpha-2 standard](https://www.iso.org/obp/ui/#iso:pub:PUB500001:en).

Your tenant country configuration is stored under the project\_country key in the [Emporix API Configuration Service](/api-references/api-guides/configuration/configuration-service.md).

```json
{
  "key": "project_country",
  "value": "DE"
}
```

Site-specific country configuration is stored in the `homeBase` field, inside the `Site` object.

```json
{
  "homeBase": {
    "address": {
      "zipCode": "10115",
      "country": "DE"
    }
  }
}
```

{% 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 country configurations through Emporix API

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

### How to check which country is configured for your tenant

To retrieve your tenant's country 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/1reKlQvd3AGEfrkjoBha" %}
[API Reference](/api-references/api-guides/configuration/currency-service/api-reference.md)
{% endcontent-ref %}

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

### How to change your tenant's country configuration

To change your tenant's country 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 country information in the request body.

{% hint style="warning" %}
The value in the request body must be compliant with the [ISO 3166-1 alpha-2 standard](https://www.iso.org/obp/ui/#iso:pub:PUB500001:en).
{% 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/uk7MQ3XZgn9QHpxQIer7" %}
[API Reference](/api-references/api-guides/configuration/country-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_country",
    "secured": false,
    "value": "DE",
    "version": 1
  }'
```

### How to check which country is configured for a particular site

To retrieve a particular site's country configuration, you need to send a request to 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 country configuration will be returned under the `homeBase` 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/NNgvoyR5R4wyK5zIt7Z6" %}
[API Reference](/api-references/api-guides/configuration/unit-handling-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 country configuration

To change a particular site's country configuration, you need to send a request to 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 address of your choice in the request body.

{% hint style="warning" %}
The country 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/NNgvoyR5R4wyK5zIt7Z6" %}
[API Reference](/api-references/api-guides/configuration/unit-handling-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"
    "homeBase": {
    "address": {
      "street": "Platz der Republik",
      "streetNumber": "1",
      "zipCode": "11011",
      "city": "Berlin",
      "country": "DE",
      "state": "Berlin"
  }'
```


---

# 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/country-service/country.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.
