Parameters
- addressobjectRequired if calculating taxes
The customer’s address.
- address.
citystring City, district, suburb, town, or village.
- address.
countrystringRequired if calculating taxes A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code (ISO 3166-1 alpha-2).
- address.
line1string Address line 1 (e.g., street, PO Box, or company name).
- address.
line2string Address line 2 (e.g., apartment, suite, unit, or building).
- address.
postal_ codestringRequired if calculating taxes ZIP or postal code.
- address.
statestring State, county, province, or region.
- descriptionstring
An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.
- emailstring
Customer’s email address. It’s displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to 512 characters.
- metadataobject
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
. - namestring
The customer’s full name or business name.
- payment_
methodstring The ID of the PaymentMethod to attach to the customer.
- phonestring
The customer’s phone number.
- shippingobject
The customer’s shipping information. Appears on invoices emailed to this customer.
- shipping.
addressobjectRequired Customer shipping address.
- shipping.
address. citystring City, district, suburb, town, or village.
- shipping.
address. countrystringRequired if calculating taxes A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code (ISO 3166-1 alpha-2).
- shipping.
address. line1string Address line 1 (e.g., street, PO Box, or company name).
- shipping.
address. line2string Address line 2 (e.g., apartment, suite, unit, or building).
- shipping.
address. postal_ codestringRequired if calculating taxes ZIP or postal code.
- shipping.
address. statestring State, county, province, or region.
- shipping.
namestringRequired Customer name.
- shipping.
phonestring Customer phone (including extension).
- taxobjectRecommended if calculating taxes
Tax details about the customer.
- tax.
ip_ addressstring A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
- tax.
validate_ locationenum A flag that indicates when Stripe should validate the customer tax location. Defaults to
deferred
.Possible enum valuesdeferred
Defer the validation of the customer’s tax location until needed, such as when Stripe Tax is calculating taxes on an Invoice. Default.
immediately
Validate the customer’s tax location immediately. An error is returned and the customer is not created/updated if the tax location is invalid. Recommended if calculating taxes.
More parameters
- balanceinteger
An integer amount in cents that represents the customer’s current balance, which affect the customer’s future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
- cash_
balanceobject Balance information and default balance settings for this customer.
- cash_balance.
settingsobject Settings controlling the behavior of the customer’s cash balance, such as reconciliation of funds received.
- cash_balance.
settings. reconciliation_ modeenum Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are
automatic
,manual
, ormerchant_
. For more information about these reconciliation modes, see Reconciliation.default Possible enum valuesautomatic
manual
merchant_
default
- invoice_
prefixstring The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers.
- invoice_
settingsobject Default invoice settings for this customer.
- invoice_settings.
custom_ fieldsarray of objects The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields.
- invoice_settings.
custom_fields. namestringRequired The name of the custom field. This may be up to 40 characters.
- invoice_settings.
custom_fields. valuestringRequired The value of the custom field. This may be up to 140 characters.
- invoice_settings.
default_ payment_ methodstring ID of a payment method that’s attached to the customer, to be used as the customer’s default payment method for subscriptions and invoices.
- invoice_settings.
string Default footer to be displayed on invoices for this customer.
- invoice_settings.
rendering_ optionsobject Default options for invoice PDF rendering for this customer.
- invoice_settings.
rendering_options. amount_ tax_ displayenum How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of
exclude_
ortax include_
.inclusive_ tax include_
will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts.inclusive_ tax exclude_
will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.tax Possible enum valuesexclude_
tax include_
inclusive_ tax - invoice_settings.
rendering_options. templatestring ID of the invoice rendering template to use for future invoices.
- next_
invoice_ sequenceinteger The sequence to be used on the customer’s next invoice. Defaults to 1.
- preferred_
localesarray of strings Customer’s preferred languages, ordered by preference.
- sourcestring
When using payment sources created via the Token or Sources APIs, passing
source
will create a new source object, make it the new customer default source, and delete the old customer default if one exists. If you want to add additional sources instead of replacing the existing default, use the card creation API. Whenever you attach a card to a customer, Stripe will automatically validate the card. - tax_
exemptenum The customer’s tax exemption. One of
none
,exempt
, orreverse
.Possible enum valuesexempt
none
reverse
- tax_
id_ dataarray of objects The customer’s tax IDs.
- tax_id_data.
typestringRequired Type of the tax ID, one of
ad_
,nrt ae_
,trn al_
,tin am_
,tin ao_
,tin ar_
,cuit au_
,abn au_
,arn aw_
,tin az_
,tin ba_
,tin bb_
,tin bd_
,bin bf_
,ifu bg_
,uic bh_
,vat bj_
,ifu bo_
,tin br_
,cnpj br_
,cpf bs_
,tin by_
,tin ca_
,bn ca_
,gst_ hst ca_
,pst_ bc ca_
,pst_ mb ca_
,pst_ sk ca_
,qst cd_
,nif ch_
,uid ch_
,vat cl_
,tin cm_
,niu cn_
,tin co_
,nit cr_
,tin cv_
,nif de_
,stn do_
,rcn ec_
,ruc eg_
,tin es_
,cif et_
,tin eu_
,oss_ vat eu_
,vat gb_
,vat ge_
,vat gn_
,nif hk_
,br hr_
,oib hu_
,tin id_
,npwp il_
,vat in_
,gst is_
,vat jp_
,cn jp_
,rn jp_
,trn ke_
,pin kg_
,tin kh_
,tin kr_
,brn kz_
,bin la_
,tin li_
,uid li_
,vat ma_
,vat md_
,vat me_
,pib mk_
,vat mr_
,nif mx_
,rfc my_
,frp my_
,itn my_
,sst ng_
,tin no_
,vat no_
,voec np_
,pan nz_
,gst om_
,vat pe_
,ruc ph_
,tin ro_
,tin rs_
,pib ru_
,inn ru_
,kpp sa_
,vat sg_
,gst sg_
,uen si_
,tin sn_
,ninea sr_
,fin sv_
,nit th_
,vat tj_
,tin tr_
,tin tw_
,vat tz_
,vat ua_
,vat ug_
,tin us_
,ein uy_
,ruc uz_
,tin uz_
,vat ve_
,rif vn_
,tin za_
,vat zm_
, ortin zw_
tin - tax_id_data.
valuestringRequired Value of the tax ID.
- test_
clockstring ID of the test clock to attach to the customer.
Returns
Returns the Customer object after successful customer creation. Throws an error if create parameters are invalid (for example, specifying an invalid coupon or an invalid source).
{ "id": "cus_NffrFeUfNV2Hib", "object": "customer", "address": null, "balance": 0, "created": 1680893993, "currency": null, "default_source": null, "delinquent": false, "description": null, "email": "jennyrosen@example.com", "invoice_prefix": "0759376C", "invoice_settings": { "custom_fields": null, "default_payment_method": null, "footer": null, "rendering_options": null }, "livemode": false, "metadata": {}, "name": "Jenny Rosen", "next_invoice_sequence": 1, "phone": null, "preferred_locales": [], "shipping": null, "tax_exempt": "none", "test_clock": null}