VAT Validation API
The VAT Validation API validates VAT numbers from the EU, Northern Ireland, Switzerland, and Norway against the official national registries, with instant format and checksum checks, live registry status, company name and address, and audit-ready consultation numbers.
Unlike querying government registries directly, this API always returns an answer: when a national registry is down, you get the last confirmed result with its timestamp instead of an error, and unresolved numbers are automatically re-checked in the background.
For EU VAT tax rates, please use the VAT Rates API.
From 3,757 users
Application used this API in the last 28 days.
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 393ms | 423ms | 471ms | 734ms | 1097ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
https://api.api-ninjas.com/v1/vatvalidation
Validates a VAT number from any of the 27 EU member states, Northern Ireland (XI), Switzerland (CH), or Norway (NO).
Format and checksum validation, registry status, and cached answers are available to all users.
To obtain a consultation_number — the official EU record proving you checked a customer, required as audit evidence when zero-rating intra-EU B2B sales — pass your own company's VAT number in the requester_vat parameter. Consultation numbers are issued for EU and Northern Ireland VAT numbers.
Parameters
vatrequiredThe VAT number to validate, including its country prefix (for example
FR40303265045,CHE-116.281.710 MWST, orNO923609016MVA). Spaces, dots, and hyphens are tolerated, and the SwissMWST/TVA/IVAand NorwegianMVAsuffixes are optional. The prefix may be omitted when thecountryparameter is set.countryoptionalTwo-letter country code (for example
DE). Only needed when thevatparameter has no country prefix. Greece is accepted as eitherGRor the officialEL.requester_vatoptional Premium onlyYour own company's EU or Northern Ireland VAT number (with country prefix). Forces a live registry check and returns an official
consultation_numberas audit evidence. Ignored for Swiss and Norwegian numbers, whose registries do not issue consultation numbers.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
The /v1/vatvalidation endpoint returns a JSON object with the following fields, or an error if the request parameters are invalid. Registry downtime never produces an error — see status and cached.
vatThe normalized VAT number including its country prefix (for example
FR40303265045,CHE116281710, orNO923609016MVA).countryTwo-letter registry country code. Greece is returned as
EL; Northern Ireland isXI; Switzerland isCH; Norway isNO.numberThe national part of the VAT number, without the country prefix or the Swiss and Norwegian suffixes.
format_validWhether the number matches the country's VAT number format. Checked instantly offline — catches typos without a registry round-trip.
checksum_validWhether the number passes the country's checksum algorithm. Also checked instantly offline; a failed checksum means the number cannot be valid.
statusThe validation verdict:
valid(the number is registered for VAT),invalid(failed format/checksum validation, or the registry confirmed it is not registered), orunknown(the number is well-formed but the registry is temporarily unreachable and no cached answer exists — it will be re-checked automatically, so query again shortly).sourceThe official registry that confirmed the answer:
vies(the EU's VIES system, for EU and Northern Ireland numbers),uid_ch(the Swiss UID register),brreg(the Norwegian Brønnøysund Register Centre), orseed(a result loaded from a national register's published registration data).nullwhen the number failed format or checksum validation or no registry answer exists yet.cachedtruewhen the answer came from a confirmed registry check made in the last 30 days, or — while a registry is down — from the last confirmed check, rather than a live registry call. Passrequester_vatto force a live check of an EU or Northern Ireland number.checked_atUTC timestamp of the registry answer (ISO 8601). For cached results, the time the number was last confirmed.
company_namePremium onlyThe registered company name.
company_addressPremium onlyThe registered company address.
consultation_numberPremium onlyThe official EU consultation number proving this check took place — the audit evidence for zero-rating intra-EU B2B supplies. Returned only for a live check of an EU or Northern Ireland number made with
requester_vat; otherwisenull.messageHuman-readable note about the result, for example why a number is invalid (not registered for VAT, deleted, or a member of a Swiss VAT group), that a registry is temporarily unavailable, or that the registry does not disclose company name and address (for example, for German numbers). Only present when there is something to note.
Live Demo
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/vatvalidation?vat=FR40303265045" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
Frequently Asked Questions
Can I use the VAT Validation API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the VAT Validation API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the VAT Validation API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the VAT Validation API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.How does the VAT Validation API check registration status?
The API validates VAT numbers against the official registries — the EU's VIES system for EU and Northern Ireland numbers, the Swiss UID register, and the Norwegian Brønnøysund Register Centre — but absorbs their unreliability: instant offline format and checksum checks, cached last-known-good answers when a national registry is down, and automatic background re-checking. You get one clean REST call with an API key instead of government endpoints, per-country outages, and error-code folklore.What happens when a national registry is down?
You always get an answer, never a registry error. Thestatusfield is three-state:valid,invalid, orunknown. If a registry is unreachable, the API serves the last confirmed result withcached: trueand itschecked_attimestamp; if the number has never been seen, it returnsunknownand keeps re-checking in the background so a follow-up query resolves. See the error codes reference — downtime is never a 4xx or 5xx.What is a consultation number and how do I get one?
A consultation number is the EU's official proof that you checked a customer's VAT number on a given date — the evidence tax auditors ask for when you zero-rate intra-EU B2B sales. Pass your own EU or Northern Ireland VAT number in therequester_vatparameter and the response includes aconsultation_numberfrom a live registry check. Consultation numbers exist for EU and Northern Ireland numbers only; the Swiss and Norwegian registries do not issue them. This field is available on paid plans.Which countries does the VAT Validation API support?
All 27 EU member states, Northern Ireland (XIprefix), Switzerland (CHEnumbers, with or without theMWST,TVA, orIVAsuffix), and Norway (NOprefix, with or without theMVAsuffix). Greek numbers are accepted with either theGRor the officialELprefix. For EU VAT rates rather than number validation, see the VAT Rates API.Do results include the company name and address for every country?
Yes, for every supported country except Germany and Spain, which do not publish company name and address through the EU registry. For validDEandESnumbers those fields arenulland the API notes this in themessagefield. Registration status, format and checksum validation, and consultation numbers all work normally for both countries.
Explore API integration use cases for recommended APIs and workflow examples.