Create a Customer Session

Changed on

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.

post/v1/customer_sessions

Request

  • Base URL: https://api.stripe.com
  • URL: https://api.stripe.com/v1/customer_sessions
  • Auth: one of:
    • HTTP basic
    • HTTP bearer

Request body application/x-www-form-urlencoded

customerstring

The ID of an existing customer for which to create the Customer Session.

customer_accountstring

The ID of an existing Account for which to create the Customer Session.

expandstring[]

Specifies which fields in the response should be expanded.

Response

Successful response.

client_secretstring required

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.

createdinteger required

Time at which the object was created. Measured in seconds since the Unix epoch.

customer_accountstring nullable

The Account that the Customer Session was created for.

expires_atinteger required

The timestamp at which this Customer Session will expire.

livemodeboolean required

If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.

object'customer_session' required

String representing the object's type. Objects of the same type share the same value.

Changes

    • warning

      added the new final_payment_failure enum value to the //////// response property for the response status

    • warning

      added the new first_payment_failure enum value to the //////// response property for the response status

    • info

      added the optional property ///// to the response with the status

Some revisions have not been checked yet.