VAT Validation API
The VAT Validation API validates EU VAT numbers against the official EU 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 (a routine occurrence), 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
Applications using this API
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
/v1/vatvalidation GET
https://api.api-ninjas.com/v1/vatvalidation
Validates a VAT number from any of the 27 EU member states or Northern Ireland (XI).
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.
Parameters
vatrequiredThe VAT number to validate, including its 2-letter country prefix (for example
FR40303265045). Spaces, dots, and hyphens are tolerated. 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 VAT number (with country prefix). Forces a live registry check and returns an official
consultation_numberas audit evidence.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object containing 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).countryTwo-letter registry country code. Greece is returned as
EL; Northern Ireland isXI.numberThe national part of the VAT number, without the country prefix.
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).sourceWhere the answer came from:
vies(the official EU registry) orseed(a national open-registry snapshot).nullfor offline format/checksum verdicts.cachedtruewhen the answer was served from the validation cache (for example while a registry is down) rather than a live registry check.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. Note: Germany and Spain suppress this field in the EU registry, so it is
nullfor validDEandESnumbers (themessagefield notes this).company_addresspremium onlyThe registered company address. Suppressed by Germany and Spain in the EU registry, like
company_name.consultation_numberpremium onlyThe official EU consultation number proving this check took place — the audit evidence for zero-rating intra-EU B2B supplies. Returned only on live checks when
requester_vatis supplied;nullon cached answers.messageOptional human-readable note, for example when a registry is temporarily unavailable or when a country suppresses company details.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/vatvalidation?vat=FR40303265045Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
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 EU VAT numbers against the official EU registries, 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 VAT number in therequester_vatparameter and the response includes aconsultation_numberfrom a live registry check. This field is available on paid plans.Which countries does the VAT Validation API support?
All 27 EU member states plus Northern Ireland (XIprefix). Greek numbers are accepted with either theGRor the officialELprefix. United Kingdom, Switzerland, Norway, and Australia coverage is coming soon. For EU VAT rates rather than number validation, see the VAT Rates API.Why do results for German and Spanish VAT numbers have no company name?
Germany and Spain suppress company name and address in the EU registry for privacy reasons, so those fields arenullfor validDEandESnumbers — the API notes this in themessagefield. Registration status, format and checksum validation, and consultation numbers all work normally for both countries.