Accéder directement au contenu
Créez un compte
ou
connecter-vous
Logo de la documentation Stripe
/
Demander à l'assistant IA
Créez un compte
Connectez-vous
Démarrer
Paiements
Revenus
Plateformes et places de marché
Gestion de fonds
Ressources pour les développeurs
Aperçu
À propos des paiements Stripe
Mettre votre intégration à niveau
Analyses des paiements
Paiements en ligne
PrésentationTrouver votre cas d'usageUse Managed Payments
Utiliser Payment Links
Utiliser une page de paiement préconfigurée
Build a custom integration with Elements
    Présentation
    Compare Checkout Sessions and PaymentIntents
    Quickstart guides
    Concevoir une intégration avancée
    Personnaliser l'apparence
    Gérer les moyens de paiement
    Collecter des informations supplémentaires
    Créer une intégration pour les abonnements
    Dynamic updates
    Ajouter des réductions
    Percevoir les taxes sur vos paiements
      Collecter des numéros fiscaux
    Offrir aux clients la possibilité de payer dans leur devise locale
    Enregistrer et récupérer les moyens de paiement des clients
    Envoyer des reçus ou factures après paiement
    Approuver manuellement les paiements sur votre serveur
    Autoriser et capturer un paiement séparément
    Liste des modifications de la version bêta d'Elements avec l'API Checkout Sessions
Développer une intégration dans l'application
Moyens de paiement
Ajouter des moyens de paiement
Gérer les moyens de paiement
Paiement accéléré avec Link
Interfaces de paiement
Payment Links
Checkout
Elements pour le web
Paiements dans l'application
Scénarios de paiement
Gérer plusieurs devises
Tunnels de paiement personnalisés
Acquisition flexible
Orchestration
Paiements par TPE
Terminal
Au-delà des paiements
Constituez votre entreprise
Cryptomonnaies
Financial Connections
Climate
Comprendre la fraude
Radar pour la protection contre la fraude
Gestion des litiges
Vérifier l'identité
AccueilPaiementsBuild a custom integration with ElementsCollect taxes on your payments

Remarque

Cette page n'est pas encore disponible dans cette langue. Nous faisons tout notre possible pour proposer notre documentation dans davantage de langues et nous vous fournirons la version traduite dès qu'elle sera disponible.

Collect customer tax IDs

Learn how to collect VAT and other customer tax IDs with Elements.

Payment Intents API

With the Payment Intents API, you must build your own UI components and functionality to collect and store tax IDs.

Displaying a customer’s tax ID and legal business name on invoices is a common requirement that you can satisfy by enabling tax ID collection. This guide assumes that you’ve integrated Elements with the Checkout Sessions API. If you haven’t completed this integration, see the quickstart guide.

Disclaimer

The Checkout Sessions 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 tax ID collection
Server-side

New customers

To enable tax ID collection for new customers, set tax_id_collection[enabled] to true when creating a Checkout Session.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d ui_mode=custom \ -d "line_items[0][price]"=
{{PRICE_ID}}
\ -d "line_items[0][quantity]"=1 \ -d "tax_id_collection[enabled]"=true \ -d mode=payment \ --data-urlencode return_url="https://example.com/return"

Existing customers

Create a Checkout Session with an existing customer to add any tax ID information collected during checkout. The session saves the business name as the customer’s name, and adds the collected tax ID to customer.tax_ids.

When creating the Checkout Session, you must set customer_update.name to auto to prevent overriding the customer’s existing [name].

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d ui_mode=custom \ -d customer=
{{CUSTOMER_ID}}
\ -d "line_items[0][price]"=
{{PRICE_ID}}
\ -d "line_items[0][quantity]"=1 \ -d "tax_id_collection[enabled]"=true \ -d "customer_update[name]"=auto \ -d mode=payment \ --data-urlencode return_url="https://example.com/return"

If you don’t have saved addresses for existing customers, you can use the billing or shipping address entered during checkout to assess their location. To use the billing address, set customer_update.address to auto. Setting this parameter to auto replaces the customer’s previously saved addresses with the address entered during checkout.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d ui_mode=custom \ -d customer=
{{CUSTOMER_ID}}
\ -d "line_items[0][price]"=
{{PRICE_ID}}
\ -d "line_items[0][quantity]"=1 \ -d "tax_id_collection[enabled]"=true \ -d "customer_update[name]"=auto \ -d "customer_update[address]"=auto \ -d mode=payment \ --data-urlencode return_url="https://example.com/return"

