Shopify VAT number validation: what Shopify Tax does, and what an app adds
Since May 2025, Shopify Tax checks the VAT numbers of customers, companies and company locations against VIES and HMRC, and a valid number adds the reverse-charge exemption. Since February 2026, Shopify Tax merchants in the EU or UK can show an optional Company VAT number field at checkout, checked for format and validity at the time of the check. If you use Shopify Tax, that is the place to start. An app of your own is for what it does not cover: a dated record with a consultation number, other tax setups, or a rule that blocks checkout on your own terms.
- Shopify Tax: VIES and HMRC checks on customers, companies and company locations (May 2025); a valid number exempts the order under reverse charge.
- Checkout VAT number field (February 2026): Shopify Tax merchants in the EU or UK, field set to Optional; checked at the time of the check.
- Cart and Checkout Validation functions block checkout on an error; a network call from a function needs the fetch target, limited to custom apps on Enterprise stores and enabled by Shopify.
- Elsewhere, the documented route is to check before checkout and pass the result in metafields or cart attributes.
Check before checkout, read the result during it
Most stores cannot call an API from a checkout function. The pattern that works everywhere: check the number when the buyer registers or when the company is created (your app’s backend), store the result on the customer or company in a metafield, and let checkout logic read the metafield. Enterprise stores with a custom app can call the API from the fetch target of a validation function instead.
// Called by your B2B registration form or your app's backend, before the first order.
export async function checkBuyerVat(vatNumber) {
const res = await fetch("https://veriport.io/api/v1/vat/validate?number=" + encodeURIComponent(vatNumber) +
"&requester=" + encodeURIComponent(process.env.OWN_VAT_NUMBER) + "&record=true", {
headers: { Authorization: "Bearer " + process.env.VERIPORT_KEY },
});
const body = await res.json();
if (!res.ok) return { ok: false, retry: body.code === "vies_unavailable", code: body.code };
// Store these on the customer or company (a metafield), so checkout logic can read them without a network call.
return { ok: true, valid: body.valid, checkedOn: body.requestDate, source: body.source.kind,
consultationNumber: body.consultationNumber ?? null };
}What to store in the metafield
| Field | Why |
|---|---|
valid | The VIES answer for the number on the day asked. |
requestDate, source.checkedAt | When VIES answered (live) or when the cached answer was obtained. |
source.kind, source.stale | live or cache; stale: true when the member state was down and a dated earlier answer was served. |
consultationNumber | The Commission’s reference for this check, when you sent requester (your own VAT number) on a paid tier. |
name, address | What the member state publishes; Germany and a few others publish neither. |
Questions
- I use Shopify Tax: do I need this?
- For the exemption itself, Shopify Tax checks the number. You need a check of your own if you want the consultation number and a dated record outside Shopify, or a rule of your own (for example, refusing B2B checkout without a valid number).
- Does the check slow checkout down?
- Not with the metafield pattern: the call happens before checkout. Shopify notes that its own admin check can take up to 10 seconds.
100 calls a month, no card; consultation numbers and kept records from $9.
Get a free keySources
- Shopify changelog, 2025-05-06: VAT number validation included in Shopify Tax (VIES and HMRC, on customers and companies) — Shopify, consulted 2026-11-12
- Shopify changelog, 2026-02-25: VAT number validation available in checkout (Shopify Tax, EU or UK merchants) — Shopify, consulted 2026-11-12
- Shopify Functions: Cart and Checkout Validation API (errors block checkout; the fetch target for custom apps on Enterprise stores) — Shopify, consulted 2026-11-12
- Shopify Functions: network access (enabled by Shopify, Enterprise stores; metafields or cart attributes otherwise) — Shopify, consulted 2026-11-12
- VIES on-the-Web endpoint: OpenAPI contract (POST /check-vat-number, GET /check-status; requester fields for the consultation number) — European Commission, DG TAXUD, consulted 2026-11-12