Customers v1
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 billing address.
- customer_
accountnullable string The 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.
- metadatamap
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.
- taxobjectIncludable
Tax details for the customer.
More attributes
- objectstring, value is "customer"
- balanceinteger
- business_
namenullable string - cash_
balancenullable objectIncludable - createdtimestamp
- currencynullable string
- default_
sourcenullable stringExpandable - delinquentnullable boolean
- discountnullable object
- individual_
namenullable string - invoice_
credit_ balancemapIncludable - invoice_
prefixnullable string - invoice_
settingsobject - livemodeboolean
- marketing_
attributionsnullable array of objectsPreview feature - next_
invoice_ sequencenullable integer - preferred_
localesnullable array of strings - sourcesnullable objectIncludable
- subscriptionsnullable objectIncludable
- tax_
exemptnullable enum - tax_
idsnullable objectIncludable - 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}Creates a new customer object.
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.
- metadatamap
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_
methodstring 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_
namestring - cash_
balanceobject - individual_
namestring - invoice_
prefixstring - invoice_
settingsobject - marketing_
attributionsarray of objectsPreview feature - next_
invoice_ sequenceinteger - preferred_
localesarray of strings - sourcestring
- tax_
exemptenum - tax_
id_ dataarray of objects - test_
clockstring
Returns
Returns a customer object if the call succeeded. The returned object will have information about subscriptions, discount, and payment sources, if that information has been provided. If an invoice payment is due and a source is not provided, the call will raise an error. If a non-existent plan or a non-existent or expired coupon is provided, the call will raise an error.
If a source has been attached to the customer, the returned customer object will have a default_ attribute, which is an ID that can be expanded into the full source details when retrieving the customer.
{ "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}