Home / VAT API / Integrations / Stripe

Stripe

Stripe EU VAT Validation API

Use the TaxID API to validate EU VAT numbers inside Stripe Checkout before applying zero-rate treatment. Avoid VAT liability on unverified B2B customers and maintain an auditable validation record on every Stripe invoice.

VIES-backedSub-100ms cachedFree plan available27 EU countries

Quick start

CURL

curl -H "Authorization: Bearer YOUR_API_KEY" \
  http://localhost:3000/api/v1/validate/DE/DE123456789

Code example

Full integration example including error handling for service_unavailable responses from VIES.

Node.js

// After collecting the VAT number from your Stripe checkout form
const validateVAT = async (country, vatNumber) => {
  const res = await fetch(
    `http://localhost:3000/api/v1/validate/${country}/${vatNumber}`,
    { headers: { 'Authorization': `Bearer ${process.env.TAXID_API_KEY}` } }
  );
  return res.json();
};

// In your Stripe payment_intent creation handler
const { valid, company_name } = await validateVAT('DE', req.body.vatNumber);
if (valid) {
  // Customer is a valid EU business — apply zero-rate / reverse charge
  await stripe.customers.update(customerId, {
    tax_exempt: 'reverse',
    metadata: { vat_number: req.body.vatNumber, vat_company: company_name }
  });
}

Python

import requests
import stripe

def validate_vat(country: str, vat_number: str) -> dict:
    response = requests.get(
        f"http://localhost:3000/api/v1/validate/{country}/{vat_number}",
        headers={"Authorization": f"Bearer {TAXID_API_KEY}"}
    )
    return response.json()

# In your checkout handler
result = validate_vat("DE", request.json["vat_number"])
if result["valid"]:
    stripe.Customer.modify(customer_id, tax_exempt="reverse",
        metadata={"vat_number": vat_number, "company": result["company_name"]}
    )

API response

The TaxID API returns a consistent JSON response for every validation:

200 OK — valid numbervalid
{
  "valid": true,
  "status": "active",
  "country_code": "DE",
  "vat_number": "DE123456789",
  "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..."
}
active

VAT number is valid and the business is registered

invalid

VAT number format is wrong or not registered in VIES

service_unavailable

VIES or the national authority is temporarily down — retry later, do not silently zero-rate

Implementation steps

  1. 1

    Get a free TaxID API key

    Sign up at taxid.dev/signup — no credit card required. The free plan includes 100 validations per month. Your API key is available immediately after email confirmation.

  2. 2

    Add a VAT number field to your Stripe checkout form

    Add a text input for EU VAT numbers to your Stripe Payment Element or custom checkout form. Label it clearly as optional for consumers and required for B2B reverse-charge treatment. Place it in the billing-address section.

  3. 3

    Validate server-side before charging

    On form submission, call GET /api/v1/validate/:country/:vat from your server (never from the browser — this protects your API key). Check that status === 'active' before proceeding. If status is 'invalid', return a form error. If status is 'service_unavailable', log a warning and fall back to charging standard VAT rather than silently exempting.

  4. 4

    Apply zero-rate on the Stripe customer

    When the API returns status: 'active', call stripe.customers.update({ tax_exempt: 'reverse' }) to enable reverse-charge treatment on the Stripe customer object. Also store the validated VAT number, company_name, and company_address from the TaxID response in Stripe customer metadata for audit purposes.

  5. 5

    Re-validate on a schedule for subscriptions

    For subscription businesses, schedule a background job that re-validates all customers with tax_exempt: 'reverse' at least monthly. VAT registrations can be cancelled between billing cycles, and a tax audit will ask for proof that the number was valid at the time of each invoice — not just at signup.

Frequently asked questions

Does Stripe Tax validate EU VAT numbers automatically?

No. Stripe Tax calculates and collects VAT based on the customer's location and the tax_exempt flag, but it does not call VIES or any registry to verify that a VAT number is real or currently registered. You must validate independently — for example using TaxID — before setting tax_exempt: 'reverse' on the Stripe customer.

What should I do when TaxID returns service_unavailable?

Never silently zero-rate an unverified number. The safest fallback is to charge standard local VAT and issue a credit note once VIES recovers and confirms the number is valid. Log every service_unavailable response with the customer ID and timestamp so you can follow up.

Can I call the TaxID API from the browser inside Stripe.js?

No. Always call the TaxID API from your server-side code, never from client-side JavaScript. A browser request would expose your API key to anyone who inspects network traffic. Validate server-side and return only the result (valid: true/false) to the frontend.

How often should I re-validate EU VAT numbers for Stripe subscriptions?

Validate at every checkout for one-off transactions. For subscription customers, run a background job that re-checks all customers with tax_exempt: 'reverse' at least monthly. VAT registrations can be cancelled between billing cycles.

Which EU countries does TaxID support for Stripe integration?

TaxID validates VAT numbers for all 27 EU member states via VIES, plus UK (HMRC), Norway (Brønnøysund Register), and Australia (ABN Lookup). All 27 EU countries are eligible for Stripe reverse-charge treatment under EU VAT Directive 2006/112/EC.

Country-specific API docs:

In-depth integration guide:

Stripe EU VAT: Validate Tax IDs Before Charging Customers

Stripe EU VAT integration guide: validate EU VAT numbers server-side before applying zero-rate B2B exemptions in Stripe Checkout. Ensures you only exempt valid registered EU businesses from VAT.

Start validating EU VAT numbers in Stripe

Free plan — 100 validations/month. No credit card required.

Other integrations

Shopify

EU VAT validation for Shopify B2B storefronts

Node.js

EU VAT validation in Node.js with a single HTTP call

Python

Validate EU VAT numbers from Python with requests or httpx

PHP

PHP EU VAT number validation via REST API — cURL or Guzzle