Stripe: Customer sessions schemas
12 Stripe schemas with complete fields and constraints.
← Customer sessions operations · All schemas
Create a Customer Session — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A 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_secret | string | Required within parent | 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. Maximum length: 5000 |
components | Model | Optional | Expand Create a Customer Session — response body — components |
created | JSON | Required within parent | |
created (anyOf 1) | integer | Alternative | Time at which the object was created. Measured in seconds since the Unix epoch. Format: unix-time |
created (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
customer | JSON | Required within parent | The Customer the Customer Session was created for. |
customer (anyOf 1) | string | Alternative | Maximum length: 5000 |
customer (anyOf 2) | Model | Alternative | Expand Create a customer — response body |
customer_account | JSON | Optional | |
customer_account (anyOf 1) | string | Alternative | The Account that the Customer Session was created for. Maximum length: 5000 |
customer_account (anyOf 2) | null | Alternative | |
expires_at | JSON | Required within parent | |
expires_at (anyOf 1) | integer | Alternative | The timestamp at which this Customer Session will expire. Format: unix-time |
expires_at (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
livemode | boolean | Required within parent | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
object | string | Required within parent | String 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Configuration for the components supported by this Customer Session. |
active_entitlements | Model | Required within parent | Expand Create a Customer Session — response body — components active entitlements |
buy_button | Model | Required within parent | Expand Create a Customer Session — response body — components buy button |
customer_portal | Model | Required within parent | Expand Create a Customer Session — response body — components customer portal |
customer_sheet | Model | Required within parent | Expand Create a Customer Session — response body — components customer sheet |
mobile_payment_element | Model | Required within parent | Expand Create a Customer Session — response body — components mobile payment element |
payment_element | Model | Required within parent | Expand Create a Customer Session — response body — components payment element |
pricing_table | Model | Required within parent | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains the features the Payment Element supports. |
payment_method_allow_redisplay_filters | array | Required within parent | A 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[] | string | Each item | Known values: always, limited, unspecified |
payment_method_redisplay | string | Required within parent | Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. Known values: disabled, enabled |
payment_method_redisplay_limit | JSON | Optional | |
payment_method_redisplay_limit (anyOf 1) | JSON | Alternative | |
payment_method_redisplay_limit (anyOf 1) (anyOf 1) | integer | Alternative | Determines 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) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
payment_method_redisplay_limit (anyOf 2) | null | Alternative | |
payment_method_remove | string | Required within parent | 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 [`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_save | string | Required within parent | 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_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_usage | JSON | Optional | |
payment_method_save_usage (anyOf 1) | string | Alternative | When 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) | null | Alternative |
Create a Customer Session — response body — components active entitlements
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains whether the active entitlements is enabled. |
enabled | boolean | Required within parent | Whether the active entitlements is enabled. |
Create a Customer Session — response body — components buy button
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains whether the buy button is enabled. |
enabled | boolean | Required within parent | Whether the buy button is enabled. |
Create a Customer Session — response body — components customer portal
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains whether the customer portal is enabled. |
enabled | boolean | Required within parent | Whether the customer portal is enabled. |
Create a Customer Session — response body — components customer sheet
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains whether the customer sheet is enabled and the features it supports. |
enabled | boolean | Required within parent | Whether the customer sheet is enabled. |
features | JSON | Optional | |
features (anyOf 1) | JSON | Alternative | This hash defines whether the customer sheet supports certain features. |
features (anyOf 1) (anyOf 1) | Model | Alternative | Expand Create a Customer Session — response body — components customer sheet features value payment method allow redisplay filters, payment method remove |
features (anyOf 2) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains the features the customer sheet supports. |
payment_method_allow_redisplay_filters | JSON | Optional | |
payment_method_allow_redisplay_filters (anyOf 1) | array | Alternative | A 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)[] | string | Each item | Known values: always, limited, unspecified |
payment_method_allow_redisplay_filters (anyOf 2) | null | Alternative | |
payment_method_remove | JSON | Optional | |
payment_method_remove (anyOf 1) | string | Alternative | 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 [`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) | null | Alternative |
Create a Customer Session — response body — components mobile payment element
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains whether the mobile payment element is enabled and the features it supports. |
enabled | boolean | Required within parent | Whether the mobile payment element is enabled. |
features | JSON | Optional | |
features (anyOf 1) | JSON | Alternative | This hash defines whether the mobile payment element supports certain features. |
features (anyOf 1) (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains the features the mobile payment element supports. |
payment_method_allow_redisplay_filters | JSON | Optional | |
payment_method_allow_redisplay_filters (anyOf 1) | array | Alternative | A 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)[] | string | Each item | Known values: always, limited, unspecified |
payment_method_allow_redisplay_filters (anyOf 2) | null | Alternative | |
payment_method_redisplay | JSON | Optional | |
payment_method_redisplay (anyOf 1) | string | Alternative | Controls whether or not the mobile payment element shows saved payment methods. Known values: disabled, enabled |
payment_method_redisplay (anyOf 2) | null | Alternative | |
payment_method_remove | JSON | Optional | |
payment_method_remove (anyOf 1) | string | Alternative | 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 [`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) | null | Alternative | |
payment_method_save | JSON | Optional | |
payment_method_save (anyOf 1) | string | Alternative | Controls 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) | null | Alternative | |
payment_method_save_allow_redisplay_override | JSON | Optional | |
payment_method_save_allow_redisplay_override (anyOf 1) | string | Alternative | 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). Known values: always, limited, unspecified |
payment_method_save_allow_redisplay_override (anyOf 2) | null | Alternative |
Create a Customer Session — response body — components payment element
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains whether the Payment Element is enabled and the features it supports. |
enabled | boolean | Required within parent | Whether the Payment Element is enabled. |
features | JSON | Optional | |
features (anyOf 1) | JSON | Alternative | This hash defines whether the Payment Element supports certain features. |
features (anyOf 1) (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative |
Create a Customer Session — response body — components pricing table
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This hash contains whether the pricing table is enabled. |
enabled | boolean | Required within parent | Whether the pricing table is enabled. |