Customers

The Customers resource is designed to manage customer data effectively by providing endpoints for various operations. It enables you to create new customer records, retrieve a list of existing customers, update details for specific customers, and remove customer records when necessary. This API is essential for maintaining accurate and up-to-date customer information within your application, ensuring seamless integration and efficient data handling.

Returns a list of customers

get

Get all customers

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
endingBeforestringOptional

A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list.

startingAfterstringOptional

A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list.

limitinteger · min: 1 · max: 100Optional

A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10.

emailstringOptional

Only return customers with the given email

idsstring[]Optional

Only return customers with the given IDs

requestToBeForgottenbooleanOptional

Only return customers where requestToBeForgotten is true or false

Responses
chevron-right
200

200 OK

application/json
hasMorebooleanOptional

Whether or not there are more elements available after this set. If false this set represents the end of the list.

Example: true
get
/customers

Creates a new customer

post

Creates a new customer object

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
idstringOptional

The unique identifier of a customer.

Example: 5823594808
emailstring · emailOptional

The customer email address.

Example: [email protected]
defaultSourceIdstringOptional

The identifier of the default source attached to this customer.

Example: fd74a5c5-0163-469a-ae8e-031f0259b576
localestringOptional

A locale designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code.

Example: en_US
typestring · enumOptional

The type of customer.

Example: individualPossible values:
enabledbooleanOptional

Usually used to disable the customer. The default is true. If false, attempts to create orders for the customer will fail.

Example: true
Responses
post
/customers

Gets a customer by ID

get

Retrieves the details of a customer by supplying the unique identifier of the customer

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired

Customer ID

Responses
chevron-right
200

200 OK

application/json
idstringOptional

The unique identifier for the customer.

Example: 5823594809
createdTimestring · date-timeOptional

The time at which the customer was created.

Example: {"offset":{"totalSeconds":0,"id":"Z","rules":{"fixedOffset":true,"transitions":[],"transitionRules":[]}},"nano":0,"year":2018,"monthValue":4,"dayOfMonth":25,"hour":20,"minute":36,"second":0,"dayOfWeek":"WEDNESDAY","dayOfYear":115,"month":"APRIL"}
emailstring · emailOptional

The customer email address.

Example: [email protected]
defaultSourceIdstring · uuidOptional

The identifier of the default payment source attached to this customer.

requestToBeForgottenbooleanOptional

If true, indicates this customer has requested to be forgotten.

Default: falseExample: true
typestring · enumOptional

The type of customer.

Example: individualPossible values:
localestringOptional

A locale designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code.

Example: en_US
enabledboolean · nullableOptional

Usually used to disable the customer. The default is true. If false, attempts to create orders for the customer will fail.

Example: true
liveModebooleanOptional

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

Example: false
updatedTimestring · date-timeOptional

Time at which the customer was last updated.

Example: {"offset":{"totalSeconds":0,"id":"Z","rules":{"fixedOffset":true,"transitions":[],"transitionRules":[]}},"nano":0,"year":2018,"monthValue":4,"dayOfMonth":25,"hour":20,"minute":36,"second":0,"dayOfWeek":"WEDNESDAY","dayOfYear":115,"month":"APRIL"}
get
/customers/{id}

Updates an existing customer

post

Updates an existing customer

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired

Customer ID

Body
emailstring · emailOptional

The customer email address.

Example: [email protected]
defaultSourceIdstringOptional

The identifier of the default source attached to this customer.

Example: fd74a5c5-0163-469a-ae8e-031f0259b576
requestToBeForgottenbooleanOptional

If true, indicates this customer has submitted a request to be forgotten.

Example: true
typestring · enumOptional

The type of customer.

Example: individualPossible values:
localestringOptional

A locale designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code.

Example: en_US
enabledbooleanOptional

Usually used to disable the customer. The default is true. If false, attempts to create orders for the customer will fail.

Example: true
Responses
chevron-right
200

200 OK

application/json
idstringOptional

The unique identifier for the customer.

Example: 5823594809
createdTimestring · date-timeOptional

The time at which the customer was created.

Example: {"offset":{"totalSeconds":0,"id":"Z","rules":{"fixedOffset":true,"transitions":[],"transitionRules":[]}},"nano":0,"year":2018,"monthValue":4,"dayOfMonth":25,"hour":20,"minute":36,"second":0,"dayOfWeek":"WEDNESDAY","dayOfYear":115,"month":"APRIL"}
emailstring · emailOptional

The customer email address.

Example: [email protected]
defaultSourceIdstring · uuidOptional

The identifier of the default payment source attached to this customer.

requestToBeForgottenbooleanOptional

If true, indicates this customer has requested to be forgotten.

Default: falseExample: true
typestring · enumOptional

The type of customer.

Example: individualPossible values:
localestringOptional

A locale designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code.

Example: en_US
enabledboolean · nullableOptional

