
VATLayer – VAT number lookup for business customers. VATLayer API is a real-time VAT number checking API for B2B services.
If you manage customer data and if that information is outdated, it costs you money. For instance, if your customer’s VAT number expires you should ask for their new VAT number. Otherwise, the reverse-charge mechanism no longer applies, and you have to start charging VAT at your customer’s local rate.
VATLayer API – is here to help you to automate VAT number validation and lookup for your services. A VAT API is also a great API to pair with a currency conversion api.
And in this demonstration, we will create two different demos to show you how to integrate the VATLayer API into our cross-platform native application using Delphi and web app using Node.js (Express).
Here are our cross-platform app built with Delphi FireMonkey (which supports Android, iOS, macOS, Windows, and Linux) and web app built with Node.js:


Table of Contents
What is VATLayer?
VATLayer is a simple JSON-based RESTful web service that provides fast API enabling you to validate VAT numbers, retrieve all or single EU VAT rates based on IP address or country code, convert prices in compliance with EU VAT rates and types, and more.
Why VATLayer API?
- Simple & Secure API
- Easy on your Budget
- Advanced Features
- Reliable up-to-date EU VAT rates
- Advanced VAT Information
- and more
If you are more interested in learning the whole service before start using it, you can head over and learn more about why VATLayer API is the best!
How to use VATLayer API?
The VAT Layer API offers main 4 main data endpoints.
How to integrate VATLayer API into a native Windows app using Delphi FireMonkey?
RAD Studio provides several tools to swiftly integrate various services, one of them is the REST Debugger. REST Debugger helps to connect any kind of RESTful web service in several steps.

Here you can see you can provide the RESTful web service endpoint and copy configured components to use in Delphi FireMonkey project.
This is our Delphi FireMonkey demo user interface structure.

These are two functions that fetch data based on the VAT number and another one fetches data based on the user IP address.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
procedure TFormVATLayerDelphi.BtnGETSpecificVATRateClick(Sender: TObject); begin RESTClient1.ResetToDefaults; RESTClient1.Accept := 'application/json'; RESTClient1.AcceptCharset := 'UTF-8, *;q=0.8'; RESTClient1.BaseURL := 'http://www.apilayer.net/api/rate'; RESTResponse1.ContentType := 'application/json'; // debug only var UseClientIP := '0'; if ChkBUseClientIPAddress.IsChecked then UseClientIP := '1'; RESTRequest1.Resource := Format('?access_key=%s&use_client_ip=%s&format=%s', [EdtAccKey.Text, UseClientIP, EdtFormat.Text]); RESTRequest1.Execute; Memo1.Text := RESTResponse1.Content; end; procedure TFormVATLayerDelphi.BtnSendRequestClick(Sender: TObject); begin RESTClient1.ResetToDefaults; RESTClient1.Accept := 'application/json'; RESTClient1.AcceptCharset := 'UTF-8, *;q=0.8'; RESTClient1.BaseURL := 'http://www.apilayer.net/api/validate'; RESTResponse1.ContentType := 'application/json'; RESTRequest1.Resource := Format('?access_key=%s&vat_number=%s&format=%s', [EdtAccKey.Text, EdtVatNumber.Text, EdtFormat.Text]); RESTRequest1.Execute; var JSONValue := TJSONObject.ParseJSONValue(RESTResponse1.Content); try if JSONValue is TJSONObject then begin EdtValidVat.Text := JSONValue.GetValue<String>('valid'); EdtValidFormat.Text := JSONValue.GetValue<String>('format_valid'); EdtQuery.Text := JSONValue.GetValue<String>('query'); EdtCountryCode.Text := JSONValue.GetValue<String>('country_code'); EdtResVATNumber.Text := JSONValue.GetValue<String>('vat_number'); EdtCompany.Text := JSONValue.GetValue<String>('company_name'); EdtAddress.Text := JSONValue.GetValue<String>('company_address'); end; finally JSONValue.Free; end; end; |
How to integrate VATLayer API into Node.js (Express) Web App?
As you can see, this is our Node.js (Express) web app structure, and here is our main source code.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
const express = require('express') const vatlookupRouter = express.Router() const axios = require('axios') vatlookupRouter.get('', async(req, res) => { try{ // lookup given VAT number const vat = await axios.get('http://apilayer.net/api/validate?access_key=2eb116f795c84c8e6c5cef74a95a4245&vat_number=LU26375245&format=1') // send json response to embedded js res.render('vatlookup', { vatData : vat.data }) // data is here json } catch (error) { if(error.response) { console.log(error.response.data) } else if(error.request) { console.log(error.request) } else { console.log('Error', error.message) } } }); module.exports = vatlookupRouter |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
<div class="container"> <div class="heading"> <h2>VAT Lookup</h2> </div> <div class="row"> <div class="col-md-6 col-lg-4"> <div class="project-card-no-image"> <h3>Valid Format</h3> <h4> <%- vatData.format_valid %> </h4> </div> </div> <div class="col-md-6 col-lg-4"> <div class="project-card-no-image"> <h3>Query</h3> <h4> <%- vatData.query %> </h4> </div> </div> <div class="col-md-6 col-lg-4"> <div class="project-card-no-image"> <h3>Country Code</h3> <h4> <%- vatData.country_code %> </h4> </div> </div> <div class="col-md-6 col-lg-4"> <div class="project-card-no-image"> <h3>VAT Number</h3> <h4> <%- vatData.vat_number %> </h4> </div> </div> <div class="col-md-6 col-lg-4"> <div class="project-card-no-image"> <h3>Company</h3> <h4> <%- vatData.company_name %> </h4> </div> </div> <div class="col-md-6 col-lg-4"> <div class="project-card-no-image"> <h3>Address</h3> <h4> <%- vatData.company_address %> </h4> <div class="tags"></div> </div> </div> </div> </div> |
The whole project is provided in this repository which also provides how to set up the project environment and run the application in the read me section!
I hope you have enjoyed the demonstration here. Yeah, we have not played with the API so much, but you now have a full vision of the VATLayer API.
Watch the demos in action.
Check out the full source code in this repository.
If you are planning to integrate VAT number lookup into your system, just go with the quick and cost-effective VATLayer API.