Attributes
- idstring
Unique identifier for the object.
- addressnullable dictionary
The customer’s address.
- descriptionnullable string
An arbitrary string attached to the object. Often useful for displaying to users.
- emailnullable string
The customer’s email address.
- metadatadictionary
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.
- namenullable string
The customer’s full name or business name.
- phonenullable string
The customer’s phone number.
- shippingnullable dictionary
Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
- taxdictionaryExpandable
Tax details for the customer.
More attributes
- objectstring
- balanceinteger
- cash_
balancenullable dictionaryExpandable - createdtimestamp
- currencynullable string
- default_
sourcenullable stringExpandable - delinquentnullable boolean
- discountnullable dictionary
- invoice_
credit_ balancedictionaryExpandable - invoice_
prefixnullable string - invoice_
settingsdictionary - livemodeboolean
- next_
invoice_ sequencenullable integer - preferred_
localesnullable array of strings - sourcesnullable dictionaryExpandable
- subscriptionsnullable dictionaryExpandable
- tax_
exemptnullable enum - tax_
idsnullable dictionaryExpandable - test_
clocknullable stringExpandable
{ "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}
Parameters
- addressdictionaryRequired if calculating taxes
The customer’s address.
- 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.
- metadatadictionary
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.
- shippingdictionary
The customer’s shipping information. Appears on invoices emailed to this customer.
- taxdictionaryRecommended if calculating taxes
Tax details about the customer.
More parameters
- balanceinteger
- cash_
balancedictionary - invoice_
prefixstring - invoice_
settingsdictionary - next_
invoice_ sequenceinteger - preferred_
localesarray of strings - sourcestring
- tax_
exemptenum - tax_
id_ dataarray of dictionaries - test_
clockstring
Returns
Returns the Customer object after successful customer creation. Raises 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}
Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_
state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.
This request accepts mostly the same arguments as the customer creation call.
Parameters
- addressdictionaryRequired if calculating taxes
The customer’s address.
- 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.
- metadatadictionary
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.
- phonestring
The customer’s phone number.
- shippingdictionary
The customer’s shipping information. Appears on invoices emailed to this customer.
- taxdictionaryRecommended if calculating taxes
Tax details about the customer.
More parameters
- balanceinteger
- cash_
balancedictionary - default_
sourcestring - invoice_
prefixstring - invoice_
settingsdictionary - next_
invoice_ sequenceinteger - preferred_
localesarray of strings - sourcestring
- tax_
exemptenum
Returns
Returns the customer object if the update succeeded. Raises an error if update parameters are invalid (e.g. 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": { "order_id": "6735" }, "name": "Jenny Rosen", "next_invoice_sequence": 1, "phone": null, "preferred_locales": [], "shipping": null, "tax_exempt": "none", "test_clock": null}
Retrieves a Customer object.
Parameters
No parameters.
Returns
Returns the Customer object for a valid identifier. If it’s for a deleted Customer, a subset of the customer’s information is returned, including a deleted
property that’s set to true.
{ "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}
Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
Parameters
- emailstring
A case-sensitive filter on the list based on the customer’s
email
field. The value must be a string.
More parameters
- createddictionary
- ending_
beforestring - limitinteger
- starting_
afterstring - test_
clockstring
Returns
A dictionary with a data
property that contains an array of up to limit
customers, starting after customer starting_
. Passing an optional email
will result in filtering to customers with only that exact email address. Each entry in the array is a separate customer object. If no more customers are available, the resulting array will be empty.
{ "object": "list", "url": "/v1/customers", "has_more": false, "data": [ { "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 } ]}