PHPackages                             webatvantage/vies-vat-api-client - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. webatvantage/vies-vat-api-client

ActiveTool[Validation &amp; Sanitization](/categories/validation)

webatvantage/vies-vat-api-client
================================

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

1.1.0(6mo ago)071↓50%MITPHPPHP ^7.4 | ^8.0CI passing

Since Oct 30Pushed 6mo agoCompare

[ Source](https://github.com/webatvantage/vies-vat-api-client)[ Packagist](https://packagist.org/packages/webatvantage/vies-vat-api-client)[ Docs](https://github.com/webatvantage/vies-vat-api-client)[ RSS](/packages/webatvantage-vies-vat-api-client/feed)WikiDiscussions main Synced 1mo ago

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

VIES
====

[](#vies)

Component using the European Commission (EC) VAT Information Exchange System (VIES) to verify and validate VAT registration numbers in the EU, using PHP and Composer.

The `Vies` class provides functionality to make a API call to VIES and returns an object `VatResponse` containing the following information:

- Country code (string): a 2-character notation of the country code
- VAT registration number (string): contains the complete registration number without the country code
- Date of request (DateTime): the date when the request was made
- Valid (boolean): flag indicating the registration number was valid (TRUE) or not (FALSE)
- Name (string): registered company name (if provided by EC member state)
- Address (string): registered company address (if provided by EC member state)

Stated on the European Commission website:

> To make an intra-Community supply without charging VAT, you **should ensure** that the person to whom you are supplying the goods is a taxable person in another Member State, and that the goods in question have left, or will leave your Member State to another MS. VAT-number should also be in the invoice.

More information at [http://ec.europa.eu/taxation\_customs/vies/faqvies.do#item16](http://ec.europa.eu/taxation_customs/vies/faqvies.do#item16)

GDPR and privacy regulation of VAT within the EU
------------------------------------------------

[](#gdpr-and-privacy-regulation-of-vat-within-the-eu)

On May 25, 2018 the General Data Protection Regulation or GDPR becomes law within all 28 European Member States. Is this VIES service package going to be compliant with GDPR?

In short: yes.

The longer answer is that this VIES package only interacts with the service for VAT ID verification provided by the European Commission. VAT validation is mandatory in European countries and therefor this service is allowed as lawfulness and legal basis. Please read more about this in [European DPO-3816.1](http://ec.europa.eu/dpo-register/details.htm?id=40647). This service does not store any data itself or collects more information than what's strictly required by law and provided by the EC VIES service.

When you have implemented this service package in your own project, be sure that you're making sure you're just store the VAT ID, the timestamp of validation, the result of validation and optionally the given validation ID provided by the EC VIES service.

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

[](#requirements)

- Minimum PHP version: 7.4
- Guzzle: ^7.9
- Extension: json

Please read the [release notes](https://github.com/webatvantage/vies/releases) for details.

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

[](#installation)

This project is on [Packagist](https://packagist.org/packages/dragonbe/vies)!

To install the latest stable version use `composer require webatvantage/vies`.

To install specifically a version (e.g. 1.0.0), just add it to the command above, for example `composer require webatvantage/vies:1.0.0`

Usage
-----

[](#usage)

Here's a usage example you can immediately execute on the command line (or in cron, worker or whatever) as this will most likely be your most common usecase.

### 1. Setting it up

[](#1-setting-it-up)

```
