PHPackages                             wdo/vatidverify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. wdo/vatidverify

ActiveLibrary

wdo/vatidverify
===============

A PHP library for validation of VAT identification numbers and detailed information

v1.0.3(1y ago)013PHPPHP 8.\*

Since Aug 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/RE-INvent-Retail/vatidverify)[ Packagist](https://packagist.org/packages/wdo/vatidverify)[ RSS](/packages/wdo-vatidverify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

VatIdVerify
===========

[](#vatidverify)

Component using the European Commission (EC) VAT Information Exchange System (VIES) and XML RPC API (EVatR) provided by German Federal Central Tax Office (GFCTO) to verify and validate VAT registration numbers in the EU, using PHP.

More information on EVatR API at the [GFCTO website](https://evatr.bff-online.de/eVatR/xmlrpc/) (german version) and on VIES APIs at the [EC website](https://ec.europa.eu/taxation_customs/vies/#/technical-information).

Requirements
------------

[](#requirements)

- PHP 8.0+
- Guzzle
- Phpxmlrpc
- Extension: soap
- Extension: simplexml

Installation
------------

[](#installation)

The library can be installed with [Composer](http://getcomposer.org) by adding it as a dependency to your composer.json file.

Via the command line run: `composer require wdo/vatidverify`

Here is a minimal example of a composer.json file after installation:

```
{
    "require": {
        "wdo/vatidverify": "^1.0"
    }
}
```

Usage
-----

[](#usage)

To use the vat validation create the VatValidate instance with appropriate provider, default is at the VIES SOAP provider. Call the constants from VatValidate to use any other provider like in the example:

```
$vatValidate = new \VatValidate\VatValidate(\VatValidate\VatValidate::PROVIDER_VIES_REST);
```

Following methods are provided for the instance:

- `simpleValidate`: Performs a validation for a given vat id. Only `EVatR` requires requester vat id. Can return either a boolean or a whole response object. You can skip pre-check of vat id over regex if applicable, but it is not recommended.
- `qualifiedValidation`: Performs qualified validation, where the name and address of the company is also checked. Returns response object. You can skip pre-check of vat id over regex if applicable, but it is not recommended. Note: only `EVatR` provider can do a sufficient qualified validation as of now.
- `setService`: Sets whether a test service should be used. Only viable for `VIES` providers.
- `getViesCountryAvailability`: Gets all available countries and their connectivity for `VIES` providers. Example using simple validate with EVatR provider and return a response object:

```
$vatValidate = new \VatValidate\VatValidate(\VatValidate\VatValidate::PROVIDER_EVATR);
$response = $vatValidate->simpleValidate('DE123456789', 'DE987654321', true);
echo $response->isValid();
echo $response->getArray();
```

### Providers

[](#providers)

#### VIES SOAP and VIES REST

[](#vies-soap-and-vies-rest)

VIES SOAP and VIES REST are very similar in regard of the required values and request behaviour. Both of them do not require requester vat id to validate.

The two VIES providers may also not be available in some countries on certain times of day. For example, among them is germany not available around 11 pm till 1:30 am daily. More details for it [here](https://ec.europa.eu/taxation_customs/vies/#/help). It is also possible that qualified validation may not be available for some countries. Germany is among those countries. Some countries require company type for the qualified validation. You can look what can be added here: [https://ec.europa.eu/taxation\_customs/vies/#/faq#Q25](https://ec.europa.eu/taxation_customs/vies/#/faq#Q25).

For testing purposes you can use test service with predetermined vat ids and address (details on the VIES website). For that you need to deactivate the pre-check of the vat id. Example:

```
$vatValidate = new \VatValidate\VatValidate(\VatValidate\VatValidate::PROVIDER_VIES_REST, true);
$valid = $vatValidate->simpleValidate('DE100', '', false, true); // should always return true
```

VIES SOAP is a default provider that is build on top of DragonBe VIES library (see [dependencies](#dependencies)) and has its own pre-check of vat id per country. That means skipping the pre-check is not possible for this provider.

By default, VIES REST uses a pre-check of the vat id from `CountryCheck` helper class.

Unlike SOAP provider, this one can also get the availability of the service and the countries. Over the main class `VatValidate` you can do that with `getViesCountryAvailability()` or call directly the function:

```
$statusArray = (new \VatValidate\Provider\ViesRest())->checkStatus();
```

#### EVatR

[](#evatr)

EVatR has no testing service and must always use real data. Normally the service is always available for both simple and qualified validation. Though there might be maintenance between 11 pm and 5 am. According to GFCTO some requests might take between seconds and minutes, depending on the country request is sent to.

For both validations requester vat id is a mandatory field to be set. For qualified validation postal code and street are optional field values.

### Response

[](#response)

The common response object for all providers is a response type of qualified validation and optionally can be a response type of simple validation. Raw response can be retrieved from this. Unfortunately for VIES SOAP it would NOT be raw data but only return JSON string from a modified array.

Dependencies
------------

[](#dependencies)

VIES SOAP and partially REST request are using [vies library](https://github.com/dragonbe/vies/) by DragonBe. For VIES REST request guzzle is needed. For using EVatR part of this library phpxmlrpc is required.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

4

Last Release

628d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e43c210f88764b3896f6507301cc530c0cd185ef42ccbdbffb8506d7b5e133e?d=identicon)[asdfklgash](/maintainers/asdfklgash)

---

Top Contributors

[![asdfklgash](https://avatars.githubusercontent.com/u/3726443?v=4)](https://github.com/asdfklgash "asdfklgash (1 commits)")

---

Tags

verifyvatverificationtaxviesevatr

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wdo-vatidverify/health.svg)

```
[![Health](https://phpackages.com/badges/wdo-vatidverify/health.svg)](https://phpackages.com/packages/wdo-vatidverify)
```

###  Alternatives

[mpociot/vat-calculator

EU VAT calculation, the way it should be.

1.3k3.9M18](/packages/mpociot-vat-calculator)[ddeboer/vatin

Validate VAT identification numbers

1413.0M9](/packages/ddeboer-vatin)[dragonbe/vies

EU VAT numbers validation using the VIES Service of the European Commission

2794.0M15](/packages/dragonbe-vies)[commerceguys/tax

Tax library with a flexible data model, predefined tax rates, powerful resolving logic.

286763.3k](/packages/commerceguys-tax)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

517.9M7](/packages/avalara-avataxclient)[ph-7/eu-vat-validator

A simple and clean PHP class that validates EU VAT numbers against the central ec.europa.eu database (using the official europa API).

95464.2k1](/packages/ph-7-eu-vat-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
