viavario / vies
PHP client for the EU VAT Information Exchange Service (VIES): validate VAT numbers and fetch trader information over SOAP.
Requires
- php: >=5.4
- ext-soap: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-01 13:29:27 UTC
README
The Viavario\Vies\VIES class allows you to validate a European VAT number and retrieve address information from the VAT Information Exchange Service.
REQUIREMENTS
- PHP 5.4 - 8.5
- SOAP extension (
ext-soap)
INSTALLATION
Install with Composer:
composer require viavario/vies
Composer's autoloader will make the Viavario\Vies\VIES class available automatically. If you can't use Composer, you can instead include the class file directly:
require 'src/VIES.php';
use Viavario\Vies\VIES;
Old, unnamespaced usage
Earlier versions of this package exposed a global VIES class. If your project still does require 'services/VIES.php'; new VIES();, that continues to work unchanged — services/VIES.php loads the namespaced class and aliases it to the old global name. New code should use Viavario\Vies\VIES via Composer instead.
USAGE
use Viavario\Vies\VIES;
$vies = new VIES();
$valid = $vies->checkVAT('BE 0883.923.584'); // true or false
$info = $vies->getInfo('BE 0883.923.584'); // object with information, or false
The constructor accepts an optional array of SoapClient options, which are merged over the class defaults (exceptions enabled, WSDL caching disabled, a 10 second connection timeout):
$vies = new VIES(array('connection_timeout' => 5));