Guide8 min readAlberto García

Validate VAT Number API: How to Verify EU, UK, AU, CH, NO Tax IDs

One API call validates EU, UK, Australian, Swiss, and Norwegian tax IDs. This guide covers the country prefixes, format rules, expected responses, and error handling for each region.

vatapieuukaustraliaguide

Verifying a VAT or tax ID number across different countries means hitting a different national registry for each one: VIES for the EU, HMRC for the UK, the Australian Business Register for AU, the UID register for Switzerland, and the Brønnøysund Register Centre for Norway. The TaxID API provides a single endpoint with a consistent response format for all of them. This guide shows how to call it for each country and what to do with the result.

The Universal Validation Endpoint

The endpoint structure is the same for every country. The `{country}` parameter is the two-letter prefix that appears at the start of the VAT number.

bash
GET https://taxid.dev/api/v1/validate/{country}/{vat_number}
Authorization: Bearer {your_api_key}

# Examples:
# EU (Germany):   GET /validate/DE/DE123456789
# UK:             GET /validate/GB/GB123456789
# Australia:      GET /validate/AU/AU12345678901
# Switzerland:    GET /validate/CH/CHE123456789
# Norway:         GET /validate/NO/NO123456789MVA

EU: Validating All 27 Member States via VIES

All 27 EU member states are validated via VIES. The response includes the company name and address from the national tax authority. Use the country prefix from the VAT number itself — not the ISO country code, as Greece uses `EL` not `GR`.

typescriptexamples/eu-validation.ts
const res = await fetch('https://taxid.dev/api/v1/validate/FR/FR12345678901', {
  headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` }
});
const data = await res.json();
// { valid: true, status: 'active', company_name: 'Société Exemple SAS', ... }

UK: Post-Brexit HMRC Validation

UK VAT numbers use the `GB` prefix followed by 9 digits. Since Brexit, they are validated against HMRC independently of VIES. Northern Ireland businesses trading in EU goods may have an `XI` prefix; these are also supported.

typescriptexamples/uk-validation.ts
// Standard UK VAT number
const uk = await fetch('https://taxid.dev/api/v1/validate/GB/GB123456789', {
  headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` }
}).then(r => r.json());

// Northern Ireland (XI prefix for EU goods trade)
const xi = await fetch('https://taxid.dev/api/v1/validate/XI/XI123456789', {
  headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` }
}).then(r => r.json());

Australia: ABN / GST Validation

Australian businesses use an ABN (Australian Business Number) — 11 digits. Use the `AU` prefix. An active ABN means the entity is registered with the Australian Business Register; GST registration is a separate status that is also returned in the response.

typescriptexamples/au-validation.ts
const au = await fetch('https://taxid.dev/api/v1/validate/AU/AU12345678901', {
  headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` }
}).then(r => r.json());

// status: 'active' = ABN active and GST registered
// company_name = entity name from ABR
console.log(au.company_name);

Switzerland (UID) and Norway (MVA)

typescriptexamples/ch-no-validation.ts
// Switzerland: CHE prefix + 9 digits (dashes stripped automatically)
const ch = await fetch('https://taxid.dev/api/v1/validate/CH/CHE123456789', {
  headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` }
}).then(r => r.json());

// Norway: NO prefix + 9 digits + MVA suffix
const no = await fetch('https://taxid.dev/api/v1/validate/NO/NO123456789MVA', {
  headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` }
}).then(r => r.json());

Response Status Reference

StatusMeaningAction
activeTax ID is valid and currently registeredApply zero-rate / B2B exemption; store company name for audit
inactiveTax ID exists but registration has lapsedReject zero-rate claim; charge standard VAT
format_invalidTax ID does not match the country's format rulesShow user a format hint; do not call API again until format corrects
service_unavailableNational registry temporarily unavailableCharge standard VAT; queue for re-validation when registry recovers

Multi-Country Validation Function

typescriptlib/validate-any.ts
type SupportedPrefix = 'AT'|'BE'|'BG'|'CY'|'CZ'|'DE'|'DK'|'EE'|'EL'|'ES'|'FI'|
  'FR'|'GB'|'GR'|'HR'|'HU'|'IE'|'IT'|'LT'|'LU'|'LV'|'MT'|'NL'|'NO'|
  'PL'|'PT'|'RO'|'SE'|'SI'|'SK'|'AU'|'CH'|'XI';

const SUPPORTED: Set<string> = new Set([
  'AT','BE','BG','CY','CZ','DE','DK','EE','EL','ES','FI',
  'FR','GB','GR','HR','HU','IE','IT','LT','LU','LV','MT','NL','NO',
  'PL','PT','RO','SE','SI','SK','AU','CH','XI'
]);

export async function validateAnyTaxId(rawId: string) {
  const normalised = rawId.replace(/[\s\-\.]/g, '').toUpperCase();
  const prefix = normalised.slice(0, 2);

  if (!SUPPORTED.has(prefix)) {
    return { error: 'unsupported_country', prefix };
  }

  const res = await fetch(
    `https://taxid.dev/api/v1/validate/${prefix}/${normalised}`,
    { headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` } }
  );

  return res.json();
}

Start validating EU VAT numbers

Free plan — 100 validations/month. No credit card required.

AG
Alberto García

Founder, TaxID

Building EU VAT validation tools for developers. Obsessed with compliance automation and developer experience.