https://github.com/cba85/eu-vat-validation
💰 A PHP package to verify the validity of a VAT number issued by any European Union Member State.
https://github.com/cba85/eu-vat-validation
countries php tax vat-number verify vie
Last synced: about 2 months ago
JSON representation
💰 A PHP package to verify the validity of a VAT number issued by any European Union Member State.
- Host: GitHub
- URL: https://github.com/cba85/eu-vat-validation
- Owner: cba85
- License: mit
- Created: 2016-12-19T16:55:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T14:56:14.000Z (over 3 years ago)
- Last Synced: 2025-04-12T07:18:21.540Z (about 2 months ago)
- Topics: countries, php, tax, vat-number, verify, vie
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# European VAT number validation
A PHP package to verify the validity of a VAT number issued by any European Union Member State.
This package is basically calling web service provided by VIES for VAT number validation.
VIES API documentation : http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
This package allows you to :
- validate a VAT number
- retrieve information like the name or the address of the company## What is a VAT number?
A value added tax identification number or VAT identification number (VATIN) is an identifier used in many countries, including the countries of the European Union, for value added tax purposes.
## Installation
Install using Composer :
```
$ composer require cba85/eu-vat-validation dev-master
```You must have PHP with Soap enabled.
## Usage
```php
$vatValidation = new Validation('FR12345678910');/*
* Check VAT
*/
$vat = $vatValidation->checkVat();/*
* Is VAT ID valid ?
*/
$valid = $vatValidation->isValid();
```You'll find more examples in the ``example`` folder.
## Returns
### Check VAT
```php
Array (
[countryCode] => FR
[vatNumber] => 12345678910
[requestDate] => 2016-12-19+01:00
[valid] =>
[name] => ---
[address] => ---
)
```### Check VAT approx.
```php
Array(
[countryCode] => FR
[vatNumber] => 12345678910
[requestDate] => 2016-12-19+01:00
[valid] =>
[traderName] => ---
[traderCompanyType] => ---
[traderAddress] => ---
[requestIdentifier] =>
)
```## Tests
If TVA rates evolve, change the results expected.
```bash
$ ./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/ValidationTest
```