Pular para o conteúdo
Criar conta
ou
Entrar
O logotipo da documentação da Stripe
/
Pergunte à IA
Criar conta
Login
Comece já
Pagamentos
Receita
Plataformas e marketplaces
Gestão de valores
Recursos para desenvolvedores
Visão geral
Sobre os pagamentos da Stripe
Atualize sua integração
Análise de pagamentos
Pagamentos online
Visão geralEncontre seu caso de usoPagamentos gerenciados
Usar Payment Links
Crie uma página de checkout
    Visão geral
    Inícios rápidos
    Personalizar a aparência
    Coletar informações adicionais
    Colete impostos
      Usar alíquotas manuais
      Colete identificações fiscais
    Atualizar checkout dinamicamente
    Gerencie seu catálogo de produtos
    Assinaturas
    Gerenciar formas de pagamento
    Permita que os clientes paguem na moeda local
    Adicione descontos, upsells e itens opcionais
    Configurar pagamentos futuros
    Salvar dados de pagamento durante o pagamento
    Aprovar manualmente pagamentos no servidor
    Após o pagamento
    Elements com changelog beta da API Checkout Sessions
    Migrar do Checkout antigo
    Migrar o Checkout para usar Prices
Criar uma integração avançada
Crie uma integração no aplicativo
Formas de pagamento
Adicionar formas de pagamento
Gerenciar formas de pagamento
Checkout mais rápido com o Link
Interfaces de pagamento
Payment Links
Checkout
Web Elements
Elements no aplicativo
Cenários de pagamento
Gerenciar várias moedas
Fluxos de pagamento personalizados
Aquisição flexível
Orquestração
Pagamentos presenciais
Terminal
Muito mais que pagamentos
Abra sua empresa
Cripto
Financial Connections
Climate
Página inicialPagamentosBuild a checkout pageCollect taxes

Collect customer tax IDs with Checkout

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

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
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
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.

