Skip to main content
Schema2020-08-27object

checkout.session

A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout) or [Payment Links](https://stripe.com/docs/payments/payment-links). We recommend creating a new Session each time your customer attempts to pay. Once payment is successful, the Checkout Session will contain a reference to the [Customer](https://stripe.com/docs/api/customers), and either the successful [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active [Subscription](https://stripe.com/docs/api/subscriptions). You can create a Checkout Session on your server and pass its ID to the client to begin Checkout. Related guide: [Checkout Server Quickstart](https://stripe.com/docs/payments/checkout/api).

Source
openapi/spec3.json
Commit
d70de345383d
Active snapshot
da69df7e6e11

Session

object

A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout) or [Payment Links](https://stripe.com/docs/payments/payment-links). We recommend creating a new Session each time your customer attempts to pay. Once payment is successful, the Checkout Session will contain a reference to the [Customer](https://stripe.com/docs/api/customers), and either the successful [PaymentIntent](https://stripe.com/docs/…

after_expiration
optionalnullable

When set, provides configuration for actions to take if this Checkout Session expires.

allow_promotion_codes boolean
optionalnullable

Enables user redeemable promotion codes.

amount_subtotal integer
optionalnullable

Total of all items before discounts or taxes are applied.

amount_total integer
optionalnullable

Total of all items after discounts and taxes are applied.

billing_address_collection string
optionalnullable

Describes whether Checkout should collect the customer's billing address.

cancel_url string
required

The URL the customer will be directed to if they decide to cancel payment and return to your website.

client_reference_id string
optionalnullable

A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems.

consent
optionalnullable

Results of `consent_collection` for this session.

consent_collection
optionalnullable

When set, provides configuration for the Checkout Session to gather active consent from customers.

currency string
optionalnullable

Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).

customer
optionalnullable

The ID of the customer for this Session. For Checkout Sessions in `payment` or `subscription` mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created.

customer_details
optionalnullable

The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in `payment` or `subscription` mode.

customer_email string
optionalnullable

If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the `customer` attribute.

expires_at integer (unix-time)
required

The timestamp at which the Checkout Session will expire.

id string
required

Unique identifier for the object. Used to pass to `redirectToCheckout` in Stripe.js.

livemode boolean
required

Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.

locale string
optionalnullable

The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used.

metadata object
optionalnullable

Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

mode string
required

The mode of the Checkout Session.

object string
required

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

payment_intent
optionalnullable

The ID of the PaymentIntent for Checkout Sessions in `payment` mode.

payment_method_options
optionalnullable

Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.

payment_method_types array
required

A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.

payment_status string
required

The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. You can use this value to decide when to fulfill your customer's order.

recovered_from string
optionalnullable

The ID of the original expired Checkout Session that triggered the recovery flow.

setup_intent
optionalnullable

The ID of the SetupIntent for Checkout Sessions in `setup` mode.

shipping
optionalnullable

Shipping information for this Checkout Session.

shipping_address_collection
optionalnullable

When set, provides configuration for Checkout to collect a shipping address from a customer.

shipping_options array
required

The shipping rate options applied to this Session.

shipping_rate
optionalnullable

The ID of the ShippingRate for Checkout Sessions in `payment` mode.

status string
optionalnullable

The status of the Checkout Session, one of `open`, `complete`, or `expired`.

submit_type string
optionalnullable

Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be specified on Checkout Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode.

subscription
optionalnullable

The ID of the subscription for Checkout Sessions in `subscription` mode.

success_url string
required

The URL the customer will be directed to after the payment or subscription creation is successful.

total_details
optionalnullable

Tax and discount details for the computed total amount.

url string
optionalnullable

The URL to the Checkout Session.