Skip to content

VAT_VALID

Info

New in Atfinity 17.

Description

VAT_VALID checks whether a string is a valid VATIN (Value Added Tax identification number). The number must include its country prefix (e.g. DE, GB, CHE); the correct country-specific format and checksum are selected from that prefix and verified. It does not verify that the VAT number is actually registered.

Switzerland is supported, but a Swiss VAT number must include its language suffix — MWST, TVA, IVA, or TPV — as it appears on official documents.

Syntax

VAT_VALID(vat)

Returns: true if the VAT number is structurally valid, false if not, unknown if the argument is not a string.

Example

VAT_VALID('DE136695976')

Returns true — valid German VAT number.

VAT_VALID('FR 40 303 265 045')

Returns true — valid French VAT number (spaces are tolerated).

VAT_VALID('GB980780684')

Returns true — valid United Kingdom VAT number.

VAT_VALID('CHE-116.281.710 MWST')

Returns true — valid Swiss VAT number (note the required MWST suffix).

VAT_VALID('FR 40 303 265 040')

Returns false — the checksum does not match.