XV-ES-02

An EU VAT number given with IDType 02 (NIF-IVA) doesn't have the structure of any member state's VAT number: a country prefix in capitals and its number of characters, as the AEAT's validations document lists them ('…').

error: the document is invalid

Why it fails

  • The VAT number without its country prefix, with spaces, or in lower case.
  • A non-EU tax number given with IDType 02, which is for EU VAT numbers (NIF-IVA) only.

How to fix it

Write the number as VIES shows it, prefix included (FR12345678901, EL123456789 for Greece, XI for Northern Ireland); for other countries use IDType 04, 05 or 06.

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.