How to Validate a VAT Code in Node.JS

In global business travel and transactions, particularly within the European Union, value-added tax (VAT) regulations must always be considered. In order to trade within the EU, businesses must be registered with a VAT number on the VAT Information Exchange System. To internally verify VAT registration, this API will allow your systems to parse and validate input VAT numbers and return contact information for the business to which it applies. Possible country codes include Austria (AT), Belgium (BE), Bulgaria (BG), Cyprus (CY), Czech Republic (CZ), Germany (DE), Denmark (DK), Estonia (EE), Greece (EL), Spain (ES), Finland (FI), France (FR), United Kingdom (GB), Croatia (HR), Hungary (HU), Ireland (IE), Italy (IT), Lithuania (LT), Luxembourg (LU), Latvia (LV), Malta (MT), The Netherlands (NL), Poland (PL), Portugal (PT), Romania (RO), Sweden (SE), Slovenia (SI), Slovakia (SK).

Image for post
Image for post

To start our process, run this command to install the SDK:

npm install cloudmersive-validate-api-client –save

Or, add this snippet to your package.json:

"dependencies": {
"cloudmersive-validate-api-client": "^1.2.4"
}

Then, we can call our function, VatVatLookup:

var CloudmersiveValidateApiClient = require('cloudmersive-validate-api-client');
var defaultClient = CloudmersiveValidateApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveValidateApiClient.VatApi();var input = new CloudmersiveValidateApiClient.VatLookupRequest(); // VatLookupRequest | Input VAT codevar callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.vatVatLookup(input, callback);

Now, you can quickly and easily verify VAT registration to keep your business running smoothly. To access your API Key, which allows up to 800 free monthly calls across our library of APIs, visit the Cloudmersive website.

Written by

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store