PHPackages                             craftcms/commerce-uk-vat-id-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. craftcms/commerce-uk-vat-id-validator

ActiveCraft-plugin[Validation &amp; Sanitization](/categories/validation)

craftcms/commerce-uk-vat-id-validator
=====================================

Adds a UK VAT ID validator to Craft Commerce

1.0.0.3(1y ago)1207[1 PRs](https://github.com/craftcms/commerce-uk-vat-id-validator/pulls)mitPHPPHP &gt;=8.0.2CI passing

Since Feb 3Pushed 1y ago2 watchersCompare

[ Source](https://github.com/craftcms/commerce-uk-vat-id-validator)[ Packagist](https://packagist.org/packages/craftcms/commerce-uk-vat-id-validator)[ RSS](/packages/craftcms-commerce-uk-vat-id-validator/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

UK VAT ID Validator
===================

[](#uk-vat-id-validator)

Out of the box, Craft Commerce supports basic formatting validation for VAT IDs in the European Union. This plugin provides additional checks to ensure tax rules are correctly applied for customers with *UK* VAT IDs:

- Tax rules are given a setting that allows merchants to disqualify taxes when a valid UK Tax ID (VAT number) is provided during checkout;
- UK Tax IDs are validated directly with [HMRC](https://www.gov.uk/government/organisations/hm-revenue-customs)’s official API;

### How it Works

[](#how-it-works)

Enabling the `validateBusinessTaxIdAsVatId` in Craft Commerce 4.8 (globally) or **Validate Business Tax ID as VAT ID** in Craft Commerce 5.x (in one or more stores) tells Commerce to perform cursory validation of the **Organization Tax ID** field on addresses used for tax calculation. This functionality is available to *all* Commerce installations.

As tax rules are evaluated in the process of [calculating order totals](https://craftcms.com/docs/commerce/5.x/system/orders-carts.html#order-totals), *UK VAT ID Validator* ensures the provided VAT ID is both correctly formatted and actually exists, using the HMRC API.

Note

Make sure your `useBillingAddressForTax` config setting (Commerce 4.8) or **Use Billing Address For Tax** store setting (Commerce 5.x) agrees with how you want to handle taxes in each market!

Requirements
------------

[](#requirements)

- Craft CMS 4.x or 5.x
- Craft Commerce 4.8 or 5.3 and later
- HMRC credentials for [Version 2 of the HMRC VAT API](https://developer.service.hmrc.gov.uk/api-documentation/docs/using-the-hub)

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

[](#installation)

You can install this plugin from the [Plugin Store](#from-the-plugin-store) or with [Composer](#with-composer). Once installed, follow the [configuration instructions](#configuration)!

#### From the Plugin Store

[](#from-the-plugin-store)

Go to the **Plugin Store** in your project’s [control panel](https://craftcms.com/docs/5.x/system/control-panel.html#plugin-store) and search for “UK VAT ID Validator.” On the plugin’s page, press **Install**.

#### With Composer

[](#with-composer)

Open your terminal and run the following commands:

```
# Go to the project directory:
cd /path/to/my-project

# Require the plugin package with Composer:
ddev composer require craftcms/commerce-uk-vat-id-validator

# Tell Craft to install the plugin:
ddev craft plugin/install uk-vat-id-validator
```

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

[](#configuration)

### Step 1: Configure Plugin Settings

[](#step-1-configure-plugin-settings)

Navigate to **Settings** → **UK Tax ID Validator** in the control panel, and fill in the following fields:

- **HMRC Client ID**: Obtain this from the HMRC Developer Hub.
- **HMRC Client Secret**: Provided alongside your HMRC Client ID.
- **Sandbox Mode**: Enable for testing (disables live API calls).

Warning

Whenever possible, use an [environment variable](https://craftcms.com/docs/5.x/configure.html#control-panel-settings) so that these secrets don’t leak into your project config files!

### Optional Step 2: Enable Validation on Tax Rates

[](#optional-step-2-enable-validation-on-tax-rates)

- Navigate to **Commerce** → **Tax Rates**.
- Edit a tax rate and check **UK VAT ID** under the **Disqualify with valid business tax ID?** option.
- Save the tax rate.

When a valid UK tax ID is provided in the address, the tax will not be applied.

Support
-------

[](#support)

Please report any issues on GitHub. Need help or have a question? Email us at ****.

🍋

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance48

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% 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 ~20 days

Total

5

Last Release

389d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ccdf8b493035de2343c55bd889513e3af5c04d5823482a2b186ad16adb1c3e3?d=identicon)[brandonkelly](/maintainers/brandonkelly)

---

Top Contributors

[![lukeholder](https://avatars.githubusercontent.com/u/133571?v=4)](https://github.com/lukeholder "lukeholder (18 commits)")[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (6 commits)")[![AugustMiller](https://avatars.githubusercontent.com/u/1895522?v=4)](https://github.com/AugustMiller "AugustMiller (4 commits)")

### Embed Badge

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

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

###  Alternatives

[elivz/vzurl

A URL fieldtype with validation.

4433.2k](/packages/elivz-vzurl)[verbb/events

A full-featured plugin for event management and ticketing.

2311.7k](/packages/verbb-events)

PHPackages © 2026

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