Localization
The Invoicetronic API supports localization of error and validation messages through the standard HTTP Accept-Language header (RFC 7231). This allows your integration to receive messages in the preferred language, improving the end-user experience.
Supported languages
Currently supported languages are:
- Italian (it) - Default language
- English (en)
- German (de)
Usage
To request error messages in a specific language, include the Accept-Language header in your HTTP requests:
curl -X POST https://api.invoicetronic.com/v1/company/ \
-H "Authorization: Basic YOUR_API_KEY" \
-H "Accept-Language: en" \
-H "Content-Type: application/json" \
-d '{"vat": null}'
Default behavior
If the Accept-Language header is not present or contains an unsupported language, the API will respond in Italian (default language).
Examples
Request messages in English
POST /v1/company/ HTTP/1.1
Host: api.invoicetronic.com
Authorization: Basic YOUR_API_KEY
Accept-Language: en
Content-Type: application/json
{"vat": null}
Any validation errors will be returned in English:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "Bad Request",
"status": 400,
"detail": "vat is required"
}
Request messages in Italian
POST /v1/company/ HTTP/1.1
Host: api.invoicetronic.com
Authorization: Basic YOUR_API_KEY
Accept-Language: it
Content-Type: application/json
{"vat": null}
Any validation errors will be returned in Italian:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "Bad Request",
"status": 400,
"detail": "vat รจ obbligatorio"
}
Request messages in German
POST /v1/company/ HTTP/1.1
Host: api.invoicetronic.com
Authorization: Basic YOUR_API_KEY
Accept-Language: de
Content-Type: application/json
{"vat": null}
Any validation errors will be returned in German:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "Bad Request",
"status": 400,
"detail": "vat ist erforderlich"
}
Quality values
The API supports quality values (q-values) according to RFC 7231. You can specify multiple languages in order of preference:
The API will select the first supported language from the list based on quality values.
Regional variants
The API accepts regional variants such as it-IT, en-US, or de-DE, but only considers the primary language code (it, en, or de):
Accept-Language: en-US # Treated as 'en'
Accept-Language: it-IT # Treated as 'it'
Accept-Language: de-DE # Treated as 'de'
Accept-Language: de-AT # Treated as 'de' (Austria)
Accept-Language: de-CH # Treated as 'de' (Switzerland)
Important notes
Default language
Starting from version 1.0.20, the default language is Italian. In previous versions the default language was English. If your integration expects messages in English, make sure to always include the Accept-Language: en header in requests.
Pre-flight validation
When using the pre-flight validation endpoints, validation error messages will respect the language specified in the Accept-Language header.
RFC 7231
The implementation follows the standard HTTP specification RFC 7231 section 5.3.5 for the Accept-Language header.
Migration from Invoicetronic-Language
In previous versions, the API used a custom Invoicetronic-Language header. This header has been deprecated and is no longer supported. If your integration still uses it, please update to use Accept-Language:
| Old header | New header |
|---|---|
Invoicetronic-Language: en |
Accept-Language: en |
Invoicetronic-Language: it |
Accept-Language: it |
Invoicetronic-Language: de |
Accept-Language: de |
Using the standard Accept-Language header ensures better compatibility with existing HTTP tools and follows web best practices.