This service provides a web developer friendly JSON API, making it simple to perform European VAT number validation.
Companies making B2B transactions need to validate their customers' VAT numbers, for tax purposes. European Commission therefore operates a service that allows for validating VAT numbers of European companies. This system is called the VAT Information Exchange System (VIES).
VIES has a free web form (for manual VAT validation) and a SOAP service, which makes it possible to make automated requests for validating VAT numbers.
SOAP services are somewhat tedious and complicated to deal with for modern web developers, and most would prefer to work with a JSON API instead.
Therefore I have built this easy to use JSON API, which has been running for years, as a stable and reliable gateway to VIES.
The JSON API is available as an inexpensive service for everybody to use.
The API is quite simple: Send an HTTP request to http://nephics.com/euvat with query parameters key and vat, and you will receive a JSON encoded reply containing the response from VIES.
The API gives you the choice to either wait for the VAT response or to get an asynchronous callback to your server, when the response is available from VIES.
The first option is great for front-end code (running in the browser) or for normal server-side page request handling, where you don't have the option or infrastructure for receiving a callback.
The second (async) option is better for a server-side VAT lookup during payment processing, or when you are running an async web server like Node.js or Tornado.
The async option has a major advantage, namely that the callback to your server will not happen before the VAT response is ready from VIES. If VIES is down or not responding, the API server will wait for VIES to get back online, before retrying the request and making the callback to your server.
It happens regularly that VIES is down, though often for shorter periods. Hence, the async option provides a much higher certainty for getting the VAT response from VIES instead of an error message.
Send an HTTP GET request to http://nephics.com/euvat with query parameters key and vat, and you will receive a JSON encoded reply containing the response from VIES.
You can (optionally) include the jsonp query parameter to receive a JSONP response, i.e., a response with content type application/javascript performing a custom callback with the results.
Send an HTTP POST request to http://nephics.com/euvat with query parameters key, vat and url, and the specified URL will receive an HTTP POST request with the JSON encoded response from VIES.
Please note: The url query parameter has to be urlencoded, like url=http%3A%2F%2Fexample.com%2F for the URL http://example.com/
Send an HTTP GET request to the URL: http://nephics.com/euvat?key=961b2f0b&vat=SE556785615701
The following response is returned (formatted for readability):
{
"name": "Nephics AB",
"countryCode": "SE",
"vatNumber": "556785615701",
"valid": true,
"requestDate": "2013-04-17",
"address": "LARS OLS V\u00c4G 9 \n218 51 KLAGSHAMN"
}
If the VAT number is invalid the response will contain valid = false, as seen here, trying to validate VAT number "GB0000000":
{
"valid": false,
"requestDate": "2013-04-17",
"countryCode": "GB",
"vatNumber": "0000000"
}
If the VIES service is down, an error response is returned. This will have an error key with the error description:
{"error": "Member State service unavailable."}
Send an HTTP GET request to the URL: http://nephics.com/euvat?key=961b2f0b&vat=SE556785615701&jsonp=myfunc
Response (formatted for readability):
myfunc({"name": "Nephics AB", "countryCode": "SE",
"vatNumber": "556785615701", "valid": true,
"requestDate": "2013-04-17",
"address": "LARS OLS V\u00c4G 9 \n218 51 KLAGSHAMN"})
The remaining credit count for an access key is returned when only the key query parameter is given:
http://nephics.com/euvat?key=961b2f0b
Response:
{"credits": 8012}
The European VAT numbers that can be validated using this API starts with one of these two letter country codes:
countries = {
'AT': 'Austria',
'BE': 'Belgium',
'BG': 'Bulgaria',
'CY': 'Cyprus',
'CZ': 'Czech Republic',
'DE': 'Germany',
'DK': 'Denmark',
'EE': 'Estonia',
'EL': 'Greece',
'ES': 'Spain',
'FI': 'Finland',
'FR': 'France',
'GB': 'United Kingdom',
'HU': 'Hungary',
'IE': 'Ireland',
'IT': 'Italy',
'LT': 'Lithuania',
'LU': 'Luxembourg',
'LV': 'Latvia',
'MT': 'Malta',
'NL': 'Netherlands',
'PL': 'Poland',
'PT': 'Portugal',
'RO': 'Romania',
'SE': 'Sweden',
'SI': 'Slovenia',
'SK': 'Slovakia'
}
You can get access to use this service for your own apps. The price is €0.01 EUR pr request using pre-payed credits, with volume discounts.
Choose the desired number of requests credits and click the Buy Now button. After successful payment you will receive an email with the API access key and instructions for getting started.
No, it is rather unlikely that the same VAT number is validated more than once (within a resonable time horizon). Therefore, all requests are sent to VIES using the SOAP bridge, nothing is cached.
For each request you make to the API, where the server sends a non-error response, your access key will be deducted one credit. Hence, credits are also spent when checking invalid VAT numbers.
Credits are not spent when the Commission's SOAP API is not available, in which case this service responds with an error message (or, with the async option, the API waits for VIES to get back online).
You can buy additional request credits at any time and have them associated with your existing API access key. Just enter the existing access key in the text box before clicking Buy Now.
You can use the European Comission's VIES web interface and SOAP service for free, see links above.
VIES is critical for verifying financial transactions between businesses. The JSON API made available with this service provides real value to businesses in the form of ease of use and simplicity.
You paying a small amount for using the service makes it possible for me to spend time improving this service, making it highly available, provide support and ensure the continuity of the service.
The service includes free email support. Email your questions to jacob@nephics.com and I will get back to you in a jiffy.