Stripe | Financial Infrastructure to Grow Your Revenue

Stripe | Financial Infrastructure to Grow Your Revenue

5282 articles

Collect customer tax IDs with Payment Intents


Collect customer tax IDs with Payment Intents

Use the Tax ID Element to collect business tax IDs from customers in your Payment Intents integration.

Collect customer tax IDs

Displaying a customer’s tax ID and legal business name on invoices is a common requirement. You can use the Tax ID Element to collect this information. This feature is in public preview.

Disclaimer

The Payment Intents API is designed to collect business tax IDs, which might have formats similar to personal tax IDs in certain jurisdictions. You must make sure that only business tax IDs, as designated for this field, are provided when using this feature.

Enable the beta

The Tax ID Element with the Payment Intents API requires you to enable the elements_tax_id_1 beta. Add the beta to your Stripe.js initialization:

const stripe = Stripe('pk_test_TYooMQauvdEDq54NiTphI7jx', {
 betas: ['elements_tax_id_1'],
});

Create a CustomerSession (optional)

To save tax IDs and redisplay them for returning customers, create a CustomerSession, which provides secure, temporary access to customer data without exposing your secret API key to the client.

If you don’t use CustomerSession, the Tax ID Element still works but without save and redisplay functionality. You can use getValue to read the tax ID values from the element and handle them manually.

Create or retrieve a Customer:

Command Line

Select a language

cURL

Stripe CLI

Ruby

Python

PHP

Java

Node.js

Go

.NET

No results

Create a CustomerSession with the Tax ID Element component enabled:

Command Line

Select a language

cURL

Stripe CLI

Ruby

Python

PHP

Java

Node.js

Go

.NET

No results

The CustomerSession returns a client_secret that you’ll pass to the client side.

Create a PaymentIntent or SetupIntent

Create a PaymentIntent or SetupIntent on your server. When using CustomerSession, include the customer reference parameter to enable tax ID save and redisplay functionality:

Command Line

Select a language

cURL

Stripe CLI

Ruby

Python

PHP

Java

Node.js

Go

.NET

No results

Note

You don’t need to include any tax-ID-specific parameters when creating the Payment Intent or Setup Intent. The Tax ID Element automatically handles tax ID collection and saves it to the Customer when using a Customer Session with the appropriate permissions.

Initialize Elements

Create an Elements instance using the clientSecret from your PaymentIntent or SetupIntent.

To enable saving tax IDs to a Customer and redisplaying them for returning customers, include the customerSessionClientSecret:

const stripe = Stripe('pk_test_TYooMQauvdEDq54NiTphI7jx', {
 betas: ['elements_tax_id_1'],
});

// Fetch the clientSecret from your server
const {clientSecret} = await fetch('/create-payment-intent', {
 method: 'POST',
 headers: { 'Content-Type': 'application/json' },
}).then((res) => res.json());

// Fetch the customerSessionClientSecret from your server
const {customerSessionClientSecret} = await fetch('/create-customer-session', {
 method: 'POST',
 headers: { 'Content-Type': 'application/json' },
}).then((res) => res.json());

const elements = stripe.elements({
 clientSecret,
 customerSessionClientSecret,
 appearance: { /* ... */ }
});

Create and mount the Tax ID Element

Create an instance of the Tax ID Element and mount it to your page:

<form id="payment-form">
 <div id="tax-id-element">
 <!--Stripe.js injects the Tax ID Element-->
 </div>
 <button type="submit">Pay</button>
</form>
const taxIdElement = elements.create('taxId', {
 visibility: 'auto', // 'auto' | 'always' | 'never'
});
taxIdElement.mount('#tax-id-element');

You can customize the Tax ID Element with options such as visibility, fields, and validation. See Create a Tax ID Element for more details.

Use with Address Element (optional)

When you use the Tax ID Element with the Address Element, Stripe automatically determines the tax ID type and element visibility based on the customer’s address.

Complete the payment

When the customer submits the payment form, call confirmPayment or confirmSetup. Stripe automatically includes the tax ID information and saves it to the Customer if the payment succeeds:

You can also use getValue on the client side to read the tax ID values before submitting the payment.

Test your integration

In testing environments, you can enter any alphanumeric string that is in the correct format of a supported tax ID type (for example, the related setting for eu_vat). For a full list of example tax IDs you can reference our Customer Tax ID guide. You can also use our test tax IDs to test various verification state flows.

Asynchronous Tax ID validation

During payment or setup confirmation, Stripe verifies that the provided tax IDs are formatted correctly, but not that they’re valid. You’re responsible for ensuring the validity of customer information.

Stripe automatically performs asynchronous validation against government databases for Australian Business Numbers (ABNs), European Value Added Tax (EU VAT), and United Kingdom Value Added Tax (GB VAT) numbers.

Stripe sends an event when verification finishes for a tax ID saved to either of these objects:

  • For a Customer , listen for the customer.tax_id.updated snapshot event. Inspect data.object.verification.status in the event.
  • For a customer-configured Account , listen for the v1.customer.tax_id.updated thin event. Retrieve the Tax ID referenced by related _ object , then inspect its verification.status .

