> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avatcado.com/llms.txt
> Use this file to discover all available pages before exploring further.

# invalid_eori_format

> Error: EORI number format unrecognized

# invalid\_eori\_format

> [!NOTE]
>
> HTTP Status: **422 Unprocessable Entity**

## Example response

```json theme={null}
{
  "error": {
    "code": "invalid_eori_format",
    "message": "Invalid EORI number format: GB123. GB EORI numbers are GB followed by 12 to 15 digits",
    "docs_url": "https://docs.avatcado.com/errors/invalid_eori_format",
    "eori_number": "GB123"
  },
  "meta": {
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}
```

The error echoes the normalized form of the `eori_number` you submitted, so you can see what was checked after uppercasing and stripping spaces, dots and dashes.

## What happened?

The number sent to [`GET /v1/eori/validate`](https://docs.avatcado.com/eori-validation) cannot be an EORI number that either register would accept. No register was called and the request did not count against your quota.

The message names the rule that failed:

| Message contains | Cause |
| - | - |
| `Expected a two-letter country code followed by 1 to 15 letters or digits` | No country prefix, more than 15 characters after the prefix, or a character that is not a letter or digit |
| `Unsupported EORI country code` | The prefix is not one of the 27 EU member states, `XI` or `GB` |
| `GB EORI numbers are GB followed by 12 to 15 digits` | A GB number with fewer than 12 digits, more than 15, or a letter in it |

## How to fix

1. **Include the country prefix**: `GB123456789000`, `NL123456789`, `XI123456789000`
2. **Send the EORI number, not the VAT number**: a GB VAT number has 9 digits, a GB EORI number has 12 to 15. `GB123456789` fails here; the EORI number for that trader is usually `GB123456789000`
3. **Let the API normalize**: send `gb 123.456.789 000` as typed. Spaces, dots, dashes and casing are handled for you

```bash theme={null}
# Correct
curl "...?eori_number=GB123456789000"
curl "...?eori_number=nl+123.456.789"

# Wrong: a 9-digit GB VAT number
curl "...?eori_number=GB123456789"

# Wrong: no country prefix
curl "...?eori_number=123456789000"

# Wrong: a country with no EORI register behind this endpoint
curl "...?eori_number=CH123456789"
```

## Common mistakes

* **Sending a VAT number**: use [`GET /v1/validate`](https://docs.avatcado.com/api-reference/vat-validation/validate-a-vat-number) for VAT numbers. The two registers are separate
* **Dropping a leading zero**: many Belgian numbers start with one (`BE0123456789`). Keep the number as issued
* **Using `EL` for Greece**: this works. Greek EORI numbers are issued with `GR`, and a number sent with the VAT prefix `EL` is rewritten to `GR` for you
* **Sending a Swiss, Norwegian or other non-EU number**: only numbers issued by an EU member state or the UK can be checked

## Related errors

* [`missing_parameter`](https://docs.avatcado.com/errors/missing_parameter): the `eori_number` parameter was not provided at all
* [`upstream_unavailable`](https://docs.avatcado.com/errors/upstream_unavailable): the number is well-formed and the register is down


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.