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:
| Country | Enum | Description | Example | Impact in Tax Calculation |
|---|---|---|---|---|
| Albania | al_tin | Albania Tax Identification Number | J12345678N | Yes |
| Angola | ao_tin | Angola Tax Identification Number | 5123456789 | No |
| Armenia | am_tin | Armenia Tax Identification Number | 02538904 | Yes |
| Aruba | aw_tin | Aruba Tax Identification Number | 12345678 | Yes |
| Australia | au_abn | Australian Business Number (AU ABN) | 12345678912 | Yes |
| Austria | eu_vat | European VAT number | ATU12345678 | Yes |
| Azerbaijan | az_tin | Azerbaijan Tax Identification Number | 0123456789 | Yes |
| Bahamas | bs_tin | Bahamas Tax Identification Number | 123.456.789 | No |
| Bahrain | bh_vat | Bahraini VAT Number | 123456789012345 | Yes |
| Bangladesh | bd_bin | Bangladesh Business Identification Number | 123456789-0123 | Yes |
| Barbados | bb_tin | Barbados Tax Identification Number | 1123456789012 | No |
| Belarus | by_tin | Belarus TIN Number | 123456789 | Yes |
| Belgium | eu_vat | European VAT number | BE0123456789 | Yes |
| Benin | bj_ifu | Benin Tax Identification Number (Identifiant Fiscal Unique) | 1234567890123 | Yes |
| Bosnia & Herzegovina | ba_tin | Bosnia and Herzegovina Tax Identification Number | 123456789012 | Yes |
| Bulgaria | eu_vat | European VAT number | BG0123456789 | Yes |
| Burkina Faso | bf_ifu | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | 12345678A | Yes |
| Cambodia | kh_tin | Cambodia Tax Identification Number | 1001-123456789 | Yes |
| Cameroon | cm_niu | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | M123456789000L | No |
| Canada | ca_bn | Canadian BN | 123456789 | No |
| Canada | ca_gst_hst | Canadian GST/HST number | 123456789RT0002 | Yes |
| Canada | ca_pst_bc | Canadian PST number (British Columbia) | PST-1234-5678 | No |
| Canada | ca_pst_mb | Canadian PST number (Manitoba) | 123456-7 | No |
| Canada | ca_pst_sk | Canadian PST number (Saskatchewan) | 1234567 | No |
| Canada | ca_qst | Canadian QST number (Québec) | 1234567890TQ1234 | Yes |
| Cape Verde | cv_nif | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | 213456789 | No |
| Chile | cl_tin | Chilean TIN | 12.345.678-K | Yes |
| Congo - Kinshasa | cd_nif | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | A0123456M | No |
| Costa Rica | cr_tin | Costa Rican tax ID | 1-234-567890 | No |
| Croatia | eu_vat | European VAT number | HR12345678912 | Yes |
| Cyprus | eu_vat | European VAT number | CY12345678Z | Yes |
| Czech Republic | eu_vat | European VAT number | CZ1234567890 | Yes |
| Denmark | eu_vat | European VAT number | DK12345678 | Yes |
| Ecuador | ec_ruc | Ecuadorian RUC number | 1234567890001 | No |
| Egypt | eg_tin | Egyptian Tax Identification Number | 123456789 | Yes |
| Estonia | eu_vat | European VAT number | EE123456789 | Yes |
| Ethiopia | et_tin | Ethiopia Tax Identification Number | 1234567890 | Yes |
| Finland | eu_vat | European VAT number | FI12345678 | Yes |
| France | eu_vat | European VAT number | FRAB123456789 | Yes |
| Georgia | ge_vat | Georgian VAT | 123456789 | Yes |
| Germany | eu_vat | European VAT number | DE123456789 | Yes |
| Greece | eu_vat | European VAT number | EL123456789 | Yes |
| Guinea | gn_nif | Guinea Tax Identification Number (Número de Identificação Fiscal) | 123456789 | Yes |
| Hungary | eu_vat | European VAT number | HU12345678 | Yes |
| Hungary | hu_tin | Hungary tax number (adószám) | 12345678-1-23 | No |
| Iceland | is_vat | Icelandic VAT | 123456 | Yes |
| India | in_gst | Indian GST number | 12ABCDE3456FGZH | Yes |
| Indonesia | id_npwp | Indonesian the related setting number | 012.345.678.9-012.345 | No |
| Ireland | eu_vat | European VAT number | IE1234567AB | Yes |
| Italy | eu_vat | European VAT number | IT12345678912 | Yes |
| Kazakhstan | kz_bin | Kazakhstani Business Identification Number | 123456789012 | Yes |
| Kenya | ke_pin | Kenya Revenue Authority Personal Identification Number | P000111111A | No |
| Kyrgyzstan | kg_tin | Kyrgyzstan Tax Identification Number | 12345678901234 | No |
| Laos | la_tin | Laos Tax Identification Number | 123456789-000 | No |
| Latvia | eu_vat | European VAT number | LV12345678912 | Yes |
| Liechtenstein | li_vat | Liechtensteinian VAT number | 12345 | Yes |
| Lithuania | eu_vat | European VAT number | LT123456789123 | Yes |
| Luxembourg | eu_vat | European VAT number | LU12345678 | Yes |
| Malta | eu_vat | European VAT number | MT12345678 | Yes |
| Mauritania | mr_nif | Mauritania Tax Identification Number (Número de Identificação Fiscal) | 12345678 | No |
| Mexico | mx_rfc | Mexican RFC number | ABC010203AB9 | No |
| Moldova | md_vat | Moldova VAT Number | 1234567 | Yes |
| Montenegro | me_pib | Montenegro PIB Number | 12345678 | No |
| Morocco | ma_vat | Morocco VAT Number | 12345678 | Yes |
| Nepal | np_pan | Nepal PAN Number | 123456789 | Yes |
| Netherlands | eu_vat | European VAT number | NL123456789B12 | Yes |
| New Zealand | nz_gst | New Zealand GST number | 123456789 | Yes |
| Nigeria | ng_tin | Nigerian Tax Identification Number | 1234567890123 | No |
| North Macedonia | mk_vat | North Macedonia VAT Number | MK1234567890123 | Yes |
| Norway | no_vat | Norwegian VAT number | 123456789MVA | Yes |
| Oman | om_vat | Omani VAT Number | OM1234567890 | Yes |
| Peru | pe_ruc | Peruvian RUC number | 12345678901 | Yes |
| Philippines | ph_tin | Philippines Tax Identification Number | 123456789012 | Yes |
| Poland | eu_vat | European VAT number | PL1234567890 | Yes |
| Poland | pl_nip | Polish NIP number | 1234567890 | No |
| Portugal | eu_vat | European VAT number | PT123456789 | Yes |
| Romania | eu_vat | European VAT number | RO1234567891 | Yes |
| Russia | ru_inn | Russian INN | 1234567891 | Yes |
| Russia | ru_kpp | Russian KPP | 123456789 | Yes |
| Saudi Arabia | sa_vat | Saudi Arabia VAT | 123456789012345 | Yes |
| Senegal | sn_ninea | Senegal the related setting Number | 12345672A2 | No |
| Serbia | rs_pib | Serbian PIB number | 123456789 | No |
| Singapore | sg_gst | Singaporean GST | M12345678X | Yes |
| Slovakia | eu_vat | European VAT number | SK1234567891 | Yes |
| Slovenia | eu_vat | European VAT number | SI12345678 | Yes |
| South Africa | za_vat | South African VAT number | 4123456789 | Yes |
| South Korea | kr_brn | Korean BRN | 123-45-67890 | Yes |
| Spain | es_cif | Spanish NIF number (previously Spanish CIF number) | A12345678 | No |
| Spain | eu_vat | European VAT number | ESA1234567Z | Yes |
| Sri Lanka | lk_vat | Sri Lanka VAT number | 123456789-1234 | Yes |
| Suriname | sr_fin | Suriname FIN Number | 1234567890 | Yes |
| Sweden | eu_vat | European VAT number | SE123456789123 | Yes |
| Switzerland | ch_vat | Switzerland VAT number | _CHE-123.456.789 the related setting | Yes |
| Taiwan | tw_vat | Taiwanese VAT | 12345678 | Yes |
| Tajikistan | tj_tin | Tajikistan Tax Identification Number | 123456789 | Yes |
| Tanzania | tz_vat | Tanzania VAT Number | 12345678A | Yes |
| Thailand | th_vat | Thai VAT | 1234567891234 | Yes |
| Turkey | tr_tin | Turkish Tax Identification Number | 0123456789 | Yes |
| Uganda | ug_tin | Uganda Tax Identification Number | 1014751879 | Yes |
| Ukraine | ua_vat | Ukrainian VAT | 123456789 | Yes |
| United Arab Emirates | ae_trn | United Arab Emirates TRN | 123456789012345 | Yes |
| United Kingdom | eu_vat | Northern Ireland VAT number | XI123456789 | Yes |
| United Kingdom | gb_vat | United Kingdom VAT number | GB123456789 | Yes |
| Uruguay | uy_ruc | Uruguayan RUC number | 123456789012 | Yes |
| Uzbekistan | uz_tin | Uzbekistan TIN Number | 123456789 | No |
| Uzbekistan | uz_vat | Uzbekistan VAT Number | 123456789012 | Yes |
| Vietnam | vn_tin | Vietnamese tax ID number | 1234567890 | No |
| Zambia | zm_tin | Zambia Tax Identification Number | 1004751879 | No |
| Zimbabwe | zw_tin | Zimbabwe Tax Identification Number | 1234567890 | No |
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.
