Localization

Display

By default, a resource is presented in english. You can also display the resource in another language.

With the Accept-Language header a resource can be localized. However, this does not affect validation messages or any errors. These are still displayed in English.

The following locales are currently available for Accept-Language:

en, de, nl, fr, ar, sv, pl and tk

Saving

In some cases, you can also save a resource localized. For example, the Checkout Api uses this to save an order in a specified language. By default it is stored in english, using the Accept-Language header you can control how it is stored.

This is important if, for example, the delivery note is to be displayed in a specific language.

{warning} The localization of documents (e. g.: delivery note) cannot be regenerated afterwards.

Examples

{primary.fa-paper-plane} Request for display a response with another language

GET /variants/1 HTTP/1.1
Accept-Language: 'de'

{success} Response

Content-Language: 'de'

{
    "id": 1,
    "attributes": [
        {
            "name": "color",
            "value": "Gelb"
        }
    ]
    ...
}

{primary.fa-paper-plane} Request for saving a resources with another language

POST /orders HTTP/1.1
Accept-Language: 'de'

{
   "email": "customer@example.com",
   "items": [
      {
         "variant_id": 1,
         "quantity": 1
      }
   ],
   "shipping_address": {
      "first_name": "John",
      "last_name": "Doe",
      "street1": "123 Main St",
      "zip": "12345",
      "city": "Anytown",
      "country_code": "DE",
      "province_code": "NW",
      "phone": "12345 67890",
      "email": "shipping@example.com"
   }
}

{success} Response

Content-Language: 'de'

{
    "id": 1,
    "external_identifier": null,
    "project_name": null,
    "state": "incompleted",
    "customer_locale": "de",
    ...
}