Attributes
- client_
secretstring 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
customerfrom 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. - componentsobject
This hash defines which component is enabled and the features it supports.
- components.
object Configuration for buy button.
- components.
buy_button. boolean Whether the buy button is enabled.
- components.
customer_ sheetobject Configuration for the customer sheet.
- components.
customer_sheet. enabledboolean Whether the customer sheet is enabled.
- components.
customer_sheet. featuresnullable object This hash defines whether the customer sheet supports certain features.
- components.
customer_sheet. features. payment_ method_ allow_ redisplay_ filtersnullable array of enums A list of
allow_values that controls which saved payment methods the customer sheet displays by filtering to only show payment methods with anredisplay allow_value that is present in this list.redisplay If not specified, defaults to [“always”]. In order to display all saved payment methods, specify [“always”, “limited”, “unspecified”].
Possible enum valuesalwaysUse
alwaysto indicate that this payment method can always be shown to a customer in a checkout flow.limitedUse
limitedto indicate that this payment method can’t always be shown to a customer in a checkout flow. For example, it can only be shown in the context of a specific subscription.unspecifiedThis is the default value for payment methods where
allow_wasn’t set.redisplay - components.
customer_sheet. features. payment_ method_ removenullable enum Controls whether the customer sheet displays the option to remove a saved payment method."
Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the
customerobject from that PaymentMethod.Possible enum valuesdisabledThe feature is disabled.
enabledThe feature is enabled.
- components.
mobile_ payment_ elementobject Configuration for the mobile payment element.
- components.
mobile_payment_element. enabledboolean Whether the mobile payment element is enabled.
- components.
mobile_payment_element. featuresnullable object This hash defines whether the mobile payment element supports certain features.
- components.
mobile_payment_element. features. payment_ method_ allow_ redisplay_ filtersnullable array of enums A list of
allow_values that controls which saved payment methods the mobile payment element displays by filtering to only show payment methods with anredisplay allow_value that is present in this list.redisplay If not specified, defaults to [“always”]. In order to display all saved payment methods, specify [“always”, “limited”, “unspecified”].
Possible enum valuesalwaysUse
alwaysto indicate that this payment method can always be shown to a customer in a checkout flow.limitedUse
limitedto indicate that this payment method can’t always be shown to a customer in a checkout flow. For example, it can only be shown in the context of a specific subscription.unspecifiedThis is the default value for payment methods where
allow_wasn’t set.redisplay - components.
mobile_payment_element. features. payment_ method_ redisplaynullable enum Controls whether or not the mobile payment element shows saved payment methods.
Possible enum valuesdisabledThe feature is disabled.
enabledThe feature is enabled.
- components.
mobile_payment_element. features. payment_ method_ removenullable enum Controls whether the mobile payment element displays the option to remove a saved payment method."
Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the
customerobject from that PaymentMethod.Possible enum valuesdisabledThe feature is disabled.
enabledThe feature is enabled.
- components.
mobile_payment_element. features. payment_ method_ savenullable enum Controls whether the mobile payment element displays a checkbox offering to save a new payment method.
If a customer checks the box, the
allow_value on the PaymentMethod is set toredisplay 'always'at confirmation time. For PaymentIntents, thesetup_value is also set to the value defined infuture_ usage payment_.method_ save_ usage Possible enum valuesdisabledThe feature is disabled.
enabledThe feature is enabled.
- components.
mobile_payment_element. features. payment_ method_ save_ allow_ redisplay_ overridenullable enum Allows overriding the value of allow_override when saving a new payment method when payment_method_save is set to disabled. Use values: “always”, “limited”, or “unspecified”.
If not specified, defaults to
nil(no override value).Possible enum valuesalwaysUse
alwaysto indicate that this payment method can always be shown to a customer in a checkout flow.limitedUse
limitedto indicate that this payment method can’t always be shown to a customer in a checkout flow. For example, it can only be shown in the context of a specific subscription.unspecifiedThis is the default value for payment methods where
allow_wasn’t set.redisplay
- components.
payment_ elementobject Configuration for the Payment Element.
- components.
payment_element. enabledboolean Whether the Payment Element is enabled.
- components.
payment_element. featuresnullable object This hash defines whether the Payment Element supports certain features.
- components.
payment_element. features. payment_ method_ allow_ redisplay_ filtersarray of enums A list of
allow_values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with anredisplay allow_value that is present in this list.redisplay If not specified, defaults to [“always”]. In order to display all saved payment methods, specify [“always”, “limited”, “unspecified”].
Possible enum valuesalwaysUse
alwaysto indicate that this payment method can always be shown to a customer in a checkout flow.limitedUse
limitedto indicate that this payment method can’t always be shown to a customer in a checkout flow. For example, it can only be shown in the context of a specific subscription.unspecifiedThis is the default value for payment methods where
allow_wasn’t set.redisplay - components.
payment_element. features. payment_ method_ redisplayenum Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to
disabled.Possible enum valuesdisabledThe feature is disabled.
enabledThe feature is enabled.
- components.
payment_element. features. payment_ method_ redisplay_ limitnullable integer Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to
3. The maximum redisplay limit is10. - components.
payment_element. features. payment_ method_ removeenum Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to
disabled.Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the
customerobject from that PaymentMethod.Possible enum valuesdisabledThe feature is disabled.
enabledThe feature is enabled.
- components.
payment_element. features. payment_ method_ saveenum Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to
disabled.If a customer checks the box, the
allow_value on the PaymentMethod is set toredisplay 'always'at confirmation time. For PaymentIntents, thesetup_value is also set to the value defined infuture_ usage payment_.method_ save_ usage Possible enum valuesdisabledThe feature is disabled.
enabledThe feature is enabled.
- components.
payment_element. features. payment_ method_ save_ usagenullable enum When using PaymentIntents and the customer checks the save checkbox, this field determines the
setup_value used to confirm the PaymentIntent.future_ usage When using SetupIntents, directly configure the
usagevalue on SetupIntent creation.Possible enum valuesoff_session Use
off_if your customer may or may not be present in your checkout flow.session on_session Use
on_if you intend to only reuse the payment method when your customer is present in your checkout flow.session
- components.
pricing_ tableobject Configuration for the pricing table.
- components.
pricing_table. enabledboolean Whether the pricing table is enabled.
- components.
tax_ id_ elementobjectPreview feature Configuration for the Tax ID Element.
- components.
tax_id_element. enabledboolean Whether the Tax ID Element is enabled.
- components.
tax_id_element. featuresnullable object This hash defines whether the Tax ID Element supports certain features.
- components.
tax_id_element. features. tax_ id_ redisplayenum Controls whether the Tax ID Element displays saved tax IDs for the customer. This parameter defaults to
disabled.When enabled, the Tax ID Element will show existing tax IDs associated with the customer, allowing them to select from previously saved tax identification numbers.
Possible enum valuesdisabledThe feature is disabled.
enabledThe feature is enabled.
- components.
tax_id_element. features. tax_ id_ saveenum Controls whether the Tax ID Element allows merchants to save new tax IDs for their customer. This parameter defaults to
disabled.When enabled, customers can enter and save new tax identification numbers during the payment flow, which will be stored securely and associated with their customer object for future use.
Possible enum valuesdisabledThe feature is disabled.
enabledThe feature is enabled.
- customerstringExpandable
The Customer the Customer Session was created for.
- expires_
attimestamp The timestamp at which this Customer Session will expire.
More attributes
- objectstring
String representing the object’s type. Objects of the same type share the same value.
- createdtimestamp
Time at which the object was created. Measured in seconds since the Unix epoch.
- livemodeboolean
Has the value
trueif the object exists in live mode or the valuefalseif the object exists in test mode.
{ "object": "customer_session", "client_secret": "_POpxYpmkXdtttYtZQYhrsOJZ2RCQ9kCqqXRU6qrP5c4Jgje", "components": { "buy_button": { "enabled": false }, "pricing_table": { "enabled": true } }, "customer": "cus_PO34b57IOUb83c", "expires_at": 1684790027, "livemode": false}