https://github.com/evertharmeling/vat-client
Client library for the VIES/EU web service.
https://github.com/evertharmeling/vat-client
btw library php php7 vat-number vat-validation vies
Last synced: about 2 months ago
JSON representation
Client library for the VIES/EU web service.
- Host: GitHub
- URL: https://github.com/evertharmeling/vat-client
- Owner: evertharmeling
- License: mit
- Created: 2017-06-09T07:37:04.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-17T08:49:28.000Z (over 3 years ago)
- Last Synced: 2025-03-24T14:41:48.814Z (2 months ago)
- Topics: btw, library, php, php7, vat-number, vat-validation, vies
- Language: PHP
- Size: 17.6 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
VATClient
===================[](https://packagist.org/packages/evertharmeling/vat-client)
[](https://travis-ci.org/evertharmeling/vat-client)This libray supports validating a vat number and getting the info about a taxable object. The library uses the `http://www.controleerbtwnummer.nl/` API to retrieve the info and validation.
The `http://www.controleerbtwnummer.nl/` API relies on the [VIES/EU](http://ec.europa.eu/taxation_customs/vies/?locale=en) service and thus supports VAT numbers from all EU-countries.## Installation
`composer require evertharmeling/vat-client`
## Usage
It's required to use a PSR-7 supported HTTPClient like `guzzle` (^6.0) to inject in the `Client`.
```php
$client = new VIESApi\Client\Client(new GuzzleHttp\Client(), VIESApi\Parser\VATParser());try {
$taxableObject = $client->getInfo('');
var_dump($taxableObject);
catch (TaxableObjectNotFoundException $e) {
// VAT number not found
}
```## Roadmap
- Formatter, add formatter who according to the regexes defined in the validator, formats the VAT number