Stripe validated the tax ID, but is the company real?

This is a recipe, not a Stripe app and not a marketplace listing. Stripe tells you whether a tax ID passed its check. A webhook handler can add what that check does not say: the register status and legal name of the company behind an EU VAT number, and a review flag, stored in the customer's metadata.

What Stripe says it validates

Read from Stripe's documentation on 26 November 2026: "Customer Tax IDs" (docs.stripe.com/billing/customer/tax-ids), the Tax ID object in the API reference and the webhooks guide. Its robots.txt allows reading them. In Stripe's terms:

  • "Stripe only checks the format of tax ID types other than AU ABN, EU VAT, and GB VAT, and doesn't validate them against government databases."
  • EU VAT numbers are validated with the European Commission's VAT Information Exchange System (VIES). "This process only validates whether or not the tax ID is valid. You still need to verify the customer's name and address to make sure they match the registration information." GB VAT numbers are validated with HMRC in the same way, and ABNs with the Australian Business Register, which "doesn't check whether the customer's name, address, and GST registration status match".
  • Stripe says it does not continue to validate tax IDs over time. The invoice includes the tax ID "whether or not it's valid", and "You're responsible for the accuracy of customer information including their tax ID number".
  • When verification finishes, Stripe sends customer.tax_id.updated for a customer. You inspect data.object.verification.status, which is pending, verified, unverified or unavailable. How to handle unverified is up to you, and when it is unavailable "you must manually verify the tax ID".
  • With Stripe Tax: "Stripe Tax applies the reverse charge or zero rate according to applicable laws when the tax ID has the required number format, regardless of the government verification result."

The same pages do not describe a check of whether the company exists in a company register, whether it is active, in insolvency or sanctioned. Stripe's page is about the tax ID, and this page does not say Stripe should do more. It names the gap a business that sells to companies may want to close for itself.

The stripe npm package (version 23.2.0) types the object: verification is { status, verified_address, verified_name } or null, the owner customer is in customer or owner.customer, and type is one of Stripe's tax ID types (eu_vat among them). Stripe's page lists test numbers for a sandbox: 000000000 verifies, 111111111 does not, 222222222 stays pending.

What VIES valid means, and what it does not

A VIES valid says the number is registered for VAT in that member state. It does not say the company is trading, solvent or the one your customer named. The register adds the other half: the legal name, the status and the legal form. Our GET /vat/{number} returns the VIES result, and GET /companies/by-identifier?type=vat returns the company record found under the number, with status. On 26 November 2026, for Telefonica's Spanish VAT number:

curl 'https://api.prometiam.com/functions/v1/risk-api/vat/ESA28015865' -H 'Authorization: Bearer rk_live_demo_publichn'
{
  "data": {
    "vat_number": "ESA28015865", "country_code": "ES", "number": "A28015865",
    "is_valid": true, "name": null, "address": null,
    "request_date": "2026-11-26T13:48:24.920Z",
    "source": "VIES ... (European Commission)",
    "registry_match": { "company_id": 59884, "company_name": "TELEFONICA SA", "register": "BORME (Registro Mercantil)", ... }
  }
}

VIES answered is_valid: true and withheld the name, as it does for some member states. registry_match is the company our register holds under that number: register data, not a VIES confirmation. The second call, with the same key:

curl 'https://api.prometiam.com/functions/v1/risk-api/companies/by-identifier?type=vat&value=ESA28015865' -H 'Authorization: Bearer rk_live_demo_publichn'

It answered the company record, shortened here to the fields the handler uses: "company_name": "TELEFONICA SA", "status": "active", "legal_form": "SA", "vat_number": "ESA28015865" and "vat_number_source": "rule". rule means the number was built from the Spanish NIF, so the register confirms the company, and VIES (the first call) confirms the VAT registration.

The handler

It takes customer.tax_id.created and customer.tax_id.updated events, verifies Stripe's signature with the library, handles eu_vat numbers, makes the two calls, and writes six keys of customer metadata with stripe.customers.update: prometiam_vies, prometiam_register_status, prometiam_legal_name, prometiam_vat_source, prometiam_review (none or review), prometiam_review_reasons. Any other tax ID type is flagged for review without a call. The key is read from the environment. Node 20 or later and npm install stripe.

