EU VAT Number
identity.government.eu_vatEuropean Union Value Added Tax identification number. Format: 2-letter country code prefix followed by 2-12 alphanumeric characters. Each EU member state has its own format rules.
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As VARCHAR | country_code | local_number |
|---|---|---|---|
| DE123456789 | DE123456789 | DE | 123456789 |
| FR12345678901 | FR12345678901 | FR | 12345678901 |
| ATU12345678 | ATU12345678 | AT | U12345678 |
| NL123456789B01 | NL123456789B01 | NL | 123456789B01 |
| GB123456789 | GB123456789 | GB | 123456789 |
Shape
^[A-Z]{2}[0-9A-Za-z+*.]{2,12}$| Value | Length | Shape |
|---|---|---|
| DE123456789 | 11 | matches |
| FR12345678901 | 13 | matches |
| ATU12345678 | 11 | matches |
| NL123456789B01 | 14 | matches |
| GB123456789 | 11 | matches |
| de123456789 | 11 | rejected: lower-cased |
Told apart
Going the other way, this type's own rule accepts 4 of 4 samples of Indian PAN.
Background
Origin
The EU VAT identification number is set out in Council Directive 2006/112/EC of 28 November 2006 on the common system of value added tax.[1] Article 214 of the directive requires Member States to identify certain taxable persons by means of an individual number.[1]
HMRC says businesses trading goods between Northern Ireland and the EU add the XI prefix before their normal 9-digit UK VAT number where appropriate.[2] HMRC also says the XI prefix is not required for services between Northern Ireland and the EU, or within the internal UK market.[2]
Use
Article 226 of the VAT directive lists the supplier's VAT identification number among the details required on an invoice.[1] The customer's VAT identification number is also required on an invoice when the customer is liable for the VAT or receives an intra-Community supply of goods.[1]
Germany writes DE followed by 9 digits.[3] The Netherlands writes NL, 9 digits, the letter B and a 2-digit company index, as in NL999999999B01.[3] In a French number the two characters after FR are a validation key, and either can be a letter.[3] Belgian numbers end in 2 check digits calculated as 97 minus MOD 97.[3]
Sources
Detection notes
Each EU country has specific format rules. DE = 9 digits, FR = 2 chars + 9 digits, AT = U + 8 digits, etc.
Use it
$ finetype infer -i "DE123456789" --mode column
→ identity.government.eu_vat
SELECT ft_infer('DE123456789');
-- → 'identity.government.eu_vat'CAST({col} AS VARCHAR)Schema
https://meridian.online/schemas/identity.government.eu_vat · Frictionless type string
finetype taxonomy identity.government.eu_vat -o json-schema