W System / VERI*FACTU IDType 02 (NIF-IVA) customer check

VERI*FACTU IDType 02 (NIF-IVA): check an EU customer's VAT number before you send the record

Short answer: For an EU customer without a Spanish NIF, a VERI*FACTU record identifies the destinatario with IDOtro, IDType 02 (NIF-IVA) and the VAT number in ID. According to AEAT's current validation document (v1.2.2, 8 April 2026), the number must match the NIF-IVA structure of a Member State and "debe estar identificado" (must be identified). Uppercase only, and only on invoice types F1, F3 and R1 to R4. Check the format and the VIES status first, so a typo or an unregistered number doesn't come back as a rejected record.

What AEAT validates for IDType 02

AEAT's developer FAQ (v1.3, 4 December 2025) gives the same pattern in an example: for a service to "un empresario de la UE con VIES válido", the record carries IDType 02 and Id = the customer's NIF-IVA.

NIF-IVA structure table (AEAT)

PrefixCountryCharacters after the prefix
DEGermany9 digits
ATAustria9 letters or digits
BEBelgium10 digits
CYCyprus9 letters or digits
CZCzechia8 or 9 or 10 digits
HRCroatia11 digits
DKDenmark8 digits
SKSlovakia10 digits
SISlovenia8 digits
EEEstonia9 digits
FIFinland8 digits
FRFrance11 letters or digits
ELGreece9 digits
XINorthern Ireland5 or 9 or 12 letters or digits
NLNetherlands12 letters or digits
HUHungary8 digits
ITItaly11 digits
IEIreland8 or 9 letters or digits
LVLatvia11 digits
LTLithuania9 or 12 digits
LULuxembourg8 digits
MTMalta8 digits
PLPoland10 digits
PTPortugal9 digits
SESweden12 digits
BGBulgaria9 or 10 digits
RORomania2 to 10 digits, no leading zero

Sources: AEAT Validaciones y errores, Sistemas Informáticos de Facturación y Sistemas VERI*FACTU, v1.2.2 (08/04/2026), sections 12 and 13 and note (1); AEAT Aclaraciones a dudas de los desarrolladores v1.3 (4 December 2025). Table translated from Spanish; checked 2026-10-27. This page is technical information, not tax advice.

A safe order of checks in your invoicing software

1. Normalise: strip spaces, dots and dashes; uppercase; Greece = EL
2. Structure: prefix + length/characters from the AEAT table (else: fix input)
3. VIES: valid  -> IDType 02, ID = full NIF-IVA
         invalid -> ask the customer; don't send it as 02
         unknown (VIES or member state down) -> retry later, don't downgrade
4. Build the RegistroAlta and submit

Do steps 2 and 3 with one call

We make W System, an EU VAT and e-invoicing API. GET /verify checks the format for the country first (answering invalid_format with the reason before VIES is called), then asks VIES and returns valid, the registered name where the member state discloses it, and a consultation number when you pass your own VAT number as requester. When VIES is down you get member_state_unavailable with valid: null, never a false "invalid". Free: 20 calls a day per IP, or a free key with 500 units a month. It does not submit records to AEAT.

curl "https://api.wsystem.dev/verify?vat=IE6388047V"

Questions and answers

What does IDType 02 mean in VERI*FACTU?

It is the NIF-IVA, the EU VAT number of a customer (destinatario) who is not identified by a Spanish NIF. It goes in the IDOtro block with IDType 02 and the number in ID; CodigoPais is then not required.

Does AEAT check the NIF-IVA against VIES?

AEAT's validation document v1.2.2 (8 April 2026) says the ID must match the NIF-IVA structure of a Member State and 'debe estar identificado' (must be identified). It does not name the database, but its note on the structure links to the European Commission's VIES pages. The older v0.7 (2024) only asked for the structure. So check the number in VIES before you send the record.

Why does AEAT say my NIF-IVA has an invalid format?

Common causes: lowercase letters (AEAT accepts uppercase only), spaces or dots, a missing country prefix, a wrong length for that country, GR instead of EL for Greece, or a GB number for an operation after January 2021 (it must start with XI then). The pre-check on this page tests the same structure table AEAT publishes.

Can I use IDType 02 on a simplified invoice?

No. With IDOtro and IDType 02, TipoFactura must be F1, F3, R1, R2, R3 or R4. F2 and R5 invoices may not carry a Destinatarios block at all.

What if the customer is Spanish or has no EU VAT number?

A Spanish customer goes in the NIF field. If you use IDOtro with CodigoPais ES, AEAT requires IDType 03 or 07. A customer without an EU VAT number (for example outside the EU, or a private person) needs another IDType from AEAT's code list, not 02.

Is VIES 'down' the same as invalid?

No. If VIES or the member state does not answer, the result is unknown, not invalid. Retry later instead of changing the customer's identification. W System returns valid: null and member_state_unavailable in that case, never a false 'invalid'.

Related

Facts checked 2026-10-27. W System is the maker of this product. Not affiliated with the European Commission. Not legal or tax advice.