VIES Error

INVALID_INPUT

Invalid country code or VAT number format

What does INVALID_INPUT mean?

The INVALID_INPUT error means VIES rejected your request because either the country code is invalid or the VAT number format doesn't match the expected pattern. Unlike other VIES errors, this one is fixable on your end.

VIES validates the format before querying national databases. If your input doesn't pass basic validation, you'll get this error immediately.

Common causes

  1. Invalid country code: Using a non-EU country code or incorrect code (e.g., "UK" instead of "GB", or using "GB" post-Brexit)
  2. Empty VAT number: Sending a blank or null value
  3. Wrong format: VAT number doesn't match the country's expected pattern
  4. Including the country prefix twice: Sending "DEDE123456789" instead of "DE123456789"
  5. Special characters: Including spaces, dashes, or other non-alphanumeric characters

Valid country codes

VIES accepts these EU member state codes:

AT, BE, BG, CY, CZ, DE, DK, EE, EL (Greece), ES, FI, FR, HR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI, SK

Note: The UK (GB) left the EU and is no longer available through VIES.

This error is preventable

Unlike rate limits and service outages, INVALID_INPUT is caused by bad data. Validate country codes and VAT number formats before calling VIES to avoid this error entirely.

How to fix INVALID_INPUT

1. Use a VAT validation service with automatic normalization

VatDB automatically normalizes and validates VAT numbers before checking official databases. We handle country code detection, format cleaning, and checksum validation. You just send us the VAT number and we handle the rest.

2. Validate country code

Ensure the country code is a valid EU member state. Remember that Greece uses "EL" not "GR", and the UK is no longer part of VIES.

3. Clean the VAT number

Remove spaces, dashes, dots, and other special characters. Convert to uppercase.

4. Validate format before calling VIES

Each country has a specific VAT number format. Pre-validate to avoid unnecessary API calls.

Let VatDB handle input validation

VatDB automatically normalizes and validates VAT numbers before checking official EU and national databases. We handle country code detection, format cleaning, and checksum validation. You just send us the VAT number.

Try VatDB Free

Frequently Asked Questions

Why does Greece use 'EL' instead of 'GR'?
VIES uses 'EL' (Ellada) for Greece, not the ISO 3166 code 'GR'. This is a common source of INVALID_INPUT errors. Always use 'EL' for Greek VAT numbers in VIES.
Can I validate UK VAT numbers through VIES?
No. The UK left the EU and is no longer part of VIES. Use HMRC's VAT validation service for UK numbers. VatDB handles both EU and UK validation automatically.
Should I include the country code in the VAT number?
VIES expects the country code and VAT number as separate fields. If you include the country code in the VAT number field (like 'DE123456789'), you may need to strip it first.
How does VatDB handle INVALID_INPUT?
VatDB normalizes input before validation. We extract country codes, clean formatting, and validate against known patterns. You rarely see format errors because we handle them before querying official sources.