PHPackages                             mistralys/vies-vat-service - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mistralys/vies-vat-service

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mistralys/vies-vat-service
==========================

Fetches data on a VAT number, and returns it as JSON.

1.0.0(4y ago)29MITPHP

Since Feb 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Mistralys/vies-vat-service)[ Packagist](https://packagist.org/packages/mistralys/vies-vat-service)[ RSS](/packages/mistralys-vies-vat-service/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

VIES VAT Service
================

[](#vies-vat-service)

Wrapper for the VIES VAT service, to fetch the data as JSON.

Fetching data
-------------

[](#fetching-data)

### Sending a request

[](#sending-a-request)

Simply call the endpoint with the `vatid` parameter:

```
/url/to/endpoint/?vatid=FR00000000

```

The request always returns JSON, with the `status` key. This specifies if the request itself was successful, not whether the VAT ID is valid.

### Successful request

[](#successful-request)

A successful request returns detailed data on the results. The relevant part is stored under `data > result`.

```
{
  "status": "success",
  "data": {
    "result":{
      "vatID":{
        "countryCode":"FR",
        "number":"00000000"
      },
      "valid":true,
      "identifier":"WJFS4465465SD",
      "date":"2021-03-17T07:17:07+0100",
      "companyName":"---",
      "companyAddress":"---"
    },
    "requester":{
      "name":"Company name",
      "companyType":"",
      "street":"Street address",
      "city":"City",
      "postcode":"00000",
      "vatID":{
        "countryCode":"FR",
        "number":"000000"
      }
    },
    "requesterMatch":{
      "name":"",
      "companyType":"",
      "street":"",
      "postcode":"",
      "city":""
    }
  }
}
```

> NOTE: The requester information is what has been specified in the service configuration, in the `config.php`.

From experience, the company name and address in the result set are missing more often than not, so it's better not to rely on it. The same goes for the requester match.

### Failed request

[](#failed-request)

A request can fail for example if the VIES VAT service is down. The error message details the reason why.

```
{
  "status": "error",
  "message": "Error message",
  "code": 145
}
```

Parsing VAT ID strings
----------------------

[](#parsing-vat-id-strings)

The static `VatID::parse()` method accepts formatted and unformatted VAT ID strings. It automatically strips most commonly used separator characters and whitespace.

The following examples all return a valid `VatID` instance:

```
VatID::parse('FR 123 456 78');
VatID::parse('FR-12345678');
VatID::parse('[DE]12-34-56-78');
VatID::parse('de12345678'); // Lowercase country code
```

Running the testsuite
---------------------

[](#running-the-testsuite)

To run the tests, first rename the `tests/config.dist.php` to `tests/config.php`, and fill out the necessary information to enable live tests against the VIES service.

Tests can be launched on Windows using `run-tests.bat`. On linux, run the following command:

```
vendor/bin/phpunit

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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 ~104 days

Total

2

Last Release

1796d ago

Major Versions

0.1.0 → 1.0.02021-06-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8895528?v=4)[Mistralys](/maintainers/Mistralys)[@Mistralys](https://github.com/Mistralys)

---

Top Contributors

[![Mistralys](https://avatars.githubusercontent.com/u/8895528?v=4)](https://github.com/Mistralys "Mistralys (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mistralys-vies-vat-service/health.svg)

```
[![Health](https://phpackages.com/badges/mistralys-vies-vat-service/health.svg)](https://phpackages.com/packages/mistralys-vies-vat-service)
```

###  Alternatives

[mistralys/text-diff

Class used to compare strings using a DIFF implementation.

27113.4k4](/packages/mistralys-text-diff)[michael-rubel/laravel-enhanced-pipeline

Laravel Pipeline with DB transaction support, events and additional methods.

5521.0k](/packages/michael-rubel-laravel-enhanced-pipeline)

PHPackages © 2026

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