Skip to main content

Endpoint

POST https://api.bunny.build/api/v1/vat-validator

Authentication

HeaderRequiredValue
X-API-KeyYesYour API key (bun_...)
Content-TypeYesapplication/json

Overview

Validate European Union VAT numbers against the official VIES (VAT Information Exchange System) database and retrieve the registered business name and address. Use this API to automate B2B tax compliance checks and keep your invoicing data accurate.

Use cases

  • Verify customer VAT numbers during B2B checkout
  • Auto-fill company name and address from a VAT number
  • Gate zero-rate tax treatment on confirmed valid VAT IDs
  • Detect fraudulent or expired VAT numbers

Details

Covers all EU member states. The vat field should include the two-letter country prefix (e.g. DE123456789, FR12345678901). Validation queries the live VIES service; occasional timeouts from the VIES system are propagated as errors.

Request body

FieldTypeRequiredDescription
vatstringYesVAT number, with or without the two-letter country prefix (e.g. DE123456789)
countrystringNoTwo-letter EU country code (e.g. DE). Required only when vat does not include the prefix

Example

{
  "vat": "DE123456789"
}

Response

200 OK

FieldTypeDescription
country_codestringTwo-letter EU country code
vat_numberstringVAT number with the country prefix stripped
validbooleanWhether the VAT number is registered and active
namestring|nullRegistered business name (null if not disclosed by VIES)
addressstring|nullRegistered business address (null if not disclosed by VIES)
request_datestring|nullDate the VIES lookup was performed
Example
{
  "country_code": "DE",
  "vat_number": "123456789",
  "valid": true,
  "name": "Example GmbH",
  "address": "Musterstraße 1, 10115 Berlin",
  "request_date": "2024-01-15+01:00"
}

401 Unauthorized

{
  "detail": "Missing API key. Include X-API-Key header."
}

402 Payment Required

{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}

422 Unprocessable Entity

{
  "detail": "Invalid VAT number format"
}

429 Too Many Requests

{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}

cURL example

curl -X POST https://api.bunny.build/api/v1/vat-validator \
  -H "X-API-Key: bun_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"vat": "DE123456789"}'