POST
/v1/customer_sessionsCreate a Customer Session
Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
componentsobjectrequired
Configuration for each component. At least 1 component must be enabled.
customerstringoptional
The ID of an existing customer for which to create the Customer Session.
customer_accountstringoptional
The ID of an existing Account for which to create the Customer Session.
expandarray<string>optional
Specifies which fields in the response should be expanded.
200Successful response.
client_secretstringrequired
The client secret of this Customer Session. Used on the client to set up secure access to the given `customer`.
The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.
componentsobjectoptional
Configuration for the components supported by this Customer Session.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
customerstringrequired
The Customer the Customer Session was created for.
customer_accountstringoptional
The Account that the Customer Session was created for.
expires_atintegerrequired
The timestamp at which this Customer Session will expire.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
defaultError response.
errorobjectrequired
Error handling
Any other status is an error: Error response.