The status is pending, verified, unverified, or unavailable.

Stripe reports the verification result, and you’re responsible for determining how to handle an unverified tax ID, based on your own compliance requirements. When automatic validation is unavailable, you must manually verify the tax ID.

If you use 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.

Real-time tax ID validation Preview

In addition to the asynchronous validation described above, you can enable synchronous, real-time tax ID verification directly in the Tax ID Element. When you enable it, Stripe verifies tax IDs against government databases as your customer types and displays the result inline before they submit the payment. Stripe currently supports real-time verification for Australian Business Numbers (ABNs), European Value Added Tax (EU VAT), and United Kingdom Value Added Tax (GB VAT) numbers. If a government database is unavailable, Stripe falls back to synchronous format validation and performs full verification asynchronously. This feature is in public preview and requires the elements_tax_id_verification_1 beta.

const taxIdElement = elements.create('taxId', {
 ...
 verification: {
 taxId: {
 mode: 'if_supported',
 },
 },
});

When you enable verification, the change event includes the verification.taxId.status field. Its value can be pending, verified, unverified, or unavailable. The element’s complete status reflects the verification result. See Create a Tax ID Element and Tax ID Element on Change for details.

Supported Tax ID types

The Tax ID Element supports tax ID collection in the following countries and regions:

CountryEnumDescriptionExampleImpact in Tax Calculation
Albaniaal_tinAlbania Tax Identification NumberJ12345678NYes
Angolaao_tinAngola Tax Identification Number5123456789No
Armeniaam_tinArmenia Tax Identification Number02538904Yes
Arubaaw_tinAruba Tax Identification Number12345678Yes
Australiaau_abnAustralian Business Number (AU ABN)12345678912Yes
Austriaeu_vatEuropean VAT numberATU12345678Yes
Azerbaijanaz_tinAzerbaijan Tax Identification Number0123456789Yes
Bahamasbs_tinBahamas Tax Identification Number123.456.789No
Bahrainbh_vatBahraini VAT Number123456789012345Yes
Bangladeshbd_binBangladesh Business Identification Number123456789-0123Yes
Barbadosbb_tinBarbados Tax Identification Number1123456789012No
Belarusby_tinBelarus TIN Number123456789Yes
Belgiumeu_vatEuropean VAT numberBE0123456789Yes
Beninbj_ifuBenin Tax Identification Number (Identifiant Fiscal Unique)1234567890123Yes
Bosnia & Herzegovinaba_tinBosnia and Herzegovina Tax Identification Number123456789012Yes
Bulgariaeu_vatEuropean VAT numberBG0123456789Yes
Burkina Fasobf_ifuBurkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique)12345678AYes
Cambodiakh_tinCambodia Tax Identification Number1001-123456789Yes
Camerooncm_niuCameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique)M123456789000LNo
Canadaca_bnCanadian BN123456789No
Canadaca_gst_hstCanadian GST/HST number123456789RT0002Yes
Canadaca_pst_bcCanadian PST number (British Columbia)PST-1234-5678No
Canadaca_pst_mbCanadian PST number (Manitoba)123456-7No
Canadaca_pst_skCanadian PST number (Saskatchewan)1234567No
Canadaca_qstCanadian QST number (Québec)1234567890TQ1234Yes
Cape Verdecv_nifCape Verde Tax Identification Number (Número de Identificação Fiscal)213456789No
Chilecl_tinChilean TIN12.345.678-KYes
Congo - Kinshasacd_nifCongo (DR) Tax Identification Number (Número de Identificação Fiscal)A0123456MNo
Costa Ricacr_tinCosta Rican tax ID1-234-567890No
Croatiaeu_vatEuropean VAT numberHR12345678912Yes
Cypruseu_vatEuropean VAT numberCY12345678ZYes
Czech Republiceu_vatEuropean VAT numberCZ1234567890Yes
Denmarkeu_vatEuropean VAT numberDK12345678Yes
Ecuadorec_rucEcuadorian RUC number1234567890001No
Egypteg_tinEgyptian Tax Identification Number123456789Yes
Estoniaeu_vatEuropean VAT numberEE123456789Yes
Ethiopiaet_tinEthiopia Tax Identification Number1234567890Yes
Finlandeu_vatEuropean VAT numberFI12345678Yes
Franceeu_vatEuropean VAT numberFRAB123456789Yes
Georgiage_vatGeorgian VAT123456789Yes
Germanyeu_vatEuropean VAT numberDE123456789Yes
Greeceeu_vatEuropean VAT numberEL123456789Yes
Guineagn_nifGuinea Tax Identification Number (Número de Identificação Fiscal)123456789Yes
Hungaryeu_vatEuropean VAT numberHU12345678Yes
Hungaryhu_tinHungary tax number (adószám)12345678-1-23No
Icelandis_vatIcelandic VAT123456Yes
Indiain_gstIndian GST number12ABCDE3456FGZHYes
Indonesiaid_npwpIndonesian the related setting number012.345.678.9-012.345No
Irelandeu_vatEuropean VAT numberIE1234567ABYes
Italyeu_vatEuropean VAT numberIT12345678912Yes
Kazakhstankz_binKazakhstani Business Identification Number123456789012Yes
Kenyake_pinKenya Revenue Authority Personal Identification NumberP000111111ANo
Kyrgyzstankg_tinKyrgyzstan Tax Identification Number12345678901234No
Laosla_tinLaos Tax Identification Number123456789-000No
Latviaeu_vatEuropean VAT numberLV12345678912Yes
Liechtensteinli_vatLiechtensteinian VAT number12345Yes
Lithuaniaeu_vatEuropean VAT numberLT123456789123Yes
Luxembourgeu_vatEuropean VAT numberLU12345678Yes
Maltaeu_vatEuropean VAT numberMT12345678Yes
Mauritaniamr_nifMauritania Tax Identification Number (Número de Identificação Fiscal)12345678No
Mexicomx_rfcMexican RFC numberABC010203AB9No
Moldovamd_vatMoldova VAT Number1234567Yes
Montenegrome_pibMontenegro PIB Number12345678No
Moroccoma_vatMorocco VAT Number12345678Yes
Nepalnp_panNepal PAN Number123456789Yes
Netherlandseu_vatEuropean VAT numberNL123456789B12Yes
New Zealandnz_gstNew Zealand GST number123456789Yes
Nigeriang_tinNigerian Tax Identification Number1234567890123No
North Macedoniamk_vatNorth Macedonia VAT NumberMK1234567890123Yes
Norwayno_vatNorwegian VAT number123456789MVAYes
Omanom_vatOmani VAT NumberOM1234567890Yes
Perupe_rucPeruvian RUC number12345678901Yes
Philippinesph_tinPhilippines Tax Identification Number123456789012Yes
Polandeu_vatEuropean VAT numberPL1234567890Yes
Polandpl_nipPolish NIP number1234567890No
Portugaleu_vatEuropean VAT numberPT123456789Yes
Romaniaeu_vatEuropean VAT numberRO1234567891Yes
Russiaru_innRussian INN1234567891Yes
Russiaru_kppRussian KPP123456789Yes
Saudi Arabiasa_vatSaudi Arabia VAT123456789012345Yes
Senegalsn_nineaSenegal the related setting Number12345672A2No
Serbiars_pibSerbian PIB number123456789No
Singaporesg_gstSingaporean GSTM12345678XYes
Slovakiaeu_vatEuropean VAT numberSK1234567891Yes
Sloveniaeu_vatEuropean VAT numberSI12345678Yes
South Africaza_vatSouth African VAT number4123456789Yes
South Koreakr_brnKorean BRN123-45-67890Yes
Spaines_cifSpanish NIF number (previously Spanish CIF number)A12345678No
Spaineu_vatEuropean VAT numberESA1234567ZYes
Sri Lankalk_vatSri Lanka VAT number123456789-1234Yes
Surinamesr_finSuriname FIN Number1234567890Yes
Swedeneu_vatEuropean VAT numberSE123456789123Yes
Switzerlandch_vatSwitzerland VAT number_CHE-123.456.789 the related settingYes
Taiwantw_vatTaiwanese VAT12345678Yes
Tajikistantj_tinTajikistan Tax Identification Number123456789Yes
Tanzaniatz_vatTanzania VAT Number12345678AYes
Thailandth_vatThai VAT1234567891234Yes
Turkeytr_tinTurkish Tax Identification Number0123456789Yes
Ugandaug_tinUganda Tax Identification Number1014751879Yes
Ukraineua_vatUkrainian VAT123456789Yes
United Arab Emiratesae_trnUnited Arab Emirates TRN123456789012345Yes
United Kingdomeu_vatNorthern Ireland VAT numberXI123456789Yes
United Kingdomgb_vatUnited Kingdom VAT numberGB123456789Yes
Uruguayuy_rucUruguayan RUC number123456789012Yes
Uzbekistanuz_tinUzbekistan TIN Number123456789No
Uzbekistanuz_vatUzbekistan VAT Number123456789012Yes
Vietnamvn_tinVietnamese tax ID number1234567890No
Zambiazm_tinZambia Tax Identification Number1004751879No
Zimbabwezw_tinZimbabwe Tax Identification Number1234567890No

Use tax IDs in calculations (optional)

In some cases, such as the cross-border supply of services, your customer might need to account for tax on a reverse charge basis. Instead of collecting the tax, you must issue an invoice with the text, “Tax to be paid on reverse charge basis.”

When you provide your customer’s tax IDs to Stripe Tax, we automatically determine when reverse charge applies:

Command Line

Select a language

cURL

Stripe CLI

Ruby

Python

PHP

Java

Node.js

Go

.NET

No results

If you provide a tax ID with an invalid format, the calculation returns a tax_id_invalid error code.

See also

Last verified 2026-09-24

Is this helpful?