const http = require('node:http');
const Stripe = require('stripe');

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY || 'sk_test_placeholder');
const ENDPOINT_SECRET = process.env.STRIPE_WEBHOOK_SECRET;
const API = 'https://api.prometiam.com/functions/v1/risk-api';
const HEAD = { Authorization: `Bearer ${process.env.PROMETIAM_API_KEY}` };

async function get(path) {
  const r = await fetch(API + path, { headers: HEAD });
  return { status: r.status, body: await r.json().catch(() => ({})) };
}

// Two Prometiam calls, 1 credit each: VIES through /vat, the register through /companies/by-identifier.
async function check(vat) {
  const reasons = [];
  const v = await get(`/vat/${encodeURIComponent(vat)}`);
  if (v.status === 503 || v.status === 429) throw new Error(`Prometiam ${v.status}`); // answer 5xx so Stripe retries
  const vies = v.status === 200 ? (v.body.data.is_valid ? 'valid' : 'invalid') : 'not_checked';
  if (vies !== 'valid') reasons.push(`vies_${vies}`);

  const c = await get(`/companies/by-identifier?type=vat&value=${encodeURIComponent(vat)}`);
  if (c.status === 429 || c.status >= 500) throw new Error(`Prometiam ${c.status}`);
  let status = 'not_found', name = '', source = '';
  if (c.status === 200) {
    status = c.body.data.status || 'unknown';
    name = c.body.data.company_name || '';
    source = c.body.data.vat_number_source || '';
    if (status !== 'active') reasons.push(`register_${status}`);
  } else {
    reasons.push(`register_${c.status === 404 ? 'not_found' : 'error_' + c.status}`);
  }
  return {
    prometiam_vies: vies,
    prometiam_register_status: status,
    prometiam_legal_name: name,
    prometiam_vat_source: source,        // "rule" means the number was built from the identifier, not confirmed
    prometiam_review: reasons.length ? 'review' : 'none',
    prometiam_review_reasons: reasons.join(','),
  };
}

async function onTaxId(taxId) {
  if (taxId.type !== 'eu_vat') {                 // this recipe covers eu_vat; anything else goes to a person
    return { prometiam_review: 'review', prometiam_review_reasons: `type_${taxId.type}_not_checked` };
  }
  const md = await check(taxId.value);
  if (taxId.verification && taxId.verification.status !== 'verified') {
    md.prometiam_review = 'review';
    md.prometiam_review_reasons = [md.prometiam_review_reasons, `stripe_${taxId.verification.status}`].filter(Boolean).join(',');
  }
  return md;
}

http.createServer((req, res) => {
  const chunks = [];
  req.on('data', (c) => chunks.push(c));
  req.on('end', async () => {
    let event;
    try {
      event = stripe.webhooks.constructEvent(Buffer.concat(chunks), req.headers['stripe-signature'], ENDPOINT_SECRET);
    } catch (e) { res.writeHead(400).end(); return; }       // bad signature: nothing else runs
    if (event.type !== 'customer.tax_id.updated' && event.type !== 'customer.tax_id.created') { res.writeHead(200).end(); return; }
    try {
      const taxId = event.data.object;
      const customer = taxId.customer || (taxId.owner && taxId.owner.customer);
      const metadata = await onTaxId(taxId);
      if (process.env.DRY_RUN) console.log('would write to', customer, JSON.stringify(metadata));
      else await stripe.customers.update(customer, { metadata });   // needs a Stripe account: not run for this page
      res.writeHead(200).end('ok');
    } catch (e) { console.error(e.message); res.writeHead(500).end(); }
  });
}).listen(process.env.PORT || 8081);

One thing to change before production: Stripe's webhooks page says to return a 2xx quickly, before any complex logic. This sample does its two calls (about two seconds) before answering to stay short. Answer 200 first and do the work from a queue. The same page says Stripe retries a delivery for up to three days in live mode, so a 500 on a failed call is not lost.

Run on 26 November 2026