If you’re saving shipping addresses for existing customers, you can use the shipping address entered during checkout to assess their location. To use the shipping address, set customer_update.shipping to auto. Setting this parameter to auto replaces the customer’s previously saved shipping addresses with the address entered during checkout.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d ui_mode=custom \ -d customer=
{{CUSTOMER_ID}}
\ -d "line_items[0][price]"=
{{PRICE_ID}}
\ -d "line_items[0][quantity]"=1 \ -d "tax_id_collection[enabled]"=true \ -d "customer_update[name]"=auto \ -d "customer_update[shipping]"=auto \ -d "shipping_address_collection[allowed_countries][0]"=DE \ -d mode=payment \ --data-urlencode return_url="https://example.com/return"

This example creates a session in payment mode with tax ID collection enabled. For subscriptions, make the same changes with the mode set to subscription.

Render the Tax ID Element
Client-side
Public preview

Use Stripe’s Tax ID Element to collect tax IDs.

App.jsx
import {useMemo} from 'react', import {loadStripe} from '@stripe/stripe-js'; import {CheckoutProvider, TaxIdElement} from '@stripe/react-stripe-js/checkout'; const stripePromise = loadStripe(
'pk_test_TYooMQauvdEDq54NiTphI7jx'
, { betas: [ 'custom_checkout_tax_id_1', ], }); const App = () => { const fetchClientSecret = useMemo(() => { return fetch('/create-checkout-session', {method: 'POST'}) .then((res) => res.json()) .then((data) => data.clientSecret) }, []); return ( <CheckoutProvider stripe={stripePromise} options={{ fetchClientSecret: () => fetchClientSecret, }} > <TaxIdElement /> <CheckoutProvider> ); };

FacultatifCustom client-side implementation
Client-side

Rather than rendering the Tax ID Element, you can also implement your own custom form for full control over the UI and validation.

Create a form in your web application and use updateTaxIdInfo to collect the customer’s business name and tax ID.

App.jsx
import {useState} from 'react'; import {useCheckout} from '@stripe/react-stripe-js/checkout'; // Create a constant to list out the taxID types you'd like to support in your checkout const TAX_ID_TYPES = ['au_abn', 'eu_vat', ...] as const; const TaxIdCollectionForm = () => { const [isPurchaseAsBusiness, setIsPurchaseAsBusiness] = useState(false); const [isEditing, setIsEditing] = useState(true); const [businessName, setBusinessName] = useState(''); const [taxIdType, setTaxIdType] = useState(''); const [taxIdValue, setTaxIdValue] = useState(''); const [errorMessage, setErrorMessage] = useState(''); const checkoutState = useCheckout(); if (checkoutState.type === 'loading') { return ( <div>Loading...</div> ); } else if (checkoutState.type === 'error') { return ( <div>Error: {checkoutState.error.message}</div> ); } const {updateTaxIdInfo} = checkoutState.checkout; const validateAndUpdate = async () => { if (!businessName) { setErrorMessage('Business name is required'); return; }

Retrieve the customer tax ID details after a session

Checkout includes provided tax IDs on the resulting Session object. After each completed Session, Checkout emits a checkout.session.completed event that you can listen for in a webhook endpoint. If you want to retrieve the collected tax ID from the Session object, it’s available under the Session’s customer_details.tax_ids array:

{ "object": { "id": "cs_test_a1dJwt0TCJTBsDkbK7RcoyJ91vJxe2Y", "object": "checkout.session", ... "customer": "cus_id_of_new_customer", "customer_details": { ... "tax_ids": [ { "type": "eu_vat", "value": "FRAB123456789" } ] }, ... "tax_id_collection": { "enabled": true }, ... } }

Checkout also saves collected tax IDs and business names to the Customer object if one is associated with the Session. A tax ID collected during checkout is accessible under the Customer’s customer.tax_ids array. You can also retrieve all tax IDs saved to a Customer with the Tax IDs resource by specifying the owner.type parameter to customer and owner.customer to the Customer’s ID. Every new tax ID includes an associated legal business name, which Checkout saves to the Customer’s name property. In doing so, the collected legal business name is always visible on any subscription invoices for that Customer.

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, DE123456789 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.

Validation

During the Checkout Session, 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 collected during checkout. To help, Stripe automatically performs asynchronous validation against government databases for European Value Added Tax (EU VAT) and United Kingdom Value Added Tax (GB VAT) numbers. Learn more about the validation we perform, and how to consume the status of those checks.

If you use Stripe Tax and your customer provides a tax ID, Stripe Tax applies the reverse charge or zero rate according to applicable laws, as long as the tax ID conforms to the necessary number format, regardless of its validity.

