EU VAT Number Validator

This is a free service to validate an EU VAT number.

UPDATE:

There has been some problems lately where the service has reported that a given VAT Number is invalid when it was in fact valid. It seems the EU VIES webservice changed a bit. I've updated to accommodate this.

Also please note that the "member-state-unavailable" error is not an error with vatid.eu but happens when VIES for a given member state is unavailable. Unfortunately this happens rather often. Your best bet is to try again later.

Jan 24 2012

All registered companies within the EU have a VAT number assigned by the local government.

In order to sell goods and services exempt of VAT within the EU to registered companies you must ensure that the buyer has a valid VAT number.

In order to check this the EU provides a service to validate VAT numbers. This service, however, is either a form-based webpage or a SOAP web-service. No RESTful webservice is provided.

Therefore I have made this small webservice to accommodate users who prefer RESTful webservices.

Usage

The web service will only reply in XML. This might change in the future though.

GET http://vatid.eu/check/<country_code>/<vat_number>

In order to obtain the request_identifier you must also provide the following parameters.

GET http://vatid.eu/check/<country_code>/<vat_number>/<requester_country_code>/<requester_vat_number>

Attributes:

Optional Attributes:

Example request and response without documentation id:
Request:
GET http://vatid.eu/check/DK/30505166

Response:		  
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <country-code>DK</country-code>
  <vat-number>30505166</vat-number>
  <valid>true</valid>
  <name>JUSTABOUTIT APS</name>
  <address>
    GAMMELTORV 8 2 
    1457 KØBENHAVN K
  </address>
<response>

NB! Please note that <address> and <name> might not always be present! This depends whether the member country (country code) supplies this information.

Example request and response with documentation id:
Request:
GET http://vatid.eu/check/DK/30505166/DK/30505166

Response:		  
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <country-code>DK</country-code>
  <vat-number>30505166</vat-number>
  <valid>true</valid>
  <name>JUSTABOUTIT APS</name>
  <address>
    GAMMELTORV 8 2 
    1457 KØBENHAVN K
  </address>
  <request-date>2011-02-28+01:00</request-date>
  <request-identifier>WAPIAAAAS5s4vZIa</request-identifier>
<response>

The request-identifier Documentation ID

If you specify your own country and VAT number the response will contain the elements request-date and request-identifier.

You can use this information as documentation for your inquiry to the VIES system.

Country Codes

The following are valid country codes.

Error handling

If the request fails for some reason an XML error response will be returned.

The error will always be of the following format.

<?xml version="1.0" encoding="UTF-8"?>
<error>
  <code>invalid-input</code>
  <text>Cannot process this request. Please check your input parameters.</text>
</error>

The following codes exist and they will all return a text description of the error.

References

Contact

This service is hosted on a free Heroku account.

If you have any questions you can contact me at:

E-mail: mortenmoellerriis _at_ gmail.com

Twitter: mmriis