This is a simple PHP library to help you deal with Europe's VAT rules.
- Fetch VAT rates for any EU member state using ibericode/vat-rates.
- Validate VAT numbers (by format and/or existence)
- Validate ISO-3316 alpha-2 country codes
- Determine whether a country is part of the EU
- Geo-locate IP addresses
PHP version 8.2 or higher with the CURL and JSON extension is required.
For VAT number existence checking, the PHP SOAP extension is required as well.
To get the latest stable version, install the package using Composer:
composer require ibericode/vat
This library exposes 4 main classes to interact with: Rates
, Countries
, Validator
and Geolocator
.
This package relies on a community maintained repository of vat rates. We invite you to toggle notifications for that repository and contribute changes to VAT rates in your country once they are announced.
$rates = new