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
- The ID must match the NIF-IVA structure of one of the Member States (table below) and must be identified. CodigoPais is not required with IDType 02.
- Only uppercase letters are accepted, following the Commission's VIES guidelines (AEAT's note 1).
- With IDOtro and IDType 02, TipoFactura must be F1, F3, R1, R2, R3 or R4. F1, F3 and R1 to R4 must have at least one destinatario; F2 and R5 must have none.
- With IDOtro and CodigoPais ES, the destinatario's IDType must be 03 or 07; for the third party (tercero) and the issuer block, 07 ("no censado") is not accepted.
- Northern Ireland and the UK: for operations from 1 February 2021 the number must start with
XI; before 2021 it must start withGB, and in January 2021 either prefix is accepted. The operation date is FechaOperacion, or FechaExpedicionFactura if no operation date is given.
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)
| Prefix | Country | Characters after the prefix |
|---|---|---|
DE | Germany | 9 digits |
AT | Austria | 9 letters or digits |
BE | Belgium | 10 digits |
CY | Cyprus | 9 letters or digits |
CZ | Czechia | 8 or 9 or 10 digits |
HR | Croatia | 11 digits |
DK | Denmark | 8 digits |
SK | Slovakia | 10 digits |
SI | Slovenia | 8 digits |
EE | Estonia | 9 digits |
FI | Finland | 8 digits |
FR | France | 11 letters or digits |
EL | Greece | 9 digits |
XI | Northern Ireland | 5 or 9 or 12 letters or digits |
NL | Netherlands | 12 letters or digits |
HU | Hungary | 8 digits |
IT | Italy | 11 digits |
IE | Ireland | 8 or 9 letters or digits |
LV | Latvia | 11 digits |
LT | Lithuania | 9 or 12 digits |
LU | Luxembourg | 8 digits |
MT | Malta | 8 digits |
PL | Poland | 10 digits |
PT | Portugal | 9 digits |
SE | Sweden | 12 digits |
BG | Bulgaria | 9 or 10 digits |
RO | Romania | 2 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
- Spain B2B e-invoicing and VERI*FACTU dates
- VIES error codes explained
- EU VAT number validation API
- Bulk VAT checker
Facts checked 2026-10-27. W System is the maker of this product. Not affiliated with the European Commission. Not legal or tax advice.