VAT Validation API for Accounting and Invoicing Tools
Accounting and invoicing software that handles EU B2B transactions can use the TaxID API to validate customer VAT numbers before generating zero-rated invoices. Prevent incorrectly zero-rated invoices and give users an auditable validation record.
Accounting software that generates EU B2B invoices carries a responsibility to verify that zero-rated invoices are correctly applied. When a user creates an invoice for a foreign EU business, the software should validate the buyer's VAT number against VIES before allowing zero-rate treatment. Without this check, accountants and finance teams may unknowingly produce non-compliant invoices.
The TaxID API provides a straightforward REST endpoint that accounting software can call when a user enters a VAT number on a customer record or invoice. The response returns the company_name and company_address registered with the member state's tax authority — which often differs from the self-reported billing details. Displaying this verified information lets the user confirm they are invoicing the right company.
For accounting software with large user bases, the TaxID batch endpoint allows validating multiple VAT numbers in a single API call. This is useful for import flows (bulk customer import, CSV upload) and for monthly compliance checks that re-validate all customers flagged as reverse-charge eligible.
The TaxID API response includes a request_id field that can be stored as an audit reference on each invoice. If a tax authority questions a zero-rated invoice, the accounting software can display the validation record — VAT number, company name, validation timestamp, and request ID — as proof of due diligence.
Implementation steps
- 1
Validate when a user adds an EU customer
When a user creates or updates a customer record with an EU VAT number, call GET /api/v1/validate/:country/:vat from your server. Display the returned company_name and company_address so the user can confirm they are adding the correct company.
- 2
Block zero-rate invoices for unvalidated customers
Prevent your invoice UI from allowing zero-rate treatment until the customer's VAT number has been validated as 'active'. Show a validation badge on the customer record — green for active, yellow for pending re-validation, red for invalid.
- 3
Store the validation record on each invoice
When generating a zero-rated invoice, attach the TaxID request_id, the validated company_name, company_address, and validation timestamp to the invoice record. This creates the audit trail required by EU invoice rules.
- 4
Re-validate reverse-charge customers on a schedule
Run a monthly background job using the TaxID batch endpoint to re-validate all customers marked as reverse-charge. Notify accountants of any numbers that have become invalid so they can update customer records and adjust upcoming invoices.
Code example
Node.js
const res = await fetch(
'http://localhost:3000/api/v1/validate/DE/DE123456789',
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
);
const { valid, status, company_name, company_address } = await res.json();
if (valid) {
console.log(`Valid EU business: ${company_name}`);
} else if (status === 'service_unavailable') {
// VIES is temporarily down — retry or allow with manual check
console.log('VIES unavailable — check back in a few minutes');
} else {
console.log('Invalid VAT number — charge local tax rate');
}Python
import requests
res = requests.get(
"http://localhost:3000/api/v1/validate/DE/DE123456789",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
data = res.json()
if data["valid"]:
print(f"Valid: {data['company_name']}")
elif data["status"] == "service_unavailable":
print("VIES temporarily unavailable")
else:
print("Invalid VAT number")API response
The TaxID API returns a consistent JSON response for every validation request:
{
"valid": true,
"status": "active",
"country_code": "DE",
"vat_number": "123456789",
"company_name": "Example GmbH",
"company_address": "Musterstraße 1, 10115 Berlin",
"request_date": "2026-05-10T00:00:00.000Z",
"cached": false,
"request_id": "req_01j..."
}Error handling
The API uses a consistent Stripe-style error format. Always handle service_unavailable separately — VIES has occasional downtime and you should not reject valid customers during outages.
activeVAT number is valid and the business is registered
invalidVAT number format is wrong or not registered in VIES
service_unavailableVIES or the national system is temporarily down — retry later
Frequently asked questions
Why should accounting software validate VAT numbers via API instead of asking users to check manually?
Manual VIES lookups are error-prone and create no audit record. An API integration validates in real time at the point of customer creation, displays verified company details, and stores a timestamped validation record on each invoice. This reduces manual errors and gives accountants documented proof of compliance.
Can TaxID validate VAT numbers in bulk for customer imports?
Yes. The batch endpoint (POST /api/v1/validate) accepts up to 25 VAT numbers per request, processed in parallel. For bulk imports of hundreds of customers, you can fan out multiple batch requests concurrently to validate all entries efficiently.
Further reading
EU VAT Number Validation: The Complete Developer Guide (2026)
VIES is SOAP-based, unreliable, and has no caching. This guide explains how EU VAT validation works end-to-end, how to h…
SaaS VAT Compliance: A Developer's Complete Guide for EU Markets
Selling a SaaS product to EU customers means navigating B2B vs B2C VAT rules, determining the place of supply, registeri…
Evaluating EU VAT APIs? Compare TaxID vs Vatstack, Vatlayer, Avalara →
Related use cases
Validate EU VAT numbers in Stripe Checkout
Add EU VAT validation to your Stripe checkout flow. Verify customer VAT numbers server-side before a...
UK VAT validation in Shopify B2B
Validate UK VAT numbers for B2B customers in Shopify. Required under UK Making Tax Digital rules for...
WooCommerce Spain NIF/CIF validation
Validate Spanish NIF and CIF numbers in WooCommerce checkout. Automatically apply B2B tax exemptions...