Skip to content

Instantly share code, notes, and snippets.

@kgaughan
Created April 14, 2011 10:08
Show Gist options
  • Save kgaughan/919221 to your computer and use it in GitHub Desktop.
Save kgaughan/919221 to your computer and use it in GitHub Desktop.
Checking an EU VAT number using the VIES SOAP interface
from suds.client import Client
client = Client('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl')
# Returns a dict-like object with the fields 'countryCode', 'vatNumber',
# 'requestDate', 'valid' (boolean), 'name', and 'address'.
result = client.service.checkVat('IE', '6390845P')
@xarbit
Copy link

xarbit commented Mar 5, 2019

I was having some issues with suds, so in case someone comes across this, here is my alternative:

    from zeep import Client

    # http://ec.europa.eu/taxation_customs/vies/technicalInformation.html
    client = Client('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl')

    # Returns a dict-like object with the fields 'countryCode', 'vatNumber',
    # 'requestDate', 'valid' (boolean), 'name', and 'address'.
    result = client.service.checkVat(country, number)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment