https://github.com/mattes/vat
EU VAT number validation in Go using VIES SOAP service
https://github.com/mattes/vat
eu go tax vat-number vies-soap-service
Last synced: 21 days ago
JSON representation
EU VAT number validation in Go using VIES SOAP service
- Host: GitHub
- URL: https://github.com/mattes/vat
- Owner: mattes
- License: unlicense
- Created: 2015-03-06T14:49:54.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-06-08T18:03:36.000Z (almost 5 years ago)
- Last Synced: 2025-03-30T21:03:14.548Z (about 2 months ago)
- Topics: eu, go, tax, vat-number, vies-soap-service
- Language: Go
- Homepage: http://ec.europa.eu/taxation_customs/vies/vatRequest.html
- Size: 15.6 KB
- Stars: 26
- Watchers: 2
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang VAT number validation
[](https://travis-ci.org/mattes/vat)
[](https://godoc.org/github.com/mattes/vat)Uses the official [VIES VAT number validation SOAP web service](http://ec.europa.eu/taxation_customs/vies/vatRequest.html?locale=en)
to validate european VAT numbers.Unfortunately their service is super unreliable.
## Install
```
go get -u github.com/mattes/vat
```## Usage with Go
```go
import "github.com/mattes/vat"response, err := vat.CheckVAT("IE6388047V")
if err != nil {
// do sth with err
}
fmt.Println(response.Name, response.Valid)// or ...
valid, err := vat.IsValidVAT("IE6388047V")// increase timeout (default 10 seconds)
vat.Timeout = 10// get VAT rates for EU countries
rate, ok := vat.StandardRate("DE")// get applicable tax and if reverse charge is allowed,
// depending on VAT number and country
// (use at own risk!)
rate, reverseCharge, err := GetApplicableTax("DE", "")
rate, reverseCharge, err := GetApplicableTax("IE", "IE6388047V")
rate, reverseCharge, err := GetApplicableTax("CH", "")
```## Usage via Console
There is a small cli included in this package.
Install with ``go get -u github.com/mattes/vat/vat-check``
```
$ vat-check IE6388047VRequest date: 2015-03-06 00:00:00 +0100 CET
VAT number: 6388047V
Country: IE
Name: GOOGLE IRELAND LIMITED
Address: 3RD FLOOR ,GORDON HOUSE ,BARROW STREET ,DUBLIN 4Success: The VAT number is valid!
```Exit code is 0 if VAT number is valid.