Download the PHP package omisai/vies-rest without Composer
On this page you can find all versions of the php package omisai/vies-rest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package vies-rest
PHP VIES REST
A lightweight, type-safe PHP package for validating EU VAT numbers via the European Commission's VIES (VAT Information Exchange System) REST service.
Features
- Type-safe: PHP 8.1+ type declarations and modern enum support
- Clean architecture: DTOs, validation, and HTTP adapters
- Production + test modes: Switch services via
ViesConfig - Error handling: Structured exceptions for validation and REST errors
- Approximate matching: Trader detail matching support
- All EU countries: EU member states plus Northern Ireland
- Tested: Pest-based test suite
Requirements
- PHP 8.1 or higher
- ext-curl
- ext-json
- ext-mbstring
Installation
Install the package via Composer:
Quick Start
Basic VAT Validation
Using the Test Service
Configuration
Environment Configuration
HTTP Client Options
API Reference
ViesClient
checkVat(string $countryCode, string $vatNumber): CheckVatResponse
Validates a VAT number and returns basic information.
checkVatApprox(CheckVatRequest $request): CheckVatResponse
Performs approximate validation with trader details.
checkStatus(): StatusInformationResponse
Returns availability info for member states.
Data Transfer Objects (DTOs)
CheckVatRequest
CheckVatResponse
Supported Countries
Error Handling
Validation Errors
REST API Errors
Advanced Usage
Custom HTTP Client Factory
Custom Validation
Batch Processing
Testing
Run the test suite using Pest:
Performance Considerations
- The VIES service has rate limits - avoid excessive requests
- REST calls are synchronous and may take 1-5 seconds
- Consider caching valid VAT numbers to reduce API calls
- Use the test service for development to avoid affecting production quotas
Limitations
- Requires internet connection to VIES service
- Service may be unavailable during maintenance windows
- Rate limiting applies to prevent abuse
- Some countries may have additional validation rules
Contributing
Please see CONTRIBUTING.md for details on how to contribute to this project.
Security
Please see SECURITY.md for details on reporting security vulnerabilities.
License
This package is open-sourced software licensed under the MIT license.
Sponsoring
If you find this package useful, please consider sponsoring the development: Sponsoring on GitHub
Your support helps us maintain and improve this open-source project!
Official VIES Documentation
All versions of vies-rest with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.0