Ir a contenido
Crea una cuenta
o
inicia sesión
Logotipo de la documentación de Stripe
/
Pregúntale a la IA
Crear cuenta
Iniciar sesión
Empezar
Pagos
Automatización de finanzas
Plataformas y marketplaces
Gestión del dinero
Herramientas para desarrolladores
Empezar
Pagos
Automatización de finanzas
Empezar
Pagos
Automatización de finanzas
Plataformas y marketplaces
Gestión del dinero
Resumen
Acerca de Stripe Payments
Actualiza tu integración
Análisis de pagos
Pagos por Internet
ResumenEncuentra tu caso de usoManaged Payments
Utiliza Payment Links
Crear una página del proceso de compra
    Resumen
    Guías de inicio rápido
    Personaliza el estilo
    Recolecta información adicional
    Cobrar impuestos
      Usar tipos impositivos manuales
      Recopilar los ID fiscales
    Actualiza forma dinámica el proceso de compra
    Gestiona tu catálogo de productos
    Suscripciones
    Gestiona los métodos de pago
    Permite que los clientes paguen en su divisa local
    Añade descuentos, ventas de productos de más valor y artículos opcionales
    Configurar pagos futuros
    Guardar datos de pago durante el pago
    Acepta pagos manualmente en tu servidor
    Después del pago
    Elements con registro de cambios beta de la API Checkout Sessions
    Migrar desde Checkout heredado
    Migrar Checkout para usar precios
Desarrolla una integración avanzada
Desarrolla una integración en la aplicación
Métodos de pago
Añadir métodos de pago
Gestiona los métodos de pago
Proceso de compra más rápido con Link
Interfaces de pago
Payment Links
Checkout
Elements para la web
Elements en la aplicación
Escenarios de pago
Flujos de pagos personalizados
Capacidad adquirente flexible
Orquestación
Pagos en persona
Terminal
Otros productos de Stripe
Financial Connections
Criptomonedas
Climate
InicioPagosBuild a checkout pageCollect taxes

Collect customer tax IDs with Checkout

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

Copia la página

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 in Checkout. This guide assumes that you’ve already integrated Checkout. If you haven’t, see the Accept a payment guide.

Enable Tax ID collection

With tax ID collection enabled, Checkout shows and hides the tax ID collection form depending on your customer’s location. If your customer is in a location supported by tax ID collection, Checkout shows a checkbox allowing the customer to indicate that they’re purchasing as a business. When a customer checks the box, Checkout displays fields for them to enter the tax ID and legal entity name for the business. If available, Checkout uses the customer’s shipping address to determine their location, otherwise Checkout uses the customer’s billing address. Customers can only enter one tax ID.

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
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "line_items[0][price_data][unit_amount]"=1000 \ -d "line_items[0][price_data][product_data][name]"=T-shirt \ -d "line_items[0][price_data][currency]"=eur \ -d "line_items[0][quantity]"=2 \ -d "tax_id_collection[enabled]"=true \ -d mode=payment \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel"

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.

You can additionally configure Checkout to create a new Customer for you using customer_creation. If you do, Checkout saves any tax ID information collected during a Session to that new Customer. If not, the tax ID information will still be available at customer_details.tax_ids.

Existing Customers

If you pass an existing Customer when creating a Session, Checkout updates the Customer with any tax ID information collected during the Session. Checkout saves the collected business name onto the Customer’s name property, and adds the collected tax ID to the Customer’s customer.tax_ids array. Since the collection of a business name could result in the Customer’s existing name being overridden, you must set customer_update.name to auto when creating the Session.

Precaución

Checkout only collects tax IDs on Customers that don’t already have an existing tax ID. If a Customer has one or more tax IDs saved, Checkout doesn’t display the tax ID collection form even if tax ID collection is enabled.

When collecting tax IDs for existing customers you can either base their location on existing addresses on the customer or the addresses entered during checkout. By default, Checkout looks for existing addresses on the customer to assess their location:

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d customer=
{{CUSTOMER_ID}}
\ -d "line_items[0][price_data][unit_amount]"=1000 \ -d "line_items[0][price_data][product_data][name]"=T-shirt \ -d "line_items[0][price_data][currency]"=eur \ -d "line_items[0][quantity]"=2 \ -d "tax_id_collection[enabled]"=true \ -d "customer_update[name]"=auto \ -d mode=payment \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel"

If you don’t have the addresses of your existing customers saved, you can base their location on the billing or shipping address entered during Checkout. To specify that you want to use the billing address entered during Checkout to assess the customer’s location, you must set customer_update.address to auto. When setting customer_update.address to auto, Checkout replaces any previously saved addresses on the customer with the address entered during the session.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d customer=
{{CUSTOMER_ID}}
\ -d "line_items[0][price_data][unit_amount]"=1000 \ -d "line_items[0][price_data][product_data][name]"=T-shirt \ -d "line_items[0][price_data][currency]"=eur \ -d "line_items[0][quantity]"=2 \ -d "tax_id_collection[enabled]"=true \ -d "customer_update[name]"=auto \ -d "customer_update[address]"=auto \ -d mode=payment \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel"

