validate_vat_uk
Validate UK VAT registration numbers via HMRC modulo-97 algorithm. Outputs validity, VAT number type, and country code for B2B invoice compliance.
Instructions
Validates a UK VAT registration number — format 'GB' followed by 9 digits (standard), 12 digits (branch traders), or 'GD'/'HA' followed by 3 digits (government/health authorities). Applies the official HMRC modulo-97 algorithm for 9-digit numbers. Returns { valid: boolean, vat_number: string, type: string, country: 'GB' }. Use when processing UK invoices, validating UK suppliers post-Brexit, or any B2B workflow involving UK VAT numbers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vat_number | Yes | UK VAT number with or without spaces. Example: 'GB123456789' or '123456789' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | Yes | ||
| vat_number | No | ||
| type | No | ||
| country | No | ||
| reason | No |