Stripe | Financial Infrastructure to Grow Your Revenue

Stripe | Financial Infrastructure to Grow Your Revenue

4466 articles

Tax ID Element


Public preview

Tax ID Element Public preview

Collect business tax IDs for invoices and VAT refunds.

The Tax ID Element is an embeddable UI component that collects customer tax ID information. You can use the Tax ID Element with either the Elements with Checkout Sessions API or the Payment Intents API integrations.

For details about how to integrate the Tax ID Element, see the integration guide for your chosen approach:

Theme

Size

Customer Location

Visibility

Business name

If you don’t see the demo, try viewing this page in a supported browser.

OptionDescription
ThemeUse the dropdown to choose a theme or customize the theme with the Elements Appearance API.
Desktop and mobile sizeUse the dropdown to set the max pixel width of the parent element that the Tax ID Element is mounted to. You can set it to 750px (desktop) or 320px (mobile).
Customer locationUse the dropdown to choose a location for collecting tax ID information. Changing the location updates the tax ID type and format requirements, and controls element visibility in auto mode.
VisibilityUse the dropdown to choose a visibility mode. In auto mode, the Tax ID Element only displays for countries that support tax ID collection.
Business nameEnable this option to collect the business name. The collected business name appears as the customer name on invoices.

Supported regions

The Tax ID Element supports tax ID collection in the following countries and regions. When using auto mode, the element automatically displays only for customers in these supported locations. Each region has specific tax ID types and format requirements.

North America

South America

Europe

Asia

Oceania

Africa

When you use the Tax ID Element and the Address Element together, Stripe automatically determines the tax ID type and element visibility based on the customer’s address. This ensures the correct tax ID format is displayed for the customer’s location.

Visibility of the Tax ID Element

You can collect Tax IDs for a number of reasons but the most common reasons are to help calculate sales tax or to display on invoices.

The Tax ID Element adapts to the location of a customer by default, and it only shows if tax ID collection is common in their country. To determine if the tax ID is relevant, the Tax ID Element checks the customer’s IP address and country from the Address Element (in either shipping or billing mode). If the Address Element isn’t present, we use the customer’s IP address. If you want to make sure that you always show the Tax ID Element (even for countries that don’t typically collect tax IDs), you can set the visibility to always.

Control visibility with name_collection

When name_collection.business.enabled is true on the Checkout Session and the Tax ID Element is mounted, the Tax ID Element visibility changes based on how you configure the fields.businessName option.

If you don’t explicitly set visibility: never or fields.businessName: never, the SDK automatically overrides the following options:

  • visibility : always : The element always displays regardless of the customer’s country and overrides auto .
  • fields. businessName : always : The business name row always renders within the element.
  • validation. businessName. required : always : This applies only when name _ collection. business. optional : false . Stripe preserves your validation. businessName. required setting when optional : true .

In this case, the Tax ID Element collects the business name. If you also call updateBusinessName(), calling confirm() throws an error. To avoid this, unmount the Tax ID Element before calling updateBusinessName(). For customers in countries with no supported tax ID type, the tax ID type and value fields are hidden, and only the business name field is shown.

If you explicitly set fields.businessName to never or visibility to never, the SDK respects your choice and doesn’t apply overrides. In this case, collect the business name through your own input with updateBusinessName().

Create a Tax ID Element

Here’s how you can use the Tax ID Element with the Checkout Sessions API to collect tax IDs:

index.html

<div class="tax-id-form">
 <div id="tax-id-element"></div>
</div>

checkout.js

const stripe = window.Stripe('pk_test_TYooMQauvdEDq54NiTphI7jx', {
 betas: [
 'custom_checkout_tax_id_1',
 ],
});
const appearance = { /* appearance */ };
const elementsOptions = { appearance };

const clientSecret = fetch('/create-checkout-session', {
 method: 'POST',
 headers: {
 'Content-Type': 'application/json',
 },
 })
 .then((res) => res.json())
 .then((res) => {
 return res.clientSecret;
 });

const checkout = stripe.initCheckoutElementsSdk({
 clientSecret,
 elementsOptions
});

const taxIdElementOptions = {
 visibility: 'always',
};
const taxIdElement = checkout.createTaxIdElement(taxIdElementOptions);
taxIdElement.mount('#tax-id-element');

For more information about using the Tax ID Element with Checkout Sessions, see the Checkout Sessions integration guide.

Last verified 2026-09-24

Is this helpful?