{"id":"eu-vat-id-validate","version":"1.0.0","description":"Detect the country from an EU/XI VAT id prefix and validate its format and, where defined, national checksum.","supported_operations":["validate an eu vat number","check a german ust-idnr checksum","is this a real italian partita iva","detect the country from a vat id prefix","validate a northern ireland xi vat number","check a dutch btw sole proprietor id format","בדיקת מספר עוסק אירופאי"],"unsupported_operations":["a live VIES lookup to confirm the number is currently registered","a checksum for the 10 member states this family will not clean-room guess at (BG, CY, CZ, EE, IE, LT, LV, MT, RO, SK are format-only)","a VAT-id prefix outside the 28 recognised EU/XI codes (no generic/unknown-country mode)"],"semantics":["vat_id's first 2 characters (no case folding) must be one of the 28 recognised prefixes (AT, BE, BG, CY, CZ, DE, DK, EE, EL, ES, FI, FR, HR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI, SK, XI), else {valid:false, reason:'unknown_prefix'} with country/prefix/number all null.","When country is supplied and disagrees with the detected prefix, {valid:false, reason:\"country_mismatch\"} is returned without evaluating the country’s own rules; the output’s country/prefix always report what was detected from vat_id, never the caller’s country argument.","Once the prefix is recognised (and country, if given, agrees), problems with number are reported in order: wrong_length, invalid_character, invalid_component, checksum_mismatch -- never thrown.","checksum is ’verified’ for AT, BE, DE, DK, EL, FI, FR, HR, HU, IT, LU, NL, PL, PT, SE, SI, XI, and for ES’s natural-person NIF/NIE branch; it is ’not_defined’ (format-only) for BG, CY, CZ, EE, IE, LT, LV, MT, RO, SK and ES’s CIF (legal-entity) branch, per the documented historical/algorithmic reasons in this tool’s spec. IE now matches a shape regex covering its pre-2013, 2013+ and old-style letter/symbol formats, but its check character is still not verified.","NL: 9-digit block then the literal letter ‘B’ then 2 digits; checksum ‘verified’: valid if EITHER the 9-digit block passes the elfproef (weights [9,8,7,6,5,4,3,2,-1], sum mod 11 == 0, the RSIN/BSN-derived legal-entity form) OR ISO/IEC 7064 MOD 97-10 over ‘NL’+number leaves remainder 1 (the sole-proprietor form issued since 2020-01-01); neither passing is checksum_mismatch. SI: 8 digits, leading digit not ‘0’ (invalid_component); weights [8,7,6,5,4,3,2] over the first 7 digits, a remainder of 0 has no valid check digit (checksum_mismatch outright), remainder 1 maps to check digit 0, otherwise expected = 11 - remainder.","DE and HR reuse the ISO/IEC 7064 MOD 11-10 recurrence (as in checkdigit-compute’s iso7064-mod11-10 preset); IT and the first 10 digits of SE reuse the standard Luhn algorithm; AT uses its own Luhn-derived formula (checksum over 7 digits, then (6 - sum) mod 10).","normalized is always vat_id unchanged; number is vat_id with the 2-character prefix removed, unchanged (no separator stripping -- callers submit the compact form). data_version is always \"eu-vat-prefixes-2026-09-28\".","Pure integer and table-lookup arithmetic; no locale, clock, or randomness; this tool never calls VIES or any other network service; identical output across runs for the same input."],"limits":{"max_vat_id_bytes":14},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["vat_id"],"properties":{"vat_id":{"type":"string","minLength":3,"maxLength":14},"country":{"type":"string","pattern":"^[A-Z]{2}$"}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","country","prefix","number","normalized","checksum","data_version"],"properties":{"valid":{"type":"boolean"},"reason":{"type":["string","null"],"enum":[null,"unknown_prefix","country_mismatch","wrong_length","invalid_character","invalid_component","checksum_mismatch"]},"country":{"type":["string","null"],"pattern":"^[A-Z]{2}$"},"prefix":{"type":["string","null"],"pattern":"^[A-Z]{2}$"},"number":{"type":["string","null"],"minLength":1,"maxLength":12},"normalized":{"type":"string","minLength":3,"maxLength":14},"checksum":{"type":"string","enum":["verified","not_defined"]},"data_version":{"type":"string","const":"eu-vat-prefixes-2026-09-28"}}},"examples":[{"input":{"vat_id":"DE811569869"},"output":{"valid":true,"reason":null,"country":"DE","prefix":"DE","number":"811569869","normalized":"DE811569869","checksum":"verified","data_version":"eu-vat-prefixes-2026-09-28"}},{"input":{"vat_id":"XX123456789"},"output":{"valid":false,"reason":"unknown_prefix","country":null,"prefix":null,"number":null,"normalized":"XX123456789","checksum":"not_defined","data_version":"eu-vat-prefixes-2026-09-28"}},{"input":{"vat_id":"DE811569869","country":"FR"},"output":{"valid":false,"reason":"country_mismatch","country":"DE","prefix":"DE","number":"811569869","normalized":"DE811569869","checksum":"not_defined","data_version":"eu-vat-prefixes-2026-09-28"}}],"execute_url":"/v1/tools/eu-vat-id-validate/versions/1.0.0/execute"}