0

I have been struggling for some time whether there is a way to validate if given tax number is a correct one. I have a form where customers enter their invoice data, but we create the invoice in the system when the payment arrives on our bank account.

That means if the vat id is wrong, Xero will return an error when create an invoice. I would like to validate the tax number on invoice data form, instead.

I have checked the API documentation, but I couldn't find anything there. Am I missing something?

Maciej Gol
  • 15,394
  • 4
  • 33
  • 51

2 Answers2

1

I have an app that sends the contact informatiuon to Xero, and validate the VAT numbers first.

I do this using the VIES VAT SOAP Service.

https://www.programmableweb.com/api/vies-vat http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl

My code is in c#, so I just created a web reference via the wsdl and call it with the countryCode and vatNumber arguments.

sheavens
  • 685
  • 7
  • 14
  • Thanks! Didn't know that VIES exposes an API! I've found a python package in dependencies of VIES API python library called [python-stdnum](https://pypi.org/project/python-stdnum/) that allows for such verification, too. This is very useful! – Maciej Gol Nov 30 '18 at 17:24
0

You can also use https://tin-check.com/en/

They have an API that validate tax number for more than 100 countries https://api.tin-check.com/

Migth be a good alternative solution.

N Martins
  • 1
  • 1