Download the PHP package dragonbe/vies without Composer
On this page you can find all versions of the php package dragonbe/vies. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dragonbe/vies
More information about dragonbe/vies
Files in dragonbe/vies
Informations about the package 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 SOAP call to VIES and returns an object CheckVatResponse
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
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. 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
- Minimum PHP version: 7.3
- Recommended PHP version: 7.4
- Extension: soap
- Extension: pcntl
- Extension: ctype
Please read the release notes for details.
Installation
This project is on Packagist!
To install the latest stable version use composer require dragonbe/vies
.
To install specifically a version (e.g. 2.2.0), just add it to the command above, for example composer require dragonbe/vies:2.2.0
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
2. See if the VIES service is alive
If using a proxy, you can now use the following approach
3. Validate VAT
Now that we know the service is alive, we can start validating VAT ID's
3.1. Simple usage
3.2. Advanced usage
3.3. Result methods
3.3.1. Is the VAT ID valid?
The most important functionality is to see if the VAT ID is valid
3.3.2. Retrieve the VAT validation identifier
3.3.3. Retrieve validation date
Note: VIES service returns date and timezone, but no time
3.3.4. Retrieve official trader name (not always available)
3.3.5. Retrieve official trader street (not always available)
3.3.6. Retrieve a match for trader name (not always available)
3.3.7. Retrieve a match for trader company type (not always available)
3.3.8. Retrieve a match for trader street (not always available)
3.3.9. Retrieve a match for trader postcode (not always available)
3.3.10. Retrieve a match for trader city (not always available)
Example code
When you run this, you will get the following result:
Community involvement
Here's a list of products or projects that have included this VIES package
If you have a product or a project that's using this package and you want some attribution for your work, send me an Facebook.
Docker containers
If you like to have Docker containers, you can now make use of a container designed for that purpose.
Point your browser to localhost:8000 to use the web interface for validating VAT.
Referenced on the web
- Microsoft Dynamics GP - Dynamics GP real time EU tax registration number validation using VIES
- Popular RIA law eu projects
- PHP Code Examples - HotExamples.com
Clarification on exceptions
For Greece the international country ISO code is GR, but for VAT IDN's they use the prefix EL. Thanks to Johan Wilfer for reporting this.
Since January 1, 2021 the UK is no longer a member of the European Union and as a result, the VIES service provided by the European Commission no longer validates VAT ID's for the UK. There is one exception though and that is for Northern Ireland (XI) for which VAT ID's can be validated using this library and the EC VIES service.
Licence
DragonBe\Vies is released under the MIT Licence. See the bundled LICENCE file for details.
All versions of vies with dependencies
ext-soap Version *
ext-ctype Version *