Summary
The object of this rule is the validation of the European VAT Identification Number.
A value added tax identification number or VAT identification number (VAT IN) is an identifier used in many countries, including the countries of the European Union, for value added tax purposes.
Sometimes also known as a VAT registration number, this is the unique number that identifies a taxable person (business) or non-taxable legal entity that is registered for VAT
Need of VAT IN for persons or businesses and information on how to get them and formats is available at the European Commission VAT official page.
Description
-
Format to validate
The full identifier starts with an ISO alpha-2 (2 letters) country code and then has between 2 and 13 characters. The identifiers are composed of numeric digits in most countries, but in some countries they may contain letters.
The rule validates the number in the following formats:
- XXXXXXXXXXXXXXX
- XX XXXXXXXXXXXXX
Validation criteria for VAT IN are based on rules set by the EU’s VIES
Foreign companies that trade with non-enterprises in the EU may have a VAT IN starting with “EU” instead of a country code, e.g. EU826009064.
VAT Identification Number Format by country:
Member State | Structure | Format* |
AT-Austria | ATU99999999 | 1 block of 9 characters |
BE-Belgium | BE0999999999 | 1 block of 10 digits |
BG-Bulgaria | BG999999999 or | 1 block of 9 digits or1 block of 10 digits |
BG9999999999 | ||
CY-Cyprus | CY99999999L | 1 block of 9 characters |
CZ-Czech Republic | CZ99999999 or | 1 block of either 8, 9 or 10 digits |
CZ999999999 or | ||
CZ9999999999 | ||
DE-Germany | DE999999999 | 1 block of 9 digits |
DK-Denmark | DK99 99 99 99 | 4 blocks of 2 digits |
EE-Estonia | EE999999999 | 1 block of 9 digits |
EL-Greece | EL999999999 | 1 block of 9 digits |
ES-Spain | ESX9999999X4 | 1 block of 9 characters |
FI-Finland | FI99999999 | 1 block of 8 digits |
FR-France | FRXX 999999999 | 1 block of 2 characters, 1 block of 9 digits |
GB-United Kingdom | GB999 9999 99 or | 1 block of 3 digits, 1 block of 4 digits and 1 block of 2 digits; or the above followed by a block of 3 digits; or 1 block of 5 characters |
GB999 9999 99 9995 or | ||
GBGD9996 or | ||
GBHA9997 | ||
HR-Croatia | HR99999999999 | 1 block of 11 digits |
HU-Hungary | HU99999999 | 1 block of 8 digits |
IE-Ireland | IE9S99999L | 1 block of 8 characters or 1 block of 9 characters |
IE9999999WI | ||
IT-Italy | IT99999999999 | 1 block of 11 digits |
LT-Lithuania | LT999999999 or | 1 block of 9 digits, or 1 block of 12 digits |
LT999999999999 | ||
LU-Luxembourg | LU99999999 | 1 block of 8 digits |
LV-Latvia | LV99999999999 | 1 block of 11 digits |
MT-Malta | MT99999999 | 1 block of 8 digits |
NL-The Netherlands | NL999999999B998 | 1 block of 12 characters |
PL-Poland | PL9999999999 | 1 block of 10 digits |
PT-Portugal | PT999999999 | 1 block of 9 digits |
RO-Romania | RO999999999 | 1 block of minimum 2 digits and maximum 10 digits |
SE-Sweden | SE999999999999 | 1 block of 12 digits |
SI-Slovenia | SI99999999 | 1 block of 8 digits |
SK-Slovakia | SK9999999999 | 1 block of 10 digits |
Remarks:
*: Format excludes 2 letter alpha prefix
9: A digit
X: A letter or a digit
S: A letter; a digit; “+” or “*”
L: A letter
-
Special Cases
-
- The 1st position following the prefix is always “U”.
- The first digit following the prefix is always zero (‘0’).
- The (new) 10-digit format is the result of adding a leading zero to the (old) 9-digit format.
- The first and last characters may be alpha or numeric; but they may not both be numeric.
- Identifies branch traders.
- Identifies Government Departments.
- Identifies Health Authorities.
- The 10th position following the prefix is always “B”.
- All letters are case sensitive. Please follow the exact syntax of the VAT number shown.
-
What is not validated
This rule will validate only the format but NOT the VALIDITY of the VAT.
Examples
-
Correct
The following strings are validated by the rule:
XX1234567890123
XX 1234567890123
-
Incorrect
The following strings are not validated by the rule:
XX 123 456 789 012 3
XX-1234567890123
XX-123-456-789-012-3
Field mapping
-
VAT identification number (VATIN)
The rule have to be mapped to a FIELD (Labeled in Validator Setup as VAT EU Basic Format Local) in an OBJECT previously configured in your org.
This will be the field where you have the data you want to be validated by the rule
See image below:
This FIELD has to be a TEXT field with at least 16 digits
-
Action Field
If you decide to use the WARNING validation action, (see image below), then you have to map as well other FIELD (Labeled in Validator Setup as Action Field) in the same OBJECT where you have the one validated by the rule.
This will be the field where you will receive the Action Message that you have to define as well.
The Action Field has to be preconfigured in the OBJECT as TEXT with a length long enough to contain the defined Action Message.
When the rule is applied, if the result is not correct, then the Action Field will be written with the Action Message. The record will be saved.
If the result is correct, then the Action Field will be written with the Axy Validator message “VAT is OK”. The record will be saved as well.
If you decide to use the ERROR validation action, (see image below), then you do not need to map other FIELD.
Yet you have to define the Action Message. .
When the rule is applied, if the result is not correct, then the Action Message will be shown as an Axy Validator error message. The record will be not saved.
If the result is correct, then the record will be saved and no error message appears.