Automatically verify EU intra-community VAT numbers (VIES) with n8n
Published 22 August 2026 · 5 min read
Invoicing a business customer in another EU member state without VAT requires being able to prove, if the tax authority asks, that their intra-community VAT number was valid at the time of the transaction. In practice, this check is often done once, by hand, on the European Commission's VIES site — then forgotten for that same customer's next orders. A European Parliament study on solutions against Missing Trader Intra-Community fraud (VAT carousel fraud) puts the annual EU revenue loss from this fraud at at least €13 billion (study PE 731.902, 2022) — a reminder that verifying VAT numbers isn't a minor administrative formality but a real safety net, both for public finances and for the business issuing the invoice. This guide shows how to automate that check with n8n: calling the VIES API, triggering it at the right moment, keeping the proof, and re-verifying periodically.
What VIES checks — and what it doesn't guarantee
VIES (VAT Information Exchange System) is the system the European Commission uses to query member states' national VAT databases in real time. It answers one question: does this VAT number exist and is it currently valid in the stated country? Depending on the member state, it can also confirm an approximate match against a declared name and address.
What VIES does not do: it does not certify that the transaction is real, that the customer is acting in good faith, or that the goods actually left the territory. Jernej Podlipnik, in his study on Missing Trader fraud published in the Croatian Yearbook of European Law and Policy, points out that carousel fraud schemes rely precisely on VAT numbers that are valid at the moment of the check, used by companies that later disappear without remitting the tax they collected (see the study on Google Scholar). A number valid in VIES is therefore a necessary condition for the exemption, one piece of your due-diligence file — not an absolute guarantee against fraud.
Calling the VIES API from n8n
The European Commission exposes a public REST API, with no key or authentication, at ec.europa.eu/taxation_customs/vies/rest-api. Two forms cover most cases:
- Simple GET:
.../ms/{country_code}/vat/{number}— handy for a one-off check. - POST
check-vat-number: JSON body{"countryCode": "FR", "vatNumber": "..."}, which returnsisValid,name,address,requestDate, and arequestIdentifier— this request identifier is exactly the timestamped proof to keep on file.
Splitting the entered VAT number
An intra-community VAT number always starts with a two-letter country code (FR, DE, BE…) followed by the national number. A Code node splits the two before the call:
const raw = $json.vatNumber.replace(/\s|\./g, "").toUpperCase();
return {
countryCode: raw.slice(0, 2),
vatNumber: raw.slice(2),
};
See our n8n expressions and syntax guide for handling this kind of string cleanly in a Code node or inline expressions.
Calling the endpoint with an HTTP Request node
An HTTP Request node in POST mode to check-vat-number, with the JSON body built in the previous step, is enough — no credential to configure. The response then feeds an IF node that routes on isValid: see our guide to conditional routing with IF and Switch for building the two branches cleanly (valid number vs. invalid or error).
Handling the service's downtime
VIES queries national databases in real time, and their availability varies; occasional outages and maintenance windows are documented on the European Commission's side. An error does not mean the number is invalid — it means the service was unreachable. Configure the HTTP Request node with several retries and a backoff, as detailed in our guide on handling retries and timeouts with the HTTP Request node, and only mark a number as definitively invalid after several distinct failed checks, not after a single network error.
Triggering the check at the right moment
Two entry points cover most cases:
- When a customer is created in your CRM or spreadsheet — a webhook from HubSpot or Airtable triggers the workflow as soon as a new VAT number is entered, before the first order even happens.
- Before issuing each VAT-exempt invoice, upstream of the pipeline described in our guide to generating quotes and invoices as PDFs — useful if your sales cycle is long and the customer's status may have changed between onboarding and the first invoice. This check fits naturally into the receiving and logging logic detailed in our article on the mandatory 2026 e-invoicing reform.
Building the proof: a timestamped audit trail
The value of this automation isn't just blocking a bad number at time T — it's being able to prove, months later, that a check actually happened. Every VIES call should write a row to a Supabase table — customer, number queried, result (isValid), the requestIdentifier returned by VIES, and a server timestamp. This is exactly the pattern described in our guide to a GDPR audit trail with Supabase: nothing relies on a screenshot or someone's memory, everything is reconstructible from the database. See our guide to connecting Supabase to n8n for setting up the credential and the table.
Re-verifying existing customers periodically
A number validated at onboarding can become invalid later — deregistration, a status change, or fraud discovered after the fact, exactly the pattern documented in the Podlipnik study cited above. A second workflow, on a monthly Schedule Trigger, walks back through your list of active intra-EU B2B customers and re-runs the VIES call for each one, logging only status changes. It is the same principle as the periodic review applied to a GDPR processing register: the initial check has an expiry date, and only automating its renewal keeps it current.
What this automation doesn't replace
This workflow secures one specific control point — the existence and formal validity of the VAT number at invoicing time — and keeps proof of it. It does not replace your accountant's judgment on which VAT regime applies to a given transaction, the proof of transport and economic substance required in a deeper audit, or a broader fraud risk assessment on your international customers. Its role is more modest and more useful day to day: guaranteeing that no VAT-exempt invoice goes out without this basic check, and that proof of it exists.
Summary
Checking an intra-community VAT number on VIES takes thirty seconds by hand — the problem is never the first check, it's the hundredth one forgotten three months later. The public VIES REST API, an HTTP Request node with retries, a trigger at customer creation and before each invoice, a timestamped database write for the proof, and a periodic re-check: these five building blocks are enough to turn a one-off check into a permanent safeguard. The workflows in the Compliance & Audit Pack (€149) apply the same timestamped traceability principle to your internal questionnaires and audits — the VIES audit trail fits naturally alongside it to cover your intra-EU B2B invoicing obligations.
FAQ
Frequently asked questions
Is the VIES API free and does it require an API key?
Yes. The European Commission's official REST API (ec.europa.eu/taxation_customs/vies/rest-api) is accessible without authentication or an API key, both for the simple GET endpoint and the POST check-vat-number endpoint. It is a free public service, but with no contractual uptime guarantee — plan for retries.
Is a VAT number valid in VIES enough to safely invoice without VAT?
It is a necessary but not sufficient condition. Intra-EU VAT exemption also requires that the goods or services actually leave the territory to another member state and that the customer acts as a taxable person for that transaction. Keeping timestamped proof of the VIES check protects you in an audit, but it does not replace the other supporting evidence (proof of transport, contract, etc.).
Why does VIES sometimes return an error even when the number is correct?
VIES queries member states' national databases in real time, and their availability varies: some experience outages or recurring maintenance windows. A one-off error does not mean the number is invalid — it means the service could not answer. That is why a retry mechanism matters before concluding a number is invalid.
Should an already-validated VAT number be re-checked later?
Yes, periodically. A VAT number can become invalid after the initial check: deregistration, status change, or fraud discovered after the fact. For recurring customers, an automated monthly or quarterly re-check is the recommended practice rather than a one-time check frozen at onboarding.
Bundle FlowKit Complet
€269