COUNTRY_CODE_MISMATCH
The country '‹value›' does not match country_code '‹value›'. Send only country_code, the country's ISO 3166-1 alpha-2 code.
Category: Customers
| HTTP status | 422 Unprocessable Content |
| Retry | After fixing the cause |
When it happens
An address carries a country and a country_code that name different countries. España alone yields to a foreign country_code.
How to fix it
Send only country_code, or make both agree.
Retry
Not as is: the same request fails the same way. Fix the cause described above, then send the request again, under a new Idempotency-Key if the body changed.
Returned by
The operations where this code is most likely. The list is not exhaustive.
POST /v1/companies/{company_id}/customersPATCH /v1/companies/{company_id}/customers/{customer_id}POST /v1/companies/{company_id}/invoicesPATCH /v1/companies/{company_id}/invoices/{invoice_id}POST /v1/accounts/{account_id}/companies
Example response
When this error occurs, the API answers 422 Unprocessable Content with a JSON body of this shape:
{
"type": "https://docs.beel.es/errors/COUNTRY_CODE_MISMATCH",
"title": "COUNTRY_CODE_MISMATCH",
"detail": "The country '‹value›' does not match country_code '‹value›'. Send only country_code, the country's ISO 3166-1 alpha-2 code.",
"instance": "/v1/<resource>",
"errors": [],
"success": false,
"error": {
"code": "COUNTRY_CODE_MISMATCH",
"message": "The country '‹value›' does not match country_code '‹value›'. Send only country_code, the country's ISO 3166-1 alpha-2 code.",
"details": {}
},
"meta": {
"timestamp": "2026-05-21T10:00:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}The type URI is stable and always resolves to this page.
Message
Send the request with Accept-Language: <es|en|ca> to receive the message in your preferred language.
Placeholders like
‹value›are filled in at runtime with the actual values of your request.
Other errors in this category
ALTERNATIVE_ID_AND_NIF_EXCLUSIVE
The customer cannot carry both a NIF and an alternative identifier. Use only one
ALTERNATIVE_ID_COUNTRY_REQUIRED
The country of the alternative identifier is missing (alternative_id.country_code). It is required except for the PASSPORT and NOT_REGISTERED types, which are taken as Spanish when it is omitted.
ALTERNATIVE_ID_INVALID
The alternative identifier is not valid
ALTERNATIVE_ID_REQUIRES_SPAIN
Type NOT_REGISTERED (07) is only valid for Spain; received country: '‹value›'
ALTERNATIVE_ID_SPAIN_INVALID_TYPE
For customers with country ES only types PASSPORT (03) or NOT_REGISTERED (07) are allowed
Keep exploring
CORRECTIVE_WITHHOLDING_ONLY
This correction only changes the withholding: the taxable base of every rate stays the same. A withholding is not a cause for a corrective invoice; void the invoice and issue a new one without it.
COUNTRY_CODE_REQUIRED
The country '‹value›' is not valid. Send the country's ISO 3166-1 alpha-2 code in country_code (for example, GB for the United Kingdom).