prometee/vies-client

European VAT Information Exchange System SOAP client

Maintainers

👁 Prometee

Package info

github.com/Prometee/VIESClient

pkg:composer/prometee/vies-client

Statistics

Installs: 56 950

Dependents: 1

Suggesters: 0

Stars: 5

Open Issues: 1

v1.0.8 2025-02-26 17:25 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 4413f51551667a3f76f07b1842608d5884cbd86b

  • Francis HILAIRE <prometee.woop@gmail.com>

README

👁 Latest Version on Packagist
👁 Build Status
👁 Quality Score

European VAT Information Exchange System SOAP client

This library is designed to handle validation trough VIES Soap WebService.

See https://ec.europa.eu/taxation_customs/vies/ for more information.

Installation

Install using Composer :

$ composer require prometee/vies-client

Usage

$loader = require_once( __DIR__.'/vendor/autoload.php');

use Prometee\VIESClient\Soap\Client\DeferredViesSoapClient;
use Prometee\VIESClient\Soap\Client\ViesSoapClient;
use Prometee\VIESClient\Soap\Factory\ViesSoapClientFactory;
use Prometee\VIESClient\Helper\ViesHelper;

// Use the Deferred client to avoid getting error
// when the WSDL file is not accessible
$viesSoapClientFactory = ViesSoapClientFactory(ViesSoapClient::class);
$viesSoapClient = new DeferredViesSoapClient($viesSoapClientFactory);

$viesHelper = new ViesHelper($viesSoapClient);
$viesHelper->isValid('FR12345678987');

// Should print:
// 0: CHECK_STATUS_INVALID => Format is not valid and the webservice is not reachable)
// 1: CHECK_STATUS_INVALID_WEBSERVICE => Format is not valid according to the webservice
// 2: CHECK_STATUS_VALID_FORMAT => Format is valid but the webservice is not reachable
// 3: CHECK_STATUS_VALID_WEBSERVICE => Format is valid and the VAT number exists
print_r($viesHelper->isValid('FR12345678987'));