> ## 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_vat_format

> Error: VAT number format unrecognized

# invalid\_vat\_format

<Info>HTTP Status: **422 Unprocessable Entity**</Info>

## Example response

```json theme={null}
{
  "error": {
    "code": "invalid_vat_format",
    "message": "The VAT number format is invalid. Expected format: CC123456789",
    "docs_url": "https://docs.avatcado.com/errors/invalid_vat_format"
  },
  "meta": {
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}
```

## What happened?

The VAT number doesn't match the expected format for its country, or the country code is not supported. This happens when:

* The VAT number is missing a country prefix
* The country code is not in the [supported countries list](/supported-countries)
* The number contains only the country code with no digits
* The number does not match the expected format for its country (wrong length, missing required characters)
* The number contains invalid characters after normalization
* The Swiss UID (CHE format) or Norwegian org number fails the MOD11 checksum
* The Australian ABN fails the weighted checksum validation

## Expected formats

| Country        | Code | Format (after country prefix)                                   | Example          |
| -------------- | ---- | --------------------------------------------------------------- | ---------------- |
| Austria        | AT   | U + 8 digits                                                    | ATU12345678      |
| Belgium        | BE   | 10 digits (starts with 0 or 1)                                  | BE0123456789     |
| Bulgaria       | BG   | 9 or 10 digits                                                  | BG123456789      |
| Croatia        | HR   | 11 digits                                                       | HR12345678901    |
| Cyprus         | CY   | 8 digits + 1 letter                                             | CY12345678A      |
| Czech Republic | CZ   | 8, 9, or 10 digits                                              | CZ12345678       |
| Denmark        | DK   | 8 digits                                                        | DK12345678       |
| Estonia        | EE   | 9 digits                                                        | EE123456789      |
| Finland        | FI   | 8 digits                                                        | FI12345678       |
| France         | FR   | 2 characters + 9 digits                                         | FRAB123456789    |
| Germany        | DE   | 9 digits                                                        | DE123456789      |
| Greece         | EL   | 9 digits                                                        | EL123456789      |
| Hungary        | HU   | 8 digits                                                        | HU12345678       |
| Ireland        | IE   | 7 digits + 1-2 letters, or 1 digit + letter + 5 digits + letter | IE1234567A       |
| Italy          | IT   | 11 digits                                                       | IT12345678901    |
| Latvia         | LV   | 11 digits                                                       | LV12345678901    |
| Lithuania      | LT   | 9 or 12 digits                                                  | LT123456789      |
| Luxembourg     | LU   | 8 digits                                                        | LU12345678       |
| Malta          | MT   | 8 digits                                                        | MT12345678       |
| Netherlands    | NL   | 9 digits + B + 2 digits                                         | NL123456789B01   |
| Poland         | PL   | 10 digits                                                       | PL1234567890     |
| Portugal       | PT   | 9 digits                                                        | PT123456789      |
| Romania        | RO   | 2 to 10 digits                                                  | RO1234567890     |
| Slovakia       | SK   | 10 digits                                                       | SK1234567890     |
| Slovenia       | SI   | 8 digits                                                        | SI12345678       |
| Spain          | ES   | 1 letter or digit + 7 digits + 1 letter or digit                | ESA12345678      |
| Sweden         | SE   | 12 digits                                                       | SE123456789012   |
| N. Ireland     | XI   | 9 or 12 digits                                                  | XI123456789      |
| United Kingdom | GB   | 9 or 12 digits                                                  | GB123456789      |
| Switzerland    | CH   | 9 digits (with MWST/TVA/IVA suffix)                             | CHE123456789MWST |
| Norway         | NO   | 9 digits (with MVA suffix)                                      | NO123456789MVA   |
| Australia      | AU   | 11 digits (ABN)                                                 | AU51824753556    |

## How to fix

1. **Include the country code**: Always prefix with the country code: `NL123456789B01`, `GB123456789`, `DE123456789`, `CHE123456789MWST`, `NO123456785MVA`, `AU51824753556`
2. **Check supported countries**: See the full list at [Supported Countries](/supported-countries)
3. **Let the API normalize**: Don't strip spaces or dots manually. Send `"NL 123.456.789 B01"` and the API handles it

```bash theme={null}
# Correct
curl "...?vat_number=NL123456789B01"
curl "...?vat_number=CHE-123.456.789+MWST"
curl "...?vat_number=NO123456785MVA"

# Wrong - no country code
curl "...?vat_number=123456789B01"

# Wrong - invalid MOD11 checksum for Swiss UID
curl "...?vat_number=CHE999999999MWST"

# Also correct - the API normalizes this
curl "...?vat_number=nl+123.456.789+b01"
```

## Common mistakes

* **Forgetting the country code**: `123456789` instead of `NL123456789B01`
* **Using lowercase**: This actually works fine (the API normalizes to uppercase), but check there's a country prefix
* **Including "VAT" prefix**: `VAT123456789` is not valid; use the country code instead
* **Using `GR` for Greece**: Greece uses `EL` in the VIES system, not `GR`
* **Missing the MWST/TVA/IVA suffix for Swiss numbers**: `CHE123456789` alone is not valid; include the suffix (e.g. `CHE123456789MWST`)
* **Missing the MVA suffix for Norwegian numbers**: `NO123456785` alone is not valid; include `MVA` (e.g. `NO123456785MVA`)
* **Wrong number of digits**: e.g. sending 10 digits for GB (requires exactly 9 or 12)
* **Missing the B separator for Dutch VAT**: NL numbers require B between the digit groups, e.g. NL123456789B01
* **Using an unsupported country**: Only EU member states, GB, XI, CH, LI, NO, AU, and SG are supported

## Catching this error with the SDKs

<CodeGroup>
  ```typescript @avatcado/node theme={null}
  import Avatcado, { ValidationError } from '@avatcado/node';

  const avatcado = new Avatcado('avat_live_your_api_key');
  const { data, error } = await avatcado.vat.validate({ vatNumber: '...' });

  if (error instanceof ValidationError) {
    console.log(error.message);
    console.log(error.details); // Array<{ field, message }> | null
  }
  ```

  ```python Python theme={null}
  from avatcado import Avatcado, ValidationError

  avatcado = Avatcado("avat_live_your_api_key")

  try:
      result = avatcado.vat.validate("...")
  except ValidationError as e:
      print(e.message)
      print(e.details)  # list of dicts or None
  ```
</CodeGroup>

## Related errors

* [`missing_parameter`](/errors/missing_parameter) - VAT number parameter not provided at all
