调至内容部分
创建账户
或
登录
Stripe 文档徽标
/
询问人工智能
创建账户
登录
开始
付款
销售收入
平台和交易市场
资金管理
开发人员工具
概览
关于 Stripe 支付
升级您的集成
支付分析
线上付款
概览查找您的用例Managed Payments
使用 Payment Link
构建结账页面
    概览
    快速开始
    自定义外观样式
    收集额外信息
    收税
      使用手动税率
      收集税号
    动态更新结账流程
    管理产品目录
    订阅
    管理支付方式
    让客户用本地货币支付
    添加折扣、追加销售和可选商品
    设置未来付款
    支付过程中保存付款详情
    在您的服务器上手动批准支付
    付款后
    具有 Checkout Sessions API Beta 更改日志的 Element
    从传统 Checkout 迁移
    迁移 Checkout 来使用 Prices
构建高级集成
构建应用内集成
支付方式
添加支付方式
管理支付方式
用 Link 更快结账
支付接口
Payment Links
结账
Web Elements
应用内 Element
支付场景
自定义支付流程
灵活收单
编排
线下支付
Terminal
其他 Stripe 产品
Financial Connections
加密货币
Climate
首页付款Build 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
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.

注意

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.

可选Require 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:

国家/地区枚举描述示例
对计税的影响
丹麦eu_vatEuropean VAT numberDK12345678是
乌克兰ua_vat乌克兰增值税税号 (VAT)123456789是
乌兹别克斯坦uz_tin乌兹别克斯坦 TIN 号123456789否
乌兹别克斯坦uz_vat乌兹别克斯坦 VAT 号123456789012是
乌干达ug_tin乌干达纳税人识别号1014751879是
乌拉圭uy_ruc乌拉圭 RUC 号123456789012是
亚美尼亚am_tin亚美尼亚纳税人识别号02538904是
佛得角cv_nif佛得角纳税人识别号 (Número de Identificação Fiscal)213456789否
俄罗斯ru_inn俄罗斯企业编码 (INN)1234567891是
俄罗斯ru_kpp俄罗斯工业企业编码 (KPP)123456789是
保加利亚eu_vatEuropean VAT numberBG0123456789是
克罗地亚eu_vatEuropean VAT numberHR12345678912是
冰岛is_vat冰岛增值税 (VAT)123456是
几内亚gn_nif几内亚纳税人识别号 (Número de Identificação Fiscal)123456789是
列支敦士登li_vat列支敦斯登公司税号 (VAT)12345是
刚果(金)cd_nif刚果 (DR) 纳税人识别号 (Número de Identificação Fiscal)A0123456M否
加拿大ca_bn加拿大商业号码 (BN)123456789否
加拿大ca_gst_hst加拿大商品及服务税/统一销售税税号 (GST/HST)123456789RT0002是
加拿大ca_pst_bc加拿大省销售税税号 (PST)(不列颠哥伦比亚)PST-1234-5678否
加拿大ca_pst_mb加拿大省销售税税号 (PST)(马尼托巴湖)123456-7否
加拿大ca_pst_sk加拿大省销售税税号 (PST)(萨斯喀彻温省)1234567否
加拿大ca_qst加拿大魁北克销售税 (QST)(魁北克)1234567890TQ1234是
匈牙利eu_vatEuropean VAT numberHU12345678是
北马其顿mk_vat北马其顿增值税税号MK1234567890123是
南非za_vat南非增值税税号 (VAT)4123456789是
卢森堡eu_vatEuropean VAT numberLU12345678是
印度in_gst印度商品及服务税税号 (GST)12ABCDE3456FGZH是
厄瓜多尔ec_ruc厄瓜多尔 RUC 号1234567890001否
台湾tw_vat中国台湾增值税税号 (VAT)12345678是
吉尔吉斯斯坦kg_tin吉尔吉斯斯坦纳税人识别号12345678901234否
哈萨克斯坦kz_bin哈萨克斯坦商家识别码123456789012是
哥斯达黎加cr_tin哥斯达黎加税号1-234-567890否
喀麦隆cm_niu喀麦隆纳税人识别号 (Numéro d'Identifiant fiscal Unique)M123456789000L否
土耳其tr_tin土耳其税务识别号0123456789是
坦桑尼亚tz_vat汤桑尼亚增值税税号12345678A是
埃及eg_tin埃及税务识别号123456789是
埃塞俄比亚et_tin埃塞俄比亚纳税人识别号1234567890是
塔吉克斯坦tj_tin塔吉克斯坦纳税人识别号123456789是
塞内加尔sn_ninea塞内加尔 NINEA 号码12345672A2否
塞尔维亚rs_pib塞尔维亚 PIB 号123456789否
塞浦路斯eu_vatEuropean VAT numberCY12345678Z是
奥地利eu_vatEuropean VAT numberATU12345678是
孟加拉国bd_bin孟加拉国商业识别号123456789-0123是
安哥拉ao_tin安哥拉纳税人识别号5123456789否
尼日利亚ng_tin尼日利亚纳税人识别号12345678-0001否
尼泊尔np_pan尼泊尔 PAN 号码123456789是
巴哈马bs_tin巴哈马纳税人识别号123.456.789否
巴巴多斯bb_tin巴巴多斯纳税人识别号1123456789012否
巴林bh_vat巴林增值税税号123456789012345是
布基纳法索bf_ifu布基纳法索纳税人识别号 (Numéro d'Identifiant Fiscal Unique)12345678A是
希腊eu_vatEuropean VAT numberEL123456789是
德国eu_vatEuropean VAT numberDE123456789是
意大利eu_vatEuropean VAT numberIT12345678912是
拉脱维亚eu_vatEuropean VAT numberLV12345678912是
挪威no_vat挪威增值税税号 (VAT)123456789MVA是
捷克eu_vatEuropean VAT numberCZ1234567890是
摩尔多瓦md_vat摩尔多瓦增值税税号1234567是
摩洛哥ma_vat摩洛哥增值税税号12345678是
斯洛伐克eu_vatEuropean VAT numberSK1234567891是
斯洛文尼亚eu_vatEuropean VAT numberSI12345678是
新加坡sg_gst新加坡商品及服务税税号 (GST)M12345678X是
新西兰nz_gst新西兰商品及服务税税号 (GST)123456789是
智利cl_tin智利纳税人识别号 (TIN)12.345.678-K是
柬埔寨kh_tin柬埔寨纳税人识别号1001-123456789是
格鲁吉亚ge_vat格鲁吉亚增值税税号 (VAT)123456789是
比利时eu_vatEuropean VAT numberBE0123456789是
毛里塔尼亚mr_nif毛里塔尼亚纳税人识别号 (Número de Identificação Fiscal)12345678否
沙特阿拉伯sa_vat沙特阿拉伯增值税税号 (VAT)123456789012345是
法国eu_vatEuropean VAT numberFRAB123456789是
波兰eu_vatEuropean VAT numberPL1234567890是
波斯尼亚和黑塞哥维那ba_tin波斯尼亚和黑塞哥维那纳税人识别号123456789012是
泰国th_vat泰国增值税税号 (VAT)1234567891234是
津巴布韦zw_tin津巴布韦纳税人识别号1234567890否
澳大利亚au_abn澳大利亚商业号码 (AU ABN)12345678912是
爱尔兰eu_vatEuropean VAT numberIE1234567AB是
爱沙尼亚eu_vatEuropean VAT numberEE123456789是
瑞典eu_vatEuropean VAT numberSE123456789123是
瑞士ch_vat瑞士增值税税号 (VAT)CHE-123.456.789 MWST是
白俄罗斯by_tin白俄罗斯 TIN 号123456789是
秘鲁pe_ruc秘鲁 RUC 号12345678901是
立陶宛eu_vatEuropean VAT numberLT123456789123是
罗马尼亚eu_vatEuropean VAT numberRO1234567891是
老挝la_tin老挝纳税人识别号123456789-000否
肯尼亚ke_pin肯尼亚税务局个人识别号码P000111111A否
芬兰eu_vatEuropean VAT numberFI12345678是
苏里南sr_fin苏里南 FIN 号码1234567890是
英国eu_vatNorthern Ireland VAT numberXI123456789是
英国gb_vat英国增值税税号 (VAT)GB123456789是
荷兰eu_vatEuropean VAT numberNL123456789B12是
菲律宾ph_tin菲律宾税务识别号123456789012是
葡萄牙eu_vatEuropean VAT numberPT123456789是
西班牙es_cif西班牙 NIF 编号(之前为西班牙 CIF 编号)A12345678否
西班牙eu_vatEuropean VAT numberESA1234567Z是
贝宁bj_ifu贝宁税号纳税人识别号 (Identifiant Fiscal Unique)1234567890123是
赞比亚zm_tin赞比亚纳税人识别号1004751879否
阿塞拜疆az_tin阿塞拜纳税人识别号0123456789是
阿尔巴尼亚al_tin阿尔巴尼亚纳税人识别号J12345678N是
阿曼om_vat阿曼增值税税号OM1234567890是
阿联酋ae_trn阿联酋税务登记号码 (TRN)123456789012345是
阿鲁巴aw_tin阿鲁巴纳税人识别号12345678是
韩国kr_brn韩国商业登记号码 (BRN)123-45-67890是
马尔他eu_vatEuropean VAT numberMT12345678是
黑山me_pib黑山 PIB 号码12345678否
墨西哥mx_rfc墨西哥纳税登记号 (RFC)ABC010203AB9否
此页面的内容有帮助吗?
是否
需要帮助?联系支持。
加入我们的早期使用计划。
查看我们的更改日志。
有问题?联系销售。
LLM? Read llms.txt.
Powered by Markdoc