{"id":15025364,"url":"https://github.com/ph-7/eu-vat-validator","last_synced_at":"2025-04-05T15:09:05.813Z","repository":{"id":48947822,"uuid":"79711715","full_name":"pH-7/eu-vat-validator","owner":"pH-7","description":":moneybag: A simple and clean PHP library that validates EU VAT registration numbers against the central ec.europa.eu database (using the official europa API) :eu:","archived":false,"fork":false,"pushed_at":"2024-06-25T04:40:05.000Z","size":90,"stargazers_count":93,"open_issues_count":4,"forks_count":18,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-05T15:09:01.583Z","etag":null,"topics":["business","businesses","companies","company","eu","eu-api","eu-vat","eu-vat-validator","europa","europa-api","php-7","php7","tax","validation","vat-number","vat-validation","vat-validator","vat-valiration","vatin","vies"],"latest_commit_sha":null,"homepage":"https://github.com/pH-7/eu-vat-validator","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pH-7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-22T10:46:59.000Z","updated_at":"2024-08-27T15:23:14.000Z","dependencies_parsed_at":"2024-03-03T03:28:54.077Z","dependency_job_id":"cf04fc70-4c18-4080-9e97-07425db6bdd9","html_url":"https://github.com/pH-7/eu-vat-validator","commit_stats":{"total_commits":65,"total_committers":4,"mean_commits":16.25,"dds":"0.24615384615384617","last_synced_commit":"44f8ca8d17e24fc5fbeff1907917f7b2d9349636"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2Feu-vat-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2Feu-vat-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2Feu-vat-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2Feu-vat-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pH-7","download_url":"https://codeload.github.com/pH-7/eu-vat-validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353746,"owners_count":20925329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["business","businesses","companies","company","eu","eu-api","eu-vat","eu-vat-validator","europa","europa-api","php-7","php7","tax","validation","vat-number","vat-validation","vat-validator","vat-valiration","vatin","vies"],"created_at":"2024-09-24T20:02:10.925Z","updated_at":"2025-04-05T15:09:05.784Z","avatar_url":"https://github.com/pH-7.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EU VAT Number Validator\n\nA simple and clean PHP class that validates EU VAT numbers against the central ec.europa.eu database (using the official europa API).\n\n![EU VATIN validator; EU Flag](eu-flag.svg)\n\n\n## The Problem\n\nValidate VAT numbers might be difficult and if you use a validation pattern to check if the format is valid, you are never sure if the VAT registration number is still valid.\n\n## The Solution\n\nThis [PHP VAT validator library](https://github.com/pH-7/eu-vat-validator) uses real-time data feeds from individual EU member states' VAT systems so you are sure of the validity of the number and avoid fraud with expired or wrong VAT numbers.\n\nFor example, this kind of validation can be very useful on online payment forms.\n\n\n## Composer Installation\n\n* Be sure PHP **[v7.1](https://www.php.net/releases/7_1_0.php) or higher** is installed.\n\n* Install Composer (https://getcomposer.org).\n\n* Then, include it in your project like belowe,\n\n```bash\ncomposer require ph-7/eu-vat-validator\n ```\n\n* Then, include Composer's autoload (if not already done in your project)\n\n ```php\nrequire_once 'vendor/autoload.php';\n```\n\n\n## Manual Installation (*the old-fashioned way*)\n\nIf you don't use Composer, you can install it without Composer by including the following\n\n```php\nrequire 'src/autoloader.php';\n```\n\n\n## How to Use\n\n### Example\n\n```php\nuse PH7\\Eu\\Vat\\Validator;\nuse PH7\\Eu\\Vat\\Provider\\Europa;\n\n$oVatValidator = new Validator(new Europa, '0472429986', 'BE');\n\nif ($oVatValidator-\u003echeck()) {\n    $sRequestDate = $oVatValidator-\u003egetRequestDate();\n    // Optional, format the date\n    $sFormattedRequestDate = (new DateTime)-\u003eformat('d-m-Y');\n\n    echo 'Business Name: ' . $oVatValidator-\u003egetName() . '\u003cbr /\u003e';\n    echo 'Address: ' . $oVatValidator-\u003egetAddress() . '\u003cbr /\u003e';\n    echo 'Request Date: ' . $sFormattedRequestDate . '\u003cbr /\u003e';\n    echo 'Member State: ' . $oVatValidator-\u003egetCountryCode() . '\u003cbr /\u003e';\n    echo 'VAT Number: ' . $oVatValidator-\u003egetVatNumber() . '\u003cbr /\u003e';\n} else {\n    echo 'Invalid VAT number';\n}\n```\n\n\n## Optimization (Suggestion)\n\nDepending of the use of this library, it could be handy to cache the result specifically for each specified VAT number.\n\n\n## Requirements\n\n* PHP 7.1 or higher\n* [Composer](https://getcomposer.org)\n* [SOAPClient](http://php.net/manual/en/class.soapclient.php) PHP Extension enabled\n\n\n## About Me\n\nI'm **[Pierre-Henry Soria](https://pierrehenry.be)**, a passionate Software Engineer and the creator of [pH7CMS](https://github.com/pH7Software/pH7-Social-Dating-CMS).\n\n\n## Where to Contact Me?\n\nYou can by email at **pierrehenrysoria+github [[AT]] gmail [[D0T]] com**\n\n\n## Wordpress Plugin\n\n[VIES Validator WP plugin](https://wordpress.org/plugins/vies-validator/) uses also this [EU VAT Validation library](https://github.com/pH-7/eu-vat-validator/) for WooCommerce checkout, when you need to make sure that the VAT number is valid (that plugin was deleloped by [WpZen](https://wpzen.it), not me :smiley:).\n\n\n## References\n\n[VAT Information Exchange System (VIES)](http://ec.europa.eu/taxation_customs/vies/)\n\n\n## License\n\nUnder [General Public License 3](http://www.gnu.org/licenses/gpl.html) or later.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph-7%2Feu-vat-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fph-7%2Feu-vat-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph-7%2Feu-vat-validator/lists"}