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.
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:
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.
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.
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
.
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_
). 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_vat | European VAT number | DK12345678 | 是 |
乌克兰 | 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_vat | European VAT number | BG0123456789 | 是 |
克罗地亚 | eu_vat | European VAT number | HR12345678912 | 是 |
冰岛 | 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_vat | European VAT number | HU12345678 | 是 |
北马其顿 | mk_vat | 北马其顿增值税税号 | MK1234567890123 | 是 |
南非 | za_vat | 南非增值税税号 (VAT) | 4123456789 | 是 |
卢森堡 | eu_vat | European VAT number | LU12345678 | 是 |
印度 | 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_vat | European VAT number | CY12345678Z | 是 |
奥地利 | eu_vat | European VAT number | ATU12345678 | 是 |
孟加拉国 | 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_vat | European VAT number | EL123456789 | 是 |
德国 | eu_vat | European VAT number | DE123456789 | 是 |
意大利 | eu_vat | European VAT number | IT12345678912 | 是 |
拉脱维亚 | eu_vat | European VAT number | LV12345678912 | 是 |
挪威 | no_vat | 挪威增值税税号 (VAT) | 123456789MVA | 是 |
捷克 | eu_vat | European VAT number | CZ1234567890 | 是 |
摩尔多瓦 | md_vat | 摩尔多瓦增值税税号 | 1234567 | 是 |
摩洛哥 | ma_vat | 摩洛哥增值税税号 | 12345678 | 是 |
斯洛伐克 | eu_vat | European VAT number | SK1234567891 | 是 |
斯洛文尼亚 | eu_vat | European VAT number | SI12345678 | 是 |
新加坡 | sg_gst | 新加坡商品及服务税税号 (GST) | M12345678X | 是 |
新西兰 | nz_gst | 新西兰商品及服务税税号 (GST) | 123456789 | 是 |
智利 | cl_tin | 智利纳税人识别号 (TIN) | 12.345.678-K | 是 |
柬埔寨 | kh_tin | 柬埔寨纳税人识别号 | 1001-123456789 | 是 |
格鲁吉亚 | ge_vat | 格鲁吉亚增值税税号 (VAT) | 123456789 | 是 |
比利时 | eu_vat | European VAT number | BE0123456789 | 是 |
毛里塔尼亚 | mr_nif | 毛里塔尼亚纳税人识别号 (Número de Identificação Fiscal) | 12345678 | 否 |
沙特阿拉伯 | sa_vat | 沙特阿拉伯增值税税号 (VAT) | 123456789012345 | 是 |
法国 | eu_vat | European VAT number | FRAB123456789 | 是 |
波兰 | eu_vat | European VAT number | PL1234567890 | 是 |
波斯尼亚和黑塞哥维那 | ba_tin | 波斯尼亚和黑塞哥维那纳税人识别号 | 123456789012 | 是 |
泰国 | th_vat | 泰国增值税税号 (VAT) | 1234567891234 | 是 |
津巴布韦 | zw_tin | 津巴布韦纳税人识别号 | 1234567890 | 否 |
澳大利亚 | au_abn | 澳大利亚商业号码 (AU ABN) | 12345678912 | 是 |
爱尔兰 | eu_vat | European VAT number | IE1234567AB | 是 |
爱沙尼亚 | eu_vat | European VAT number | EE123456789 | 是 |
瑞典 | eu_vat | European VAT number | SE123456789123 | 是 |
瑞士 | ch_vat | 瑞士增值税税号 (VAT) | CHE-123.456.789 MWST | 是 |
白俄罗斯 | by_tin | 白俄罗斯 TIN 号 | 123456789 | 是 |
秘鲁 | pe_ruc | 秘鲁 RUC 号 | 12345678901 | 是 |
立陶宛 | eu_vat | European VAT number | LT123456789123 | 是 |
罗马尼亚 | eu_vat | European VAT number | RO1234567891 | 是 |
老挝 | la_tin | 老挝纳税人识别号 | 123456789-000 | 否 |
肯尼亚 | ke_pin | 肯尼亚税务局个人识别号码 | P000111111A | 否 |
芬兰 | eu_vat | European VAT number | FI12345678 | 是 |
苏里南 | sr_fin | 苏里南 FIN 号码 | 1234567890 | 是 |
英国 | eu_vat | Northern Ireland VAT number | XI123456789 | 是 |
英国 | gb_vat | 英国增值税税号 (VAT) | GB123456789 | 是 |
荷兰 | eu_vat | European VAT number | NL123456789B12 | 是 |
菲律宾 | ph_tin | 菲律宾税务识别号 | 123456789012 | 是 |
葡萄牙 | eu_vat | European VAT number | PT123456789 | 是 |
西班牙 | es_cif | 西班牙 NIF 编号(之前为西班牙 CIF 编号) | A12345678 | 否 |
西班牙 | eu_vat | European VAT number | ESA1234567Z | 是 |
贝宁 | 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_vat | European VAT number | MT12345678 | 是 |
黑山 | me_pib | 黑山 PIB 号码 | 12345678 | 否 |
墨西哥 | mx_rfc | 墨西哥纳税登记号 (RFC) | ABC010203AB9 | 否 |