This object represents a customer of your business. Use it to create recurring charges, save payment and contact information, and track payments that belong to the same customer.
Attributes
- idstring
Unique identifier for the object.
- addressnullable object
The customer’s address.
- customer_
account nullable stringThe ID of an Account representing a customer. You can use this ID with any v1 API that accepts a customer_account parameter.
- descriptionnullable string
An arbitrary string attached to the object. Often useful for displaying to users.
- emailnullable string
The customer’s email address.
- 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.
- namenullable string
The customer’s full name or business name.
- phonenullable string
The customer’s phone number.
- shippingnullable object
Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
- taxobjectExpandable
Tax details for the customer.
More attributes
- objectstring
- balanceinteger
- business_
name nullable string - cash_
balance nullable objectExpandable - createdtimestamp
- currencynullable string
- default_
source nullable stringExpandable - delinquentnullable boolean
- discountnullable object
- individual_
name nullable string - invoice_
credit_ objectExpandablebalance - invoice_
prefix nullable string - invoice_
settings object - livemodeboolean
- next_
invoice_ nullable integersequence - preferred_
locales nullable array of strings - sourcesnullable objectExpandable
- subscriptionsnullable objectExpandable
- tax_
exempt nullable enum - tax_
ids nullable objectExpandable - test_
clock nullable 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
- addressobjectRequired if calculating taxes
The customer’s address. Learn about country-specific requirements for calculating tax.
- 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.
The maximum length is 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.
The maximum length is 256 characters.
- payment_
method stringThe ID of the PaymentMethod to attach to the customer.
- phonestring
The customer’s phone number.
The maximum length is 20 characters.
- shippingobject
The customer’s shipping information. Appears on invoices emailed to this customer.
- taxobjectRecommended if calculating taxes
Tax details about the customer.
More parameters
- balanceinteger
- business_
name string - cash_
balance object - individual_
name string - invoice_
prefix string - invoice_
settings object - next_
invoice_ integersequence - preferred_
locales array of strings - sourcestring
- tax_
exempt enum - tax_
id_ array of objectsdata - test_
clock string
Returns
Returns the Customer object after successful customer creation. Raises an error if create parameters are invalid (for example, specifying 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 are left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (such as 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 is retried. This retry doesn’t count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer doesn’t trigger this behavior.
This request accepts mostly the same arguments as the customer creation call.
Parameters
- addressobjectRequired if calculating taxes
The customer’s address. Learn about country-specific requirements for calculating tax.
- 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.
The maximum length is 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.
The maximum length is 256 characters.
- phonestring
The customer’s phone number.
The maximum length is 20 characters.
- shippingobject
The customer’s shipping information. Appears on invoices emailed to this customer.
- taxobjectRecommended if calculating taxes
Tax details about the customer.
More parameters
- balanceinteger
- business_
name string - cash_
balance object - default_
source string - individual_
name string - invoice_
prefix string - invoice_
settings object - next_
invoice_ integersequence - preferred_
locales array of strings - sourcestring
- tax_
exempt enum
Returns
Returns the customer object if the update succeeded. Raises an error if update parameters are invalid (for example, specifying 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}