PHPackages                             billingserv/uk-vat-validator - 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. billingserv/uk-vat-validator

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

billingserv/uk-vat-validator
============================

A Composer package to validate UK VAT numbers using the HMRC API.

v1.0.3(1y ago)037↓100%MITPHP

Since Feb 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/BillingServ/uk-vat-validator)[ Packagist](https://packagist.org/packages/billingserv/uk-vat-validator)[ Docs](https://www.billingserv.com)[ RSS](/packages/billingserv-uk-vat-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

VAT Validator for UK Businesses
===============================

[](#vat-validator-for-uk-businesses)

BillingServ

**VAT Validator** is a Composer package developed by **BillingServ** that allows UK businesses to verify VAT numbers using the [HMRC VAT API](https://developer.service.hmrc.gov.uk/api-documentation/docs/api/service/vat-registered-companies-api/2.0/oas/page#tag/organisations). This package supports both **live** and **sandbox** environments.

Features
--------

[](#features)

- Verify UK VAT numbers.
- Obtain a **consultation number** when a business needs to verify a customer's VAT number.
- Supports **live** and **sandbox** environments.
- Fully open-source and free to use.

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

[](#installation)

### Requirements

[](#requirements)

- PHP 8.0+
- Composer
- Laravel

### Install via Composer

[](#install-via-composer)

```
composer require billingserv/uk-vat-validator
```

### Publish Configuration (Laravel Only)

[](#publish-configuration-laravel-only)

```
php artisan vendor:publish --tag=config
```

Configuration
-------------

[](#configuration)

After installation, add your **HMRC API credentials** to your `.env` file:

```
HMRC_CLIENT_ID=your-client-id
HMRC_CLIENT_SECRET=your-client-secret
HMRC_GRANT_TYPE=client_credentials
HMRC_SCOPE=read:vat
HMRC_USE_SANDBOX=true  # Set to false for live mode
```

Usage
-----

[](#usage)

### 1. Verify a VAT Number

[](#1-verify-a-vat-number)

```
use VatValidator\VatValidatorService;

$vatService = app(VatValidatorService::class);
$result = $vatService->verifyVatNumber('553557881');
print_r($result);
```

### 2. Obtain a Consultation Number

[](#2-obtain-a-consultation-number)

```
$consultation = $vatService->getConsultationNumber('553557881', '948561936944');
print_r($consultation);
```

Live and Sandbox Mode
---------------------

[](#live-and-sandbox-mode)

Set `HMRC_USE_SANDBOX=true` in the `.env` file to enable **sandbox mode**. If set to `false`, the package will use **live mode** automatically.

Testing
-------

[](#testing)

To run tests, use PHPUnit:

```
vendor/bin/phpunit
```

License
-------

[](#license)

This package is open-source and available for everyone to use under the **MIT License**.

Credits
-------

[](#credits)

Developed by **BillingServ**. Contributions are welcome!

Support
-------

[](#support)

For issues, please open an issue on GitHub or contact ****.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance44

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

4

Last Release

435d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb1acb633af24a61a95d7b035cbdc98c7def8be0a4eb490a277e82eb93b5db4c?d=identicon)[BaseServ](/maintainers/BaseServ)

---

Top Contributors

[![BillingServ](https://avatars.githubusercontent.com/u/11744722?v=4)](https://github.com/BillingServ "BillingServ (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/billingserv-uk-vat-validator/health.svg)

```
[![Health](https://phpackages.com/badges/billingserv-uk-vat-validator/health.svg)](https://phpackages.com/packages/billingserv-uk-vat-validator)
```

###  Alternatives

[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[robertogallea/laravel-codicefiscale

Codice fiscale validation for php/laravel

58151.6k1](/packages/robertogallea-laravel-codicefiscale)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[speelpenning/laravel-postcode-nl

A Laravel client using the Postcode.eu REST API for Dutch address verification.

1221.1k](/packages/speelpenning-laravel-postcode-nl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