Usually used to disable the customer. The default is true. If false, attempts to create orders for the customer will fail.

Example: true
liveModebooleanOptional

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

Example: false
updatedTimestring · date-timeOptional

Time at which the customer was last updated.

Example: {"offset":{"totalSeconds":0,"id":"Z","rules":{"fixedOffset":true,"transitions":[],"transitionRules":[]}},"nano":0,"year":2018,"monthValue":4,"dayOfMonth":25,"hour":20,"minute":36,"second":0,"dayOfWeek":"WEDNESDAY","dayOfYear":115,"month":"APRIL"}
post
/customers/{id}

Deletes a customer by ID

delete

Permanently deletes a customer by supplying the unique identifier of the customer

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired

Customer ID

Responses
delete
/customers/{id}

No content

Attaches a source to a customer

post

Attaches a source to a customer

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired

Customer ID

sourceIdstring · uuidRequired

Source ID

Responses
chevron-right
200

200 OK

application/json
idstringRead-onlyOptional

Unique identifier for the source.

Example: a6809a63-e6a9-4016-abbc-f33d19fccb5b
clientSecretstringOptional

Used for client-side retrieval using a public key.

Example: 52199c06-b261-4786-8609-d0a84185a0d2_2b72614b-77f6-4801-bd48-8982e314fdd5
createdTimestring · date-timeRead-onlyOptional

Time when the source was created.

Example: {"offset":{"totalSeconds":0,"id":"Z","rules":{"fixedOffset":true,"transitions":[],"transitionRules":[]}},"nano":0,"year":2018,"monthValue":4,"dayOfMonth":25,"hour":20,"minute":36,"second":0,"dayOfWeek":"WEDNESDAY","dayOfYear":115,"month":"APRIL"}
typestring · enumOptional

The payment type of the source. The payment type will correspond to another element in the source response that contains detailed information specific to the type. For example, a type of creditCard indicates that there is an object in the response named creditCard.

Example: creditCardPossible values:
currencystringOptional

Three-letter ISO currency code.

Example: USD
amountnumber · doubleOptional

Amount associated with the source. Once ready, the source will be charged this amount. Required for single_use sources.

Example: 1180.26
reusablebooleanOptional

If true, you can reuse this source, if false, only once.

Example: true
flowstring · enumOptional

The authentication flow of the source.

Example: standardPossible values:
statestring · enumOptional

The status of the source, one of pending_funds, pending_redirect, requires_action, cancelled, chargeable, consumed or failed. You can only use chargeable sources to create a charge.

Example: chargeablePossible values:
customerIdstringRead-onlyOptional

Unique identifier of a customer.

Example: 5823594809
paymentSessionIdstringOptional

Tracks the process of collecting a payment.

Example: 8cecaa32-f692-44cc-b103-4cf24dc93913
liveModebooleanOptional

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

Example: false
post
/customers/{id}/sources/{sourceId}

Detaches a source from a customer

delete

Detaches a source from a customer

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired

Customer ID

sourceIdstring · uuidRequired

Source ID

Responses
delete
/customers/{id}/sources/{sourceId}

No content

Attaches a tax identifier to a customer

post

Attaches a tax identifier to a customer

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired

Customer ID

taxIdstring · uuidRequired

Tax ID

Responses
chevron-right
200

200 OK

application/json
idstringRead-onlyOptional

The identifier of the tax identifier.

Example: 5774321009
createdTimestring · date-timeRead-onlyOptional

The time when the tax identifier was created.

Example: {"offset":{"totalSeconds":0,"id":"Z","rules":{"fixedOffset":true,"transitions":[],"transitionRules":[]}},"nano":0,"year":2018,"monthValue":4,"dayOfMonth":25,"hour":20,"minute":36,"second":0,"dayOfWeek":"WEDNESDAY","dayOfYear":115,"month":"APRIL"}
customerIdstring · nullableOptional

The identifier of an existing customer.

Example: 5774321009
typestringRead-onlyOptional

Type of tax identifier.

Example: de
valuestringOptional

The tax identifier.

Example: DE123456789
statestring · enumRead-onlyOptional

The verification state.

Example: pendingPossible values:
verifiedNamestring · nullableOptional

The registered name of the customer with this tax identifier.

Example: .
verifiedAddressstring · nullableOptional

The registered address of the customer with this tax identifier.

Example: .
updatedTimestring · date-timeRead-onlyOptional

The time when the tax identifier was updated.

Example: {"offset":{"totalSeconds":0,"id":"Z","rules":{"fixedOffset":true,"transitions":[],"transitionRules":[]}},"nano":0,"year":2018,"monthValue":4,"dayOfMonth":25,"hour":20,"minute":36,"second":0,"dayOfWeek":"WEDNESDAY","dayOfYear":115,"month":"APRIL"}
post
/customers/{id}/tax-identifiers/{taxId}

Last updated