Skip to content

Stripe: Customer sessions schemas

12 Stripe schemas with complete fields and constraints.

← Customer sessions operations · All schemas

Create a Customer Session — response body

FieldTypePresenceDescription and constraints
$objectRootA Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
control over a Customer.

Related guides: [Customer Session with the Payment Element](/payments/accept-a-payment-deferred?platform=web&type=payment#save-payment-methods),
[Customer Session with the Pricing Table](/payments/checkout/pricing-table#customer-session),
[Customer Session with the Buy Button](/payment-links/buy-button#pass-an-existing-customer).
client_secretstringRequired within parentThe 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.
Maximum length: 5000
componentsModelOptionalExpand Create a Customer Session — response body — components
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
customerJSONRequired within parentThe Customer the Customer Session was created for.
customer (anyOf 1)stringAlternativeMaximum length: 5000
customer (anyOf 2)ModelAlternativeExpand Create a customer — response body
customer_accountJSONOptional
customer_account (anyOf 1)stringAlternativeThe Account that the Customer Session was created for.
Maximum length: 5000
customer_account (anyOf 2)nullAlternative
expires_atJSONRequired within parent
expires_at (anyOf 1)integerAlternativeThe timestamp at which this Customer Session will expire.
Format: unix-time
expires_at (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: customer_session

Referenced models: Create a customer — response body, Create a Customer Session — response body — components

Create a Customer Session — response body — components

FieldTypePresenceDescription and constraints
$objectRootConfiguration for the components supported by this Customer Session.
active_entitlementsModelRequired within parentExpand Create a Customer Session — response body — components active entitlements
buy_buttonModelRequired within parentExpand Create a Customer Session — response body — components buy button
customer_portalModelRequired within parentExpand Create a Customer Session — response body — components customer portal
customer_sheetModelRequired within parentExpand Create a Customer Session — response body — components customer sheet
mobile_payment_elementModelRequired within parentExpand Create a Customer Session — response body — components mobile payment element
payment_elementModelRequired within parentExpand Create a Customer Session — response body — components payment element
pricing_tableModelRequired within parentExpand Create a Customer Session — response body — components pricing table

Referenced models: Create a Customer Session — response body — components active entitlements, Create a Customer Session — response body — components buy button, Create a Customer Session — response body — components customer portal, Create a Customer Session — response body — components customer sheet, Create a Customer Session — response body — components mobile payment element, Create a Customer Session — response body — components payment element, Create a Customer Session — response body — components pricing table

Create a Customer Session — response body — components / payment_element / features / value / payment_method_redisplay: disabled, enabled, payment method remove: disabled, enabled, payment method save: disabled, enabled

FieldTypePresenceDescription and constraints
$objectRootThis hash contains the features the Payment Element supports.
payment_method_allow_redisplay_filtersarrayRequired within parentA list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list.

If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"].
payment_method_allow_redisplay_filters[]stringEach itemKnown values: always, limited, unspecified
payment_method_redisplaystringRequired within parentControls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`.
Known values: disabled, enabled
payment_method_redisplay_limitJSONOptional
payment_method_redisplay_limit (anyOf 1)JSONAlternative
payment_method_redisplay_limit (anyOf 1) (anyOf 1)integerAlternativeDetermines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`.
payment_method_redisplay_limit (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
payment_method_redisplay_limit (anyOf 2)nullAlternative
payment_method_removestringRequired within parentControls 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 [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods).
Known values: disabled, enabled
payment_method_savestringRequired within parentControls 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_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`.
Known values: disabled, enabled
payment_method_save_usageJSONOptional
payment_method_save_usage (anyOf 1)stringAlternativeWhen using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent.

When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation.
Known values: off_session, on_session
payment_method_save_usage (anyOf 2)nullAlternative

Create a Customer Session — response body — components active entitlements

FieldTypePresenceDescription and constraints
$objectRootThis hash contains whether the active entitlements is enabled.
enabledbooleanRequired within parentWhether the active entitlements is enabled.

Create a Customer Session — response body — components buy button

FieldTypePresenceDescription and constraints
$objectRootThis hash contains whether the buy button is enabled.
enabledbooleanRequired within parentWhether the buy button is enabled.

Create a Customer Session — response body — components customer portal

FieldTypePresenceDescription and constraints
$objectRootThis hash contains whether the customer portal is enabled.
enabledbooleanRequired within parentWhether the customer portal is enabled.

Create a Customer Session — response body — components customer sheet

FieldTypePresenceDescription and constraints
$objectRootThis hash contains whether the customer sheet is enabled and the features it supports.
enabledbooleanRequired within parentWhether the customer sheet is enabled.
featuresJSONOptional
features (anyOf 1)JSONAlternativeThis hash defines whether the customer sheet supports certain features.
features (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a Customer Session — response body — components customer sheet features value payment method allow redisplay filters, payment method remove
features (anyOf 2)nullAlternative

Referenced models: Create a Customer Session — response body — components customer sheet features value payment method allow redisplay filters, payment method remove

Create a Customer Session — response body — components customer sheet features value payment method allow redisplay filters, payment method remove

FieldTypePresenceDescription and constraints
$objectRootThis hash contains the features the customer sheet supports.
payment_method_allow_redisplay_filtersJSONOptional
payment_method_allow_redisplay_filters (anyOf 1)arrayAlternativeA list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the customer sheet displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list.

If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"].
payment_method_allow_redisplay_filters (anyOf 1)[]stringEach itemKnown values: always, limited, unspecified
payment_method_allow_redisplay_filters (anyOf 2)nullAlternative
payment_method_removeJSONOptional
payment_method_remove (anyOf 1)stringAlternativeControls 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 [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods).
Known values: disabled, enabled
payment_method_remove (anyOf 2)nullAlternative

Create a Customer Session — response body — components mobile payment element

FieldTypePresenceDescription and constraints
$objectRootThis hash contains whether the mobile payment element is enabled and the features it supports.
enabledbooleanRequired within parentWhether the mobile payment element is enabled.
featuresJSONOptional
features (anyOf 1)JSONAlternativeThis hash defines whether the mobile payment element supports certain features.
features (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a Customer Session — response body — components mobile payment element features value payment method allow redisplay filters, payment method redisplay, payment method remove, payment method save, payment method save allow redisplay override
features (anyOf 2)nullAlternative

Referenced models: Create a Customer Session — response body — components mobile payment element features value payment method allow redisplay filters, payment method redisplay, payment method remove, payment method save, payment method save allow redisplay override

Create a Customer Session — response body — components mobile payment element features value payment method allow redisplay filters, payment method redisplay, payment method remove, payment method save, payment method save allow redisplay override

FieldTypePresenceDescription and constraints
$objectRootThis hash contains the features the mobile payment element supports.
payment_method_allow_redisplay_filtersJSONOptional
payment_method_allow_redisplay_filters (anyOf 1)arrayAlternativeA list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the mobile payment element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list.

If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"].
payment_method_allow_redisplay_filters (anyOf 1)[]stringEach itemKnown values: always, limited, unspecified
payment_method_allow_redisplay_filters (anyOf 2)nullAlternative
payment_method_redisplayJSONOptional
payment_method_redisplay (anyOf 1)stringAlternativeControls whether or not the mobile payment element shows saved payment methods.
Known values: disabled, enabled
payment_method_redisplay (anyOf 2)nullAlternative
payment_method_removeJSONOptional
payment_method_remove (anyOf 1)stringAlternativeControls 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 [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods).
Known values: disabled, enabled
payment_method_remove (anyOf 2)nullAlternative
payment_method_saveJSONOptional
payment_method_save (anyOf 1)stringAlternativeControls whether the mobile payment element displays a checkbox offering to save a new payment method.

If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`.
Known values: disabled, enabled
payment_method_save (anyOf 2)nullAlternative
payment_method_save_allow_redisplay_overrideJSONOptional
payment_method_save_allow_redisplay_override (anyOf 1)stringAlternativeAllows 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).
Known values: always, limited, unspecified
payment_method_save_allow_redisplay_override (anyOf 2)nullAlternative

Create a Customer Session — response body — components payment element

FieldTypePresenceDescription and constraints
$objectRootThis hash contains whether the Payment Element is enabled and the features it supports.
enabledbooleanRequired within parentWhether the Payment Element is enabled.
featuresJSONOptional
features (anyOf 1)JSONAlternativeThis hash defines whether the Payment Element supports certain features.
features (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a Customer Session — response body — components / payment_element / features / value / payment_method_redisplay: disabled, enabled, payment method remove: disabled, enabled, payment method save: disabled, enabled
features (anyOf 2)nullAlternative

Referenced models: Create a Customer Session — response body — components / payment_element / features / value / payment_method_redisplay: disabled, enabled, payment method remove: disabled, enabled, payment method save: disabled, enabled

Create a Customer Session — response body — components pricing table

FieldTypePresenceDescription and constraints
$objectRootThis hash contains whether the pricing table is enabled.
enabledbooleanRequired within parentWhether the pricing table is enabled.

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.