Skip to content

Client library for the VIES/EU web service.

License

Notifications You must be signed in to change notification settings

evertharmeling/vat-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VATClient

Latest Stable Version Build Status

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 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.

$client = new VIESApi\Client\Client(new GuzzleHttp\Client(), VIESApi\Parser\VATParser());

try {
    $taxableObject = $client->getInfo('<VATNumber>');
    
    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