The handler ran locally in dry-run mode (DRY_RUN=1). Two test events were built by hand, with the shape of the Stripe tax ID object and signed with the library's own helper, stripe.webhooks.generateTestHeaderString, and constructEvent verified them. Two further posts, one signed with another secret and one with an altered body, were refused with 400. A tax ID whose verification is still pending is flagged stripe_pending until the updated event follows. The two valid events called our API live with the demo key (4 credits in all). The write to Stripe was not run: it needs a Stripe account and a secret key, so the line stripe.customers.update was replaced by a print of what it would send:

signed -> 200
would write to cus_local {"prometiam_vies":"valid","prometiam_register_status":"active","prometiam_legal_name":"TELEFONICA SA","prometiam_vat_source":"rule","prometiam_review":"none","prometiam_review_reasons":""}
bad signature -> 400
altered body -> 400
would write to cus_local {"prometiam_vies":"invalid","prometiam_register_status":"not_found","prometiam_legal_name":"","prometiam_vat_source":"","prometiam_review":"review","prometiam_review_reasons":"vies_invalid,register_not_found,stripe_unverified"}
signed, second number -> 200

The first event is Telefonica's number marked verified by Stripe. The second is a made-up Spanish number (ESB00000000, not a real company) marked unverified: VIES says invalid, the register has no such company, and Stripe's own status is added to the reasons. Stripe's real events were not used, so the exact verification values for a real customer are the ones in Stripe's documentation, not observed here.

What it costs

  • 2 credits for each tax ID event: 1 for GET /vat/{number} and 1 for GET /companies/by-identifier. An error costs nothing.
  • Stripe sends an event on created and updated, so one new tax ID can cost 4 credits if you handle both. Handle only updated if the verification result is what you wait for.
  • Starter EUR 9.99 includes 1,000 credits a month, Professional EUR 29.99 10,000, Scale EUR 99.99 50,000, Enterprise on request. The 14-day trial includes 500 credits; a card is required and nothing is charged during it.

What it does not do

  • It does not replace Stripe Tax. Stripe Tax decides the rate, and, as Stripe states, applies the reverse charge from the number's format regardless of the verification result. This recipe only records evidence next to the customer.
  • It does not change a tax rate, block a payment or cancel a subscription. prometiam_review is a flag for a person.
  • GET /vat/{number} covers the 27 EU member states and Northern Ireland. VIES has no Norway or Switzerland, and GB VAT is out of scope here, so no_vat, ch_vat and gb_vat are not checked by this handler.
  • A VAT number built by rule (vat_number_source rule) has the right format; its registration is confirmed only by VIES.
  • It does not compare the customer's name or address with the register. Stripe's page says you still need to verify that. The handler stores the register name, and the comparison is yours.
  • It does not screen for sanctions. A sanctions screen is a separate call (GET /sanctions/screen, 3 credits, beta, not in the demo key) that this recipe does not make, and it covers listed names, not a clearance.
  • Register status comes from each country's register and its own scope, limits and delay, in the API documentation. Not every country's register publishes a VAT number.
  • A flag is a lead to review. Neither Stripe nor this recipe gives legal advice on tax treatment.

Related pages

Sign up · API documentation

The free trial lasts 14 days and includes 500 credits. A card is required and nothing is charged during the trial; it then continues as Starter (EUR 9.99/month) unless you cancel.

Frequently asked questions

Does Stripe check that the company exists?
Stripe's Customer Tax IDs page, read on 26 November 2026, describes validating the tax ID: its format for most types, and for EU VAT against VIES, GB VAT against HMRC and ABNs against the Australian Business Register. It does not describe a company register check, and says you still need to verify the name and address.
What does this recipe change in Stripe?
Six metadata keys on the customer, all prefixed prometiam_. Nothing else: no tax ID, no tax setting, no invoice. The write was not run for this page because it needs a Stripe account.
Is this a replacement for Stripe Tax?
No. Stripe Tax calculates and applies tax. This recipe records register and VIES evidence for a person to review.
Which Stripe tax ID types does it handle?
Only eu_vat. Other types are flagged for review without a call, because our VAT check covers EU member states and Northern Ireland and VIES has no Norway or Switzerland.
Can I use the demo key in production?
No. It is shared, capped at 30 calls a minute and 1,000 a day, and exists to try the calls. Create a key on a trial or a plan.