-
-
Save rduque1/c5bd00dce6a640f826e62b64a9dfc58a to your computer and use it in GitHub Desktop.
VAT validation using SOAP service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Replace XXXXXXXXXXXXX with the VAT number | |
| # | |
| # The $valid attribute is in the path `soap:Body / checkVatResponse / valid` | |
| # | |
| # Example: | |
| # | |
| # <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> | |
| # <soap:Body> | |
| # <checkVatResponse xmlns="urn:ec.europa.eu:taxud:vies:services:checkVat:types"> | |
| # | |
| # <countryCode>ES</countryCode> | |
| # <vatNumber>....</vatNumber> | |
| # <requestDate>2015-01-09+01:00</requestDate> | |
| # <valid>true</valid> | |
| # <name>---</name> | |
| # <address>---</address> | |
| # </checkVatResponse> | |
| # </soap:Body> | |
| # </soap:Envelope> | |
| curl http://ec.europa.eu/taxation_customs/vies/services/checkVatService \ | |
| -i -w \\n \ | |
| -H 'SOAPAction: "checkVat"' \ | |
| -H "Content-Type: text/xml;charset=UTF-8" \ | |
| -d '<?xml version="1.0" encoding="UTF-8"?> | |
| <env:Envelope | |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xmlns:tns1="urn:ec.europa.eu:taxud:vies:services:checkVat" | |
| xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" | |
| xmlns:ins0="urn:ec.europa.eu:taxud:vies:services:checkVat:types"> | |
| <env:Body> | |
| <ins0:checkVat> | |
| <ins0:countryCode>ES</ins0:countryCode> | |
| <ins0:vatNumber>XXXXXXXXXXXXX</ins0:vatNumber> | |
| </ins0:checkVat> | |
| </env:Body> | |
| </env:Envelope>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment