One letter/digit, 7 digits, then one check character
| VIES prefix | ES |
|---|---|
| Structure | One letter/digit, 7 digits, then one check character |
| Pattern | ^([0-9XYZ])(\d{7})([A-Z])$|^([A-HJ-NP-Z])(\d{7})([0-9A-J])$ |
| Company name via VIES | Never |
| Address via VIES | Never |
| Verified example | A46103834 |
Two families. Natural persons (NIF): optional X/Y/Z prefix (stands for 0/1/2) + 7 digits + letter = 'TRWAGMYFPDXBNJZSQVHLCKE'[number mod 23]. Organisations: type letter + 7 digits + check character = (10 - alternating-weight sum mod 10) mod 10, as a digit or the letter 'JABCDEFGHI'[n]. Both fully enforced.
Vatline enforces this check locally. A number that fails it is rejected before any call is made to VIES — it protects your quota and keeps the Commission's service healthy.
Expect empty fields. Spain never discloses the company name and the address through VIES. Vatline reports this with name_available and address_available, so your code can tell a normal null from a failure — this is where most integrations break silently.
Known-good value: A46103834.