Cuidado

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
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
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
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
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
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
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ísEnumeraçãoDescriçãoExemplo
Impacto no cálculo de impostos
África do Sulza_vatNúmero de IVA sul-africano4123456789Sim
Albâniaal_tinNúmero de Identificação Fiscal da AlbâniaJ12345678NSim
Alemanhaeu_vatEuropean VAT numberDE123456789Sim
Angolaao_tinNúmero de Identificação Fiscal de Angola5123456789Não
Arábia Sauditasa_vatIVA da Arábia Saudita123456789012345Sim
Armêniaam_tinNúmero de Identificação Fiscal da Armênia02538904Sim
Arubaaw_tinNúmero de Identificação Fiscal de Aruba12345678Sim
Austráliaau_abnNúmero Comercial Australiano (ABN da Austrália)12345678912Sim
Áustriaeu_vatEuropean VAT numberATU12345678Sim
Azerbaijãoaz_tinNúmero de Identificação Fiscal do Azerbaijão0123456789Sim
Bahamasbs_tinNúmero de Identificação Fiscal das Bahamas123.456.789Não
Bahreinbh_vatNúmero de IVA do Barein123456789012345Sim
Bangladeshbd_binNúmero de Identificação Comercial de Bangladesh123456789-0123Sim
Barbadosbb_tinNúmero de Identificação Fiscal de Barbados1123456789012Não
Bélgicaeu_vatEuropean VAT numberBE0123456789Sim
Beninbj_ifuNúmero de Identificação Fiscal do Benim (Identifiant Fiscal Unique)1234567890123Sim
Bielorrússiaby_tinNúmero TIN da Bielorrússia123456789Sim
Bósnia e Herzegovinaba_tinNúmero de Identificação Fiscal da Bósnia e Herzegovina123456789012Sim
Bulgáriaeu_vatEuropean VAT numberBG0123456789Sim
Burquina Fasobf_ifuNúmero de Identificação Fiscal do Burkina Faso (Numéro d'Identifiant Fiscal Unique)12345678ASim
Cabo Verdecv_nifNúmero de Identificação Fiscal de Cabo Verde213456789Não
Camarõescm_niuNúmero de Identificação Fiscal dos Camarões (Numéro d'Identifiant fiscal Unique)M123456789000LNão
Cambojakh_tinNúmero de Identificação Fiscal do Camboja1001-123456789Sim
Canadáca_bnBN canadense123456789Não
Canadáca_gst_hstNúmero de GST/HST canadense123456789RT0002Sim
Canadáca_pst_bcNúmero de PST canadense (Colúmbia Britânica)PST-1234-5678Não
Canadáca_pst_mbNúmero de PST canadense (Manitoba)123456-7Não
Canadáca_pst_skNúmero de PST canadense (Saskatchewan)1234567Não
Canadáca_qstNúmero de QST canadense (Québec)1234567890TQ1234Sim
Cazaquistãokz_binNúmero de Identificação de Empresa do Cazaquistão123456789012Sim
Chilecl_tinTIN chileno12.345.678-KSim
Chipreeu_vatEuropean VAT numberCY12345678ZSim
Congo - Kinshasacd_nifNúmero de Identificação Fiscal do Congo (RD)A0123456MNão
Coreia do Sulkr_brnBRN coreano123-45-67890Sim
Costa Ricacr_tinID fiscal da Costa Rica1-234-567890Não
Croáciaeu_vatEuropean VAT numberHR12345678912Sim
Dinamarcaeu_vatEuropean VAT numberDK12345678Sim
Egitoeg_tinNúmero de Identificação Fiscal Egípcio123456789Sim
Emirados Árabes Unidosae_trnTRN dos Emirados Árabes Unidos123456789012345Sim
Equadorec_rucNúmero RUC do Equador1234567890001Não
Eslováquiaeu_vatEuropean VAT numberSK1234567891Sim
Eslovêniaeu_vatEuropean VAT numberSI12345678Sim
Espanhaes_cifNúmero do NIF espanhol (anteriormente número do CIF espanhol)A12345678Não
Espanhaeu_vatEuropean VAT numberESA1234567ZSim
Estôniaeu_vatEuropean VAT numberEE123456789Sim
Etiópiaet_tinNúmero de Identificação Fiscal da Etiópia1234567890Sim
Filipinasph_tinNúmero de Identificação Fiscal das Filipinas123456789012Sim
Finlândiaeu_vatEuropean VAT numberFI12345678Sim
Françaeu_vatEuropean VAT numberFRAB123456789Sim
Geórgiage_vatIVA georgiano123456789Sim
Gréciaeu_vatEuropean VAT numberEL123456789Sim
Guinégn_nifNúmero de Identificação Fiscal da Guiné123456789Sim
Hungriaeu_vatEuropean VAT numberHU12345678Sim
Índiain_gstNúmero de GST indiano12ABCDE3456FGZHSim
Irlandaeu_vatEuropean VAT numberIE1234567ABSim
Islândiais_vatIVA islandês123456Sim
Itáliaeu_vatEuropean VAT numberIT12345678912Sim
Laosla_tinNúmero de Identificação Fiscal do Laos123456789-000Não
Letôniaeu_vatEuropean VAT numberLV12345678912Sim
Liechtensteinli_vatNúmero de IVA de Liechtenstein12345Sim
Lituâniaeu_vatEuropean VAT numberLT123456789123Sim
Luxemburgoeu_vatEuropean VAT numberLU12345678Sim
Macedônia do Nortemk_vatNúmero de IVA da Macedônia do NorteMK1234567890123Sim
Maltaeu_vatEuropean VAT numberMT12345678Sim
Marrocosma_vatNúmero de IVA de Marrocos12345678Sim
Mauritâniamr_nifNúmero de Identificação Fiscal da Mauritânia12345678Não
Méxicomx_rfcNúmero de RFC mexicanoABC010203AB9Não
Moldovamd_vatNúmero de IVA da Moldávia1234567Sim
Montenegrome_pibNúmero PIB de Montenegro12345678Não
Nepalnp_panNúmero PAN do Nepal123456789Sim
Nigériang_tinNúmero de Identificação Fiscal da Nigéria12345678-0001Não
Noruegano_vatNúmero de IVA norueguês123456789MVASim
Nova Zelândianz_gstNúmero de GST da Nova Zelândia123456789Sim
Omãom_vatNúmero de IVA de OmãOM1234567890Sim
Países Baixoseu_vatEuropean VAT numberNL123456789B12Sim
Perupe_rucNúmero RUC do Peru12345678901Sim
Polôniaeu_vatEuropean VAT numberPL1234567890Sim
Portugaleu_vatEuropean VAT numberPT123456789Sim
Quêniake_pinNúmero de Identificação Pessoal da Autoridade da Receita do QuêniaP000111111ANão
Quirguistãokg_tinNúmero de Identificação Fiscal do Quirguistão12345678901234Não
Reino Unidoeu_vatNorthern Ireland VAT numberXI123456789Sim
Reino Unidogb_vatNúmero de IVA do Reino UnidoGB123456789Sim
República Tchecaeu_vatEuropean VAT numberCZ1234567890Sim
Romêniaeu_vatEuropean VAT numberRO1234567891Sim
Rússiaru_innINN russo1234567891Sim
Rússiaru_kppKPP russo123456789Sim
Senegalsn_nineaNúmero NINEA do Senegal12345672A2Não
Sérviars_pibNúmero PIB da Sérvia123456789Não
Singapurasg_gstGST singapurenseM12345678XSim
Suéciaeu_vatEuropean VAT numberSE123456789123Sim
Suíçach_vatNúmero de IVA suíçoCHE-123.456.789 MWSTSim
Surinamesr_finNúmero FIN do Suriname1234567890Sim
Tadjiquistãotj_tinNúmero de Identificação Fiscal do Tajiquistão123456789Sim
Tailândiath_vatIVA tailandês1234567891234Sim
Taiwantw_vatIVA taiwanês12345678Sim
Tanzâniatz_vatNúmero de IVA da Tanzânia12345678ASim
Turquiatr_tinNúmero de Identificação Fiscal da Turquia0123456789Sim
Ucrâniaua_vatIVA ucraniano123456789Sim
Ugandaug_tinNúmero de Identificação Fiscal de Uganda1014751879Sim
Uruguaiuy_rucNúmero do RUC do Uruguai123456789012Sim
Uzbequistãouz_tinNúmero TIN do Uzbequistão123456789Não
Uzbequistãouz_vatNúmero de IVA do Uzbequistão123456789012Sim
Zâmbiazm_tinNúmero de Identificação Fiscal da Zâmbia1004751879Não
Zimbábuezw_tinNúmero de Identificação Fiscal do Zimbábue1234567890Não
Esta página foi útil?
SimNão
  • Precisa de ajuda? Fale com o suporte.
  • Participe do nosso programa de acesso antecipado.
  • Confira nosso changelog.
  • Dúvidas? Fale com a equipe de vendas.
  • LLM? Read llms.txt.
  • Powered by Markdoc