Customers
A customer is a person or business that buys from you. It holds their contact details and saved payment methods, and ties together their payments, invoices and subscriptions.
The Customer object
- Name
object
- Type
- "customer",
- Description
- The object's type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
trueif the object is live, orfalseif it's in a sandbox.
- Name
created_at
- Type
- integer,
- Description
- When the object was created, in milliseconds since the Unix epoch.
- Name
balance
- Type
- integer,
- Description
- The customer's balance in cents: credit when positive, owed when negative. It's applied to the customer's invoices when they're finalized.
- Name
default_payment_method
- Type
- string or null,
- Description
- The payment method charged for the customer's invoices and subscriptions that don't set their own
default_payment_method.
- Name
deleted
- Type
- boolean,
- Description
- Whether the customer has been deleted.
- Name
email
- Type
- string or null,
- Description
- The customer's email address.
- Name
external_sync
- Type
- object or null,
- Description
- The customer's record in a connected accounting system.
- Properties
- Name
metadata
- Type
- object,
- Description
- Your own key-value data on the object.
- Name
name
- Type
- string or null,
- Description
- The customer's full name or business name.
- Name
phone
- Type
- string or null,
- Description
- The customer's phone number.
- Name
shipping_details
- Type
- object or null,
- Description
- The customer's saved shipping recipient and address.
- Properties
- Name
updated_at
- Type
- integer,
- Description
- When the object was last updated, in milliseconds since the Unix epoch.
The Customer object
Get a customer
Retrieve a customer by their ID.
Required parameters
- Name
id
- Type
- string,
- Description
- The ID of the customer to retrieve.
Returns
Returns the customer object.
Get a customer
Response example
List all customers
Retrieve a paginated list of customers.
Optional parameters
- Name
ending_before
- Type
- string,
- Description
- The ID of the object to list before, for pagination.
- Name
starting_after
- Type
- string,
- Description
- The ID of the object to list after, for pagination.
- Name
limit
- Type
- integer, at least 1, at most 1000, default is 50
- Description
- The maximum number of objects to return, from 1 to 1000. Defaults to 50.
- Name
filters
- Type
- object, object, or object,
- Description
- Properties
Returns
Returns a list of customer objects.
List all customers
Response example
Create a customer
Create a new customer.
Optional parameters
- Name
name
- Type
- string or null,
- Description
- The customer's full name or business name.
- Name
email
- Type
- string or null,
- Description
- The customer's email address.
- Name
phone
- Type
- string or null,
- Description
- The customer's phone number.
- Name
shipping_details
- Type
- object or null,
- Description
- The customer's saved shipping recipient and address.
- Properties
- Name
default_payment_method
- Type
- string or null,
- Description
- The payment method charged for the customer's invoices and subscriptions that don't set their own
default_payment_method. An unattached payment method is attached to the customer.
- Name
metadata
- Type
- object or null,
- Description
- Your own key-value data on the object.
Returns
Returns the customer object.
Create a customer
Response example
Update a customer
Updates change a customer’s contact details, shipping details, default payment method or metadata.
Setting a default_payment_method charges the customer’s unpaid invoices that are waiting for a payment method right away.
Required parameters
- Name
id
- Type
- string,
Optional parameters
- Name
name
- Type
- string or null,
- Description
- The customer's full name or business name.
- Name
email
- Type
- string or null,
- Description
- The customer's email address.
- Name
phone
- Type
- string or null,
- Description
- The customer's phone number.
- Name
shipping_details
- Type
- object or null,
- Description
- The customer's saved shipping recipient and address.
- Properties
- Name
default_payment_method
- Type
- string or null,
- Description
- The payment method charged for the customer's invoices and subscriptions that don't set their own
default_payment_method. An unattached payment method is attached to the customer.
- Name
metadata
- Type
- object or null,
- Description
- Your own key-value data on the object.
Returns
Returns the customer object.
Update a customer
Response example
Delete a customer
Deleting a customer is permanent and cancels their subscriptions immediately.
Required parameters
- Name
id
- Type
- string,
Returns
A deleted object stub.