https://github.com/dmt-software/eu-vat-validation
A PHP implementation of the VIES Vat validation service
https://github.com/dmt-software/eu-vat-validation
vat-service
Last synced: 3 months ago
JSON representation
A PHP implementation of the VIES Vat validation service
- Host: GitHub
- URL: https://github.com/dmt-software/eu-vat-validation
- Owner: dmt-software
- License: mit
- Created: 2018-11-11T12:46:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-11-01T14:56:51.000Z (6 months ago)
- Last Synced: 2025-11-01T16:20:18.442Z (6 months ago)
- Topics: vat-service
- Language: PHP
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# VatValidation Client
[](https://travis-ci.org/dmt-software/eu-vat-validation)
[](https://scrutinizer-ci.com/g/dmt-software/eu-vat-validation/?branch=master)
[](https://scrutinizer-ci.com/g/dmt-software/eu-vat-validation/?branch=master)
> This package contains a client to consume the EU VIES Vat soap-service.
>
> Please keep in mind that there is a [disclaimer](http://ec.europa.eu/taxation_customs/vies/disclaimer.html) for using
> the VAT service. This also applies to using this package.
## Install
`composer require dmt-software/eu-vat-validation`
## Usage
```php
setCountryCode('NL');
$request->setVatNumber('804888644B01');
/** @var ClientInterface $client */
/** @var RequestFactoryInterface $requestFactory */
$client = ClientBuilder::create($client, $requestFactory)->build();
/** @var CheckVatResponse $response */
$response = $client->execute($request);
if ($response->isValid()) {
// some business logic ...
}
} catch (ValidationException $exception) {
// input was incorrect
foreach ($exception->getViolations() as $violation) {
print $violation->getMessage();
}
} catch (SoapFaultException $exception) {
// service returned an error
print $exception->getMessage();
}
```
## Further reading
* [VIES VAT number validation](http://ec.europa.eu/taxation_customs/vies/)