
The vatlayer API offers a streamlined interface for the real-time validation of European VAT numbers. It can efficiently validate large series of VAT numbers and various features. In this article, you will find about how to validate VAT numbers with our VAT number lookup API.
Table of Contents
What Is vatlayer?
vatlayer is free and instant VAT number validation & EU VAT Rates secure API – for Developers and Businesses.
It is one of the most reliable up-to-date EU VAT rates, number validation & company data sourced from the European Commission’s databases.
Why Should You Select vatlayer?
vatlayer is one of the advanced services in the market with its cutting-edge features:
- Instantly validate VAT numbers
- Instantly validate company information
- Obtain accurate EU VAT rates
- Perform VAT compliant price calculations
- and more
Moreover, the Free subscription plan comes with a whole stack of features so that you can integrate and check how it goes in your system. Besides, if you need higher request volumes, you can start with startup-friendly subscription plans.
Why Do Ten Thousands Of Developers Trust vatlayer?
Our APIs are built to power critical business processes and flows, so all our APIs are made for use at scale and blazing speeds. These are fundamental features of our vatlayer API.
Moreover, the documentation and demo code showcase all the action features and provide complete documentation and tutorials to get you started.
API results are requested using a transparent and easy-to-understand URL structure and delivered in handy JSON format, making for the highest possible compatibility with your applications, systems, programming languages and frameworks.
- Reliable and up-to-date VAT data
- Standard and reduced VAT rates
- Bank-level security for all queries
How To Start With vatlayer API?
After signing up, every user is assigned a personal API Access Key – a unique “password” provided to access any of the API’s data endpoints.
To authenticate with the vatlayer API, attach your access_key to your preferred Endpoint URL:
1 |
http://apilayer.net/api/validate?access_key=YOUR_ACCESS_KEY |
All vatlayer API data is returned in easily parseable JSON format. Find an example API response below using the validate endpoint to validate a VAT number.
1 2 3 4 5 6 7 8 9 10 |
{ "valid": true, "database": "ok", "format_valid": true, "query": "LU26375245", "country_code": "LU", "vat_number": "26375245", "company_name": "AMAZON EUROPE CORE S.A R.L.", "company_address": "5, RUE PLAETIS L-2338 LUXEMBOURG" } |
How To Integrate API Endpoints?
The vatlayer API offers four primary data endpoints, all of which provide different kinds of services and start with the following Base URL: http://apilayer.net/api/
How To Validate VAT Number?
1 2 3 4 |
// "validate" endpoint http://apilayer.net/api/validate ? access_key = YOUR_ACCESS_KEY & vat_number = VAT_NUMBER |
How To Check VAT Rate For Single EU Member State?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// "rate" endpoint - via country code http://apilayer.net/api/rate ? access_key = YOUR_ACCESS_KEY & country_code = GB // "rate" endpoint - via custom IP address http://apilayer.net/api/rate ? access_key = YOUR_ACCESS_KEY & ip_address = 176.249.153.36 // "rate" endpoint - via client IP address http://apilayer.net/api/rate ? access_key = YOUR_ACCESS_KEY & use_client_ip = 1 |
How To Fetch VAT Rates For All EU Member States?
1 2 3 |
// "rate_list" endpoint http://apilayer.net/api/rate_list ? access_key = YOUR_ACCESS_KEY |
How To Get VAT Rates Via Country Code?
Using the VATLayer API’s rate endpoint, you may request VAT rates for a country of your choice.
Just a quick heads up three different parameters can define the country to obtain VAT rates. In this example, we’ll specify the country by appending the simple 2-letter country_code parameter to the request URL.
1 2 3 |
http://apilayer.net/api/rate ? access_key = YOUR_ACCESS_KEY & country_code = DE |
These are some of the functionalities of the vatlayer API. Here you can check out the complete documentation to learn about the other features and how to use them.
Here is the final demo web app written in PHP:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
// set API Endpoint and Access Key $endpoint = 'validate'; $access_key = 'YOUR_ACCESS_KEY'; // set VAT number $vat_number = 'LU26375245'; // Initialize CURL: $ch = curl_init('http://apilayer.net/api/'.$endpoint.'?access_key='.$access_key.'&vat_number='.$vat_number.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Store the data: $json = curl_exec($ch); curl_close($ch); // Decode JSON response: $validationResult = json_decode($json, true); // Access and use your preferred validation result objects $validationResult['valid']; $validationResult['query']; $validationResult['company_name']; $validationResult['company_address']; |
Be sure to check out the vatlayer web page to learn more about API and get your free API access key!