NewProvince is only required for addresses in Spain
BeeL
Get startedMulti-NIFVeriFactuRulesStripeAPI referenceChangelog
ErrorsAll codes

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 status422 Unprocessable Content
RetryAfter 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.

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

The country '‹value›' does not match country_code '‹value›'. Send only country_code, the country's ISO 3166-1 alpha-2 code.
El país '‹value›' no coincide con country_code '‹value›'. Envía solo country_code, el código ISO 3166-1 alfa-2 del país.
El país '‹value›' no coincideix amb country_code '‹value›'. Envia només country_code, el codi ISO 3166-1 alfa-2 del país.

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

Keep exploring