Supported tax ID types

The Checkout Session collects the following tax ID types in the given regions:

PaysEnumDescriptionExemple
Impact sur le calcul des taxes
Afrique du Sudza_vatNuméro de TVA sud-africain4123456789Oui
Albanieal_tinNuméro d'identification fiscale albanaisJ12345678NOui
Allemagneeu_vatEuropean VAT numberDE123456789Oui
Angolaao_tinNuméro fiscal de l'Angola5123456789Non
Arabie saouditesa_vatTVA Arabie Saoudite123456789012345Oui
Arménieam_tinNuméro fiscal de l’Arménie02538904Oui
Arubaaw_tinNuméro fiscal d’Aruba12345678Oui
Australieau_abnNuméro d'identification australien (AU ABN)12345678912Oui
Autricheeu_vatEuropean VAT numberATU12345678Oui
Azerbaïdjanaz_tinNuméro fiscal de l’Azerbaïdjan0123456789Oui
Bahamasbs_tinNuméro fiscal des Bahamas123.456.789Non
Bahreïnbh_vatNuméro de TVA bahreïnien123456789012345Oui
Bangladeshbd_binNuméro d’identification d’entreprise du Bangladesh123456789-0123Oui
Barbadebb_tinNuméro fiscal de la Barbade1123456789012Non
Belgiqueeu_vatEuropean VAT numberBE0123456789Oui
Béninbj_ifuNuméro fiscale du Bénin (Identifiant fiscal unique)1234567890123Oui
Biélorussieby_tinNuméro d'identification fiscale de la Biélorussie123456789Oui
Bosnie-Herzégovineba_tinNuméro fiscal de la Bosnie-Herzégovine123456789012Oui
Bulgarieeu_vatEuropean VAT numberBG0123456789Oui
Burkina Fasobf_ifuNuméro fiscal du Burkina Faso (Numéro d'Identifiant fiscal unique)12345678AOui
Cambodgekh_tinNuméro fiscal du Cambodge1001-123456789Oui
Camerouncm_niuNuméro fiscale du Cameroun (Numéro d’Identifiant fiscal unique)M123456789000LNon
Canadaca_bnNuméro BN canadien123456789Non
Canadaca_gst_hstNuméro GST/HST canadien123456789RT0002Oui
Canadaca_pst_bcNuméro PST canadien (Colombie-Britannique)PST-1234-5678Non
Canadaca_pst_mbNuméro PST canadien (Manitoba)123456-7Non
Canadaca_pst_skNuméro PST canadien (Saskatchewan)1234567Non
Canadaca_qstNuméro QST canadien (Québec)1234567890TQ1234Oui
Cap-Vertcv_nifNuméro fiscal du Cap-Vert (Número de Identificação Fiscal)213456789Non
Chilicl_tinNuméro TIN chilien12.345.678-KOui
Chypreeu_vatEuropean VAT numberCY12345678ZOui
Congo-Kinshasacd_nifNuméro fiscal de la République démocratique du Congo (Número de Identificação Fiscal)A0123456MNon
Corée du Sudkr_brnNuméro BRN coréen123-45-67890Oui
Costa Ricacr_tinNuméro fiscal du Costa Rica1-234-567890Non
Croatieeu_vatEuropean VAT numberHR12345678912Oui
Danemarkeu_vatEuropean VAT numberDK12345678Oui
Égypteeg_tinNuméro d'identification fiscale égyptien123456789Oui
Émirats arabes unisae_trnNuméro TRN des Émirats arabes unis123456789012345Oui
Équateurec_rucNuméro RUC équatorien1234567890001Non
Espagnees_cifNuméro NIF espagnol (auparavant numéro CIF espagnol)A12345678Non
Espagneeu_vatEuropean VAT numberESA1234567ZOui
Estonieeu_vatEuropean VAT numberEE123456789Oui
Éthiopieet_tinNuméro fiscal de l’Éthiopie1234567890Oui
Finlandeeu_vatEuropean VAT numberFI12345678Oui
Franceeu_vatEuropean VAT numberFRAB123456789Oui
Géorgiege_vatTVA Géorgie123456789Oui
Grèceeu_vatEuropean VAT numberEL123456789Oui
Guinéegn_nifNuméro fiscal de la Guinée (Número de Identificação Fiscal)123456789Oui
Hongrieeu_vatEuropean VAT numberHU12345678Oui
Indein_gstNuméro GST indien12ABCDE3456FGZHOui
Irlandeeu_vatEuropean VAT numberIE1234567ABOui
Islandeis_vatTVA Islande123456Oui
Italieeu_vatEuropean VAT numberIT12345678912Oui
Kazakhstankz_binNuméro d'identification de l'entreprise kazakhe123456789012Oui
Kenyake_pinNuméro d'identification personnel de la Kenya Revenue AuthorityP000111111ANon
Kirghizistankg_tinNuméro fiscal du Kirghizistan12345678901234Non
Laosla_tinNuméro fiscal du Laos123456789-000Non
Lettonieeu_vatEuropean VAT numberLV12345678912Oui
Liechtensteinli_vatNuméro de TVA au Liechtenstein12345Oui
Lituanieeu_vatEuropean VAT numberLT123456789123Oui
Luxembourgeu_vatEuropean VAT numberLU12345678Oui
Macédoine du Nordmk_vatNuméro de TVA de la Macédoine du NordMK1234567890123Oui
Malteeu_vatEuropean VAT numberMT12345678Oui
Marocma_vatNuméro de TVA du Maroc12345678Oui
Mauritaniemr_nifNuméro fiscal de la Mauritanie (Número de Identificação Fiscal)12345678Non
Mexiquemx_rfcNuméro RFC mexicainABC010203AB9Non
Moldaviemd_vatNuméro de TVA de la Moldavie1234567Oui
Monténégrome_pibNuméro PIB du Monténégro12345678Non
Népalnp_panNuméro PAN du Népal123456789Oui
Nigériang_tinNuméro fiscal nigérian12345678-0001Non
Norvègeno_vatNuméro de TVA norvégien123456789MVAOui
Nouvelle-Zélandenz_gstNuméro GST Nouvelle-Zélande123456789Oui
Omanom_vatNuméro de TVA omanaisOM1234567890Oui
Ougandaug_tinNuméro fiscal de l’Ouganda1014751879Oui
Ouzbékistanuz_tinNuméro d'identification fiscale de l'Ouzbékistan123456789Non
Ouzbékistanuz_vatNuméro de TVA de l'Ouzbékistan123456789012Oui
Pays-Baseu_vatEuropean VAT numberNL123456789B12Oui
Péroupe_rucNuméro RUC péruvien12345678901Oui
Philippinesph_tinNuméro d'identification fiscale philippin123456789012Oui
Pologneeu_vatEuropean VAT numberPL1234567890Oui
Portugaleu_vatEuropean VAT numberPT123456789Oui
République tchèqueeu_vatEuropean VAT numberCZ1234567890Oui
Roumanieeu_vatEuropean VAT numberRO1234567891Oui
Royaume-Unieu_vatNorthern Ireland VAT numberXI123456789Oui
Royaume-Unigb_vatNuméro de TVA du Royaume-UniGB123456789Oui
Russieru_innNuméro INN russe1234567891Oui
Russieru_kppNuméro KPP russe123456789Oui
Sénégalsn_nineaNuméro NINEA du Sénégal12345672A2Non
Serbiers_pibNuméro PIB de la Serbie123456789Non
Singapoursg_gstNuméro GST singapourienM12345678XOui
Slovaquieeu_vatEuropean VAT numberSK1234567891Oui
Slovénieeu_vatEuropean VAT numberSI12345678Oui
Suèdeeu_vatEuropean VAT numberSE123456789123Oui
Suissech_vatNuméro de TVA suisseCHE-123.456.789 MWSTOui
Surinamesr_finNuméro FIN du Suriname1234567890Oui
Tadjikistantj_tinNuméro fiscal du Tadjikistan123456789Oui
Taïwantw_vatTVA Taïwan12345678Oui
Tanzanietz_vatNuméro de TVA de la Tanzanie12345678AOui
Thaïlandeth_vatTVA Thaïlande1234567891234Oui
Turquietr_tinNuméro d'identification fiscale turc0123456789Oui
Ukraineua_vatTVA Ukraine123456789Oui
Uruguayuy_rucNuméro RUC uruguayen123456789012Oui
Zambiezm_tinNuméro fiscal de la Zambie1004751879Non
Zimbabwezw_tinNuméro fiscal du Zimbabwe1234567890Non
Cette page vous a-t-elle été utile ?
OuiNon
  • Besoin d'aide ? Contactez le service Support.
  • Rejoignez notre programme d'accès anticipé.
  • Consultez notre log des modifications.
  • Des questions ? Contactez l'équipe commerciale.
  • LLM ? Lire llms.txt.
  • Propulsé par Markdoc