VAT API
29 Countries
Rates + Calculate
EU + UK

VAT rates. Plus the total.

Bundled EU and UK rate tables, category-level price calculation, and format checks for VAT numbers. Live VIES or HMRC confirmation is optional.

29 · countries6 · categoriesGET · calculate50 · batch cap

Calculate VAT from a country table.

This calls the live VAT API using bundled rates. Switch between /calculate and /rates. The demo does not hit VIES.

Request builder
Country and amount in, VAT total out.
GET /calculate
Format validation
GET /validate checks VAT number format. Set checkRegistry=true only when you need a live VIES or HMRC confirmation.
Output preview
Live response from the API, plus the exact request to reproduce it.

Loading VAT data...

Why VAT Validation and Rates API

Rates, totals, and format checks.

29 country tables

Standard, reduced, super-reduced, parking, and zero rates for 27 EU members plus GB and XI.

Price calculation

GET /calculate returns vatRate, vatAmount to 2 decimal places, and totalIncludingVat.

Rate categories

standard, reduced, reduced2, superReduced, parking, and zero. Missing categories return null.

Number format checks

GET /validate applies country-specific patterns. Live VIES or HMRC is opt-in via checkRegistry.

Reverse charge hint

sellerCountryCode on /validate sets reverseChargeApplicable for EU B2B invoicing logic.

Catalog and batch

GET /catalog lists countries and categories. Batch validate and calculate handle up to 50 items.

/api/v1/vat-validation-and-rates

Endpoints, at a glance.

Calculate and rate tables are GET and use bundled data. VAT number validation is separate; live registry checks are opt-in.
GET/api/v1/vat-validation-and-rates/calculate

Calculate

VAT amount and inclusive total for amount + countryCode. Optional category.

PRIMARY
GET/api/v1/vat-validation-and-rates/rates/:countryCode

Country rates

Bundled rate structure for one country. 404 when the code is not in the table.

GET/api/v1/vat-validation-and-rates/rates/countries

All rates

Full 29-country table with standard, reduced, superReduced, parking, zero, and currency.

GET/api/v1/vat-validation-and-rates/validate

Validate VAT number

Format check. Optional checkRegistry and sellerCountryCode. Path form /validate/:vatNumber exists.

GET/api/v1/vat-validation-and-rates/catalog

Catalog

Supported countries, rate categories, and endpoint inventory.

GET/health

Service health

Status, service name, version, and timestamp.

GET/metrics

Prometheus metrics

Request counts and duration histograms in Prometheus exposition format.

ParameterTypeRequiredDescription
amountnumberyes*Positive amount for /calculate.
countryCodestringyes*2-letter ISO code for /calculate or path param for /rates/:countryCode.
categorystringnostandard, reduced, reduced2, superReduced, parking, or zero. Default standard.
vatNumberstringyes*VAT number with country prefix, 4-20 chars, for /validate.
checkRegistrybooleannoQuery VIES or HMRC. Default false.
sellerCountryCodestringno2-letter seller country for reverse charge detection on /validate.

Error reference

Failures you can plan for.

Rate misses return reason: country-not-found. Format failures return valid: false with a reason string.
400Validation Error

Joi failure or invalid country code before VAT processing.

400Invalid VAT

VAT number fails the country-specific format pattern.

401Authentication Error

Missing or invalid gateway API key. Send x-api-key or api_key with every request.

404Not Found

Country not in the rates table, or unknown endpoint path.

429Rate Limit Error

More than 1000 requests in a 15-minute window.

500Registry Error

Unexpected failure during an optional VIES or HMRC lookup.

Example error response

{
  "success": false,
  "error": "Rates not found for country",
  "reason": "country-not-found",
  "correlationId": "req_abc123"
}

FAQ

API questions developers ask first.

Do I need a live VIES or HMRC call to get rates?

No. GET /rates/:countryCode and GET /calculate use bundled tables. checkRegistry=true on /validate is optional and talks to VIES (EU) or HMRC (GB/XI).

Which countries have rate tables?

29 codes: 27 EU members plus GB and XI (Northern Ireland). Unknown country codes on /rates or /calculate return 404.

How does calculate pick a rate?

Pass amount, countryCode, and optional category (standard, reduced, reduced2, superReduced, parking, zero). The response includes vatRate, vatAmount (2 dp), and totalIncludingVat.

What is reverseChargeApplicable?

When you send sellerCountryCode on /validate, the API sets reverseChargeApplicable from EU reverse-charge rules. It is null when either party is outside EU scope.

How do I authenticate requests?

Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.

Add VAT rates and totals in one request.

Bundled EU and UK tables, category-level calculation, and optional VAT number format checks without a required registry call.