If you’re collecting shipping addresses for existing customers, you must base their location on the shipping address entered during checkout. To do so, set customer_update.shipping to auto. When setting customer_update.shipping to auto, Checkout replaces any previously saved shipping addresses on the customer with the shipping address entered during the session.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d customer=cus_HQmikpKnGHkNwW \ -d "line_items[0][price_data][unit_amount]"=1000 \ -d "line_items[0][price_data][product_data][name]"=T-shirt \ -d "line_items[0][price_data][currency]"=eur \ -d "line_items[0][quantity]"=2 \ -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 success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel"

The above code example creates a Session in payment mode with tax ID collection enabled. For subscriptions, make the same changes with the mode set to subscription.

OpcionalRequire tax ID collection

Retrieve 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

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

PaísEnumeraciónDescripciónEjemplo
Impacto en el cálculo de impuestos
Albaniaal_tinNúmero de identificación fiscal de AlbaniaJ12345678NSí
Alemaniaeu_vatEuropean VAT numberDE123456789Sí
Angolaao_tinNúmero de identificación fiscal de Angola5123456789No
Arabia Saudísa_vatIVA de Arabia Saudita123456789012345Sí
Armeniaam_tinNúmero de identificación fiscal de Armenia02538904Sí
Arubaaw_tinNúmero de identificación fiscal de Aruba12345678Sí
Australiaau_abnNúmero de empresa australiana (AU ABN)12345678912Sí
Austriaeu_vatEuropean VAT numberATU12345678Sí
Azerbaiyánaz_tinNúmero de identificación fiscal de Azerbaiyán0123456789Sí
Bahamasbs_tinNúmero de identificación fiscal de Bahamas123.456.789No
Bangladésbd_binNúmero de identificación de empresa de Bangladesh123456789-0123Sí
Barbadosbb_tinNúmero de identificación fiscal de Barbados1123456789012No
Baréinbh_vatNúmero de IVA de Baréin123456789012345Sí
Bélgicaeu_vatEuropean VAT numberBE0123456789Sí
Benínbj_ifuNúmero de identificación fiscal de Benín («Identifiant Fiscal Unique»)1234567890123Sí
Bielorrusiaby_tinNúmero TIN de Bielorrusia123456789Sí
Bosnia y Herzegovinaba_tinNúmero de identificación fiscal de Bosnia y Herzegovina123456789012Sí
Bulgariaeu_vatEuropean VAT numberBG0123456789Sí
Burkina Fasobf_ifuNúmero de identificación fiscal de Burkina Faso («Numéro d'Identifiant Fiscal Unique»)12345678ASí
Cabo Verdecv_nifNúmero de Identificación Fiscal de Cabo Verde213456789No
Camboyakh_tinNúmero de identificación fiscal de Camboya1001-123456789Sí
Camerúncm_niuNúmero de identificación fiscal de Camerún («Numéro d'Identifiant fiscal Unique»)M123456789000LNo
Canadáca_bnBN de Canadá123456789No
Canadáca_gst_hstNúmero GST/HST de Canadá123456789RT0002Sí
Canadáca_pst_bcNúmero PST de Canadá (Columbia Británica)PST-1234-5678No
Canadáca_pst_mbNúmero PST de Canadá (Manitoba)123456-7No
Canadáca_pst_skNúmero PST (Saskatchewan) de Canadá1234567No
Canadáca_qstNúmero QST de Canadá (Quebec)1234567890TQ1234Sí
Chilecl_tinTIN de Chile12.345.678-KSí
Chipreeu_vatEuropean VAT numberCY12345678ZSí
Corea del Surkr_brnBRN de Corea123-45-67890Sí
Costa Ricacr_tinID fiscal costarricense1-234-567890No
Croaciaeu_vatEuropean VAT numberHR12345678912Sí
Dinamarcaeu_vatEuropean VAT numberDK12345678Sí
Ecuadorec_rucNúmero de RUC ecuatoriano1234567890001No
Egiptoeg_tinNúmero de identificación fiscal de Egipto123456789Sí
Emiratos Árabes Unidosae_trnTRN de los Emiratos Árabes Unidos123456789012345Sí
Eslovaquiaeu_vatEuropean VAT numberSK1234567891Sí
Esloveniaeu_vatEuropean VAT numberSI12345678Sí
Españaes_cifNúmero de NIF español (anteriormente número de CIF español)A12345678No
Españaeu_vatEuropean VAT numberESA1234567ZSí
Estoniaeu_vatEuropean VAT numberEE123456789Sí
Etiopíaet_tinNúmero de identificación fiscal de Etiopía1234567890Sí
Filipinasph_tinNúmero de identificación fiscal de Filipinas123456789012Sí
Finlandiaeu_vatEuropean VAT numberFI12345678Sí
Franciaeu_vatEuropean VAT numberFRAB123456789Sí
Georgiage_vatIVA de Georgia123456789Sí
Greciaeu_vatEuropean VAT numberEL123456789Sí
Guineagn_nifNúmero de Identificación Fiscal de Guinea (Número de Identificação Fiscal)123456789Sí
Hungríaeu_vatEuropean VAT numberHU12345678Sí
Indiain_gstNúmero de GST de India12ABCDE3456FGZHSí
Irlandaeu_vatEuropean VAT numberIE1234567ABSí
Islandiais_vatIVA de Islandia123456Sí
Italiaeu_vatEuropean VAT numberIT12345678912Sí
Kazajistánkz_binNúmero de identificación comercial de Kazajstán123456789012Sí
Keniake_pinNúmero de identificación personal de la Agencia Tributaria de KeniaP000111111ANo
Kirguistánkg_tinNúmero de identificación fiscal de Kirguistán12345678901234No
Laosla_tinNúmero de identificación fiscal de Laos123456789-000No
Letoniaeu_vatEuropean VAT numberLV12345678912Sí
Liechtensteinli_vatNúmero de IVA de Liechtenstein12345Sí
Lituaniaeu_vatEuropean VAT numberLT123456789123Sí
Luxemburgoeu_vatEuropean VAT numberLU12345678Sí
Macedonia del Nortemk_vatNúmero de IVA de Macedonia del NorteMK1234567890123Sí
Maltaeu_vatEuropean VAT numberMT12345678Sí
Marruecosma_vatNúmero de IVA de Marruecos12345678Sí
Mauritaniamr_nifNúmero de Identificación Fiscal de Mauritania (Número de Identificação Fiscal)12345678No
Méxicomx_rfcNúmero RFC de MéxicoABC010203AB9No
Moldaviamd_vatNúmero de IVA de Moldavia1234567Sí
Montenegrome_pibNúmero PIB de Montenegro12345678No
Nepalnp_panNúmero PAN de Nepal123456789Sí
Nigeriang_tinNúmero de identificación fiscal de Nigeria12345678-0001No
Noruegano_vatNúmero de IVA de Noruega123456789MVASí
Nueva Zelandanz_gstNúmero de GST de Nueva Zelanda123456789Sí
Ománom_vatNúmero de IVA de OmánOM1234567890Sí
Países Bajoseu_vatEuropean VAT numberNL123456789B12Sí
Perúpe_rucNúmero de RUC peruano12345678901Sí
Poloniaeu_vatEuropean VAT numberPL1234567890Sí
Portugaleu_vatEuropean VAT numberPT123456789Sí
Reino Unidoeu_vatNorthern Ireland VAT numberXI123456789Sí
Reino Unidogb_vatNúmero de IVA del Reino UnidoGB123456789Sí
República Checaeu_vatEuropean VAT numberCZ1234567890Sí
República Democrática del Congocd_nifNúmero de identificación fiscal de Congo (RD) (Número de Identificação Fiscal)A0123456MNo
Rumaníaeu_vatEuropean VAT numberRO1234567891Sí
Rusiaru_innINN de Rusia1234567891Sí
Rusiaru_kppKPP de Rusia123456789Sí
Senegalsn_nineaNúmero NINEA de Senegal12345672A2No
Serbiars_pibNúmero de PIB serbio123456789No
Singapursg_gstGST de SingapurM12345678XSí
Sudáfricaza_vatNúmero de IVA de Sudáfrica4123456789Sí
Sueciaeu_vatEuropean VAT numberSE123456789123Sí
Suizach_vatNúmero de IVA de SuizaCHE-123.456.789 MWSTSí
Surinamsr_finNúmero FIN de Surinam1234567890Sí
Tailandiath_vatIVA de Tailandia1234567891234Sí
Taiwántw_vatIVA de Taiwán12345678Sí
Tanzaniatz_vatNúmero de IVA de Tanzania12345678ASí
Tayikistántj_tinNúmero de identificación fiscal de Tayikistán123456789Sí
Turquíatr_tinNúmero de identificación fiscal de Turquía0123456789Sí
Ucraniaua_vatIVA de Ucrania123456789Sí
Ugandaug_tinNúmero de identificación fiscal de Uganda1014751879Sí
Uruguayuy_rucNúmero de RUC uruguayo123456789012Sí
Uzbekistánuz_tinNúmero TIN de Uzbekistán123456789No
Uzbekistánuz_vatNúmero de IVA de Uzbekistán123456789012Sí
Zambiazm_tinNúmero de identificación fiscal de Zambia1004751879No
Zimbabuezw_tinNúmero de identificación fiscal de Zimbabue1234567890No
¿Te ha sido útil la página?
SíNo
¿Necesitas ayuda? Ponte en contacto con el equipo de soporte.
Únete a nuestro programa de acceso anticipado.
Echa un vistazo a nuestro registro de cambios.
¿Tienes alguna pregunta? Ponte en contacto con el equipo de ventas.
¿LLM? Lee llms.txt.
Con tecnología de Markdoc