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.
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/NO123456789MVAEU: 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`.
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.
// 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.
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)
// 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
| Status | Meaning | Action |
|---|---|---|
| active | Tax ID is valid and currently registered | Apply zero-rate / B2B exemption; store company name for audit |
| inactive | Tax ID exists but registration has lapsed | Reject zero-rate claim; charge standard VAT |
| format_invalid | Tax ID does not match the country's format rules | Show user a format hint; do not call API again until format corrects |
| service_unavailable | National registry temporarily unavailable | Charge standard VAT; queue for re-validation when registry recovers |
Multi-Country Validation Function
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();
}Related guides
Start validating EU VAT numbers
Free plan — 100 validations/month. No credit card required.