If your app touches B2B payments in Europe, you will eventually need to check an EU VAT number. The authoritative source is the European Commission's VIES (VAT Information Exchange System) — the same database national tax authorities use. This tutorial shows how to validate EU VAT numbers against VIES as a no-login REST API call, then add caching and deregistration monitoring on top.
Why VIES matters for B2B software
When you invoice a business in the EU, you typically need their VAT number to be registered and match their legal name. VIES is the official register. There is no API key, no login, and the service is free — the hard parts are reliability, polite usage, and turning raw responses into structured data your pipeline can consume.
The official VIES endpoints
The EC exposes two public endpoints:
- REST —
https://ec.europa.eu/taxation_customs/vies/rest-api/check-vat-number(the modern one) - SOAP — the legacy
checkVatService(useful as a fallback when REST is down)
Both take a country code + VAT number and return valid true/false plus the registered trader name and address.
How the actor turns this into an API
The EU VAT Number Validator & VIES Check API wraps those official endpoints. Call it with a list of VAT numbers:
{ "vatNumbers": ["IE8256796U", "DE123456789", "FR12345678901"], "monitorChanges": false, "cacheTtlHours": 24, "maxConcurrency": 2 } Each number becomes one dataset row:
{ "countryCode": "IE", "vatNumber": "IE8256796U", "valid": true, "name": "MICROSOFT IRELAND OPERATIONS LIMITED", "address": "ONE MICROSOFT PLACE, SOUTH COUNTY BUSINESS PARK, LEOPARDSTOWN, DUBLIN 18", "traderCity": "DUBLIN", "source": "fresh", "status": "ok" } DE123456789 (an unregistered number) returns valid: false with --- in the trader fields — a complete, deterministic result either way.
Calling it from your code
Every Apify actor is a REST API. Trigger a run with your API token:
curl -X POST "https://api.apify.com/v2/acts/gp005~vat-vies-validator/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"vatNumbers":["IE8256796U","DE123456789"],"monitorChanges":false,"cacheTtlHours":24,"maxConcurrency":2}' Then fetch the results from the run's dataset. That makes it easy to script into invoicing, ERP, or vendor-onboarding flows.
Deregistration monitoring (the part people miss)
A VAT check is a snapshot; a supplier's registration can die tomorrow. With monitorChanges: true the actor stores snapshots server-side. Schedule it daily, and each run returns statusChanged: true (plus previous values) when a number flips valid↔invalid or the registered details change. Point a webhook, Make, or n8n at the run and you get alerted the moment a counterparty's VAT status changes — before your next invoice is rejected.
Pricing and caching
Pay-per-event, no subscription:
| Event | Price |
|---|---|
| Run start | $0.005 |
| Fresh VIES validation | $0.004 |
| Cache hit (within TTL) | $0.001 |
| Status change detected (monitor mode) | $0.02 |
10 fresh checks cost $0.005 + 10 × $0.004 = $0.045. Re-running the same 10 within the cache TTL costs $0.005 + 10 × $0.001 = $0.015. A weekly monitor of 50 vendors that detects one deregistration costs $0.005 + 50 × $0.004 + $0.02 = $0.225. Apify's free plan includes platform credits, so most first runs are free.
Gotchas
- UK is not in VIES — the UK left the system after Brexit. Only EU member states plus Northern Ireland (
XI) are supported;GBreturns a structured error row. - Malformed numbers are never charged — format and country code are validated up front; bad input returns an error row with a reason, not a failed VIES call.
- Some trader details are
---— a few member states don't return name/address even for valid numbers. That's a VIES data quirk, not a bug. - Not legal advice — treat results as current, but confirm with the national tax authority for legally binding decisions.
FAQ
Is the VIES API free?
Yes — VIES is a free public EU service with no API key. The actor charges per event because it turns that raw service into a repeatable API with caching, monitoring, and structured output.
Can I look up a VAT number by company name?
No. VIES only accepts a full VAT number; there is no reverse lookup. The actor returns the registered name and address for a given number.
What happens when VIES is down?
The actor falls back to the official SOAP endpoint. If both fail, each number returns an error row and no validation event is charged — no false valid: false results.
The actor is live on Apify: https://apify.com/gp005/vat-vies-validator
