Sample - Stripe API
GET/v1/checkout/sessions/{session}

Retrieve a Checkout Session

Retrieves a Checkout Session by its identifier. Use expand to include selected related fields in the response when needed. The response contains the session's payment, customer, expiration, and Checkout configuration.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
sessionstringrequired
The identifier of the Checkout Session to retrieve. Maximum 66 characters.
expandarray<string>optional
Fields to expand in the response. Each field name can be up to 5,000 characters.

2 status codes
200Returns the requested Checkout Session object, including its identifier, mode, payment status, expiration time, payment method types, totals, and customer-facing configuration.
adaptive_pricingobjectoptional
Settings for price localization with [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing).
after_expirationobjectoptional
When set, provides configuration for actions to take if this Checkout Session expires.
allow_promotion_codesbooleanoptional
Enables user redeemable promotion codes.
amount_subtotalintegeroptional
Total of all items before discounts or taxes are applied.
amount_totalintegeroptional
Total of all items after discounts and taxes are applied.
automatic_taxobjectrequired
billing_address_collectionstringoptional
Describes whether Checkout should collect the customer's billing address. Defaults to `auto`.
Allowed:autorequired
branding_settingsobjectoptional
cancel_urlstringoptional
If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.
client_reference_idstringoptional
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.
client_secretstringoptional
The client secret of your Checkout Session. Applies to Checkout Sessions with `ui_mode: embedded_page` or `ui_mode: elements`. For `ui_mode: embedded_page`, the client secret is to be used when initializing Stripe.js embedded checkout. For `ui_mode: elements`, use the client secret with [initCheckout](https://docs.stripe.com/js/custom_checkout/init) on your front end.
collected_informationobjectoptional
Information about the customer collected within the Checkout Session.
consentobjectoptional
Results of `consent_collection` for this session.
consent_collectionobjectoptional
When set, provides configuration for the Checkout Session to gather active consent from customers.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
currencystringoptional
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).
currency_conversionobjectoptional
Currency conversion details for [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing) sessions created before 2025-03-31.
custom_fieldsarray<PaymentPagesCheckoutSessionCustomFields>required
Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `custom`.
custom_textobjectrequired
customerstringoptional
The ID of the customer for this Session. For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` 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_accountstringoptional
The ID of the account for this Session.
customer_creationstringoptional
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
Allowed:alwaysif_required
customer_detailsobjectoptional
The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in `setup` mode.
customer_emailstringoptional
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.
discountsarray<PaymentPagesCheckoutSessionDiscount>optional
List of coupons and promotion codes attached to the Checkout Session.
excluded_payment_method_typesarray<string>optional
A list of the types of payment methods (e.g., `card`) that should be excluded from this Checkout Session. This should only be used when payment methods for this Checkout Session are managed through the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
expires_atintegerrequired
The timestamp at which the Checkout Session will expire.
idstringrequired
Unique identifier for the object.
integration_identifierstringoptional
The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the same integration identifier.
invoicestringoptional
ID of the invoice created by the Checkout Session, if it exists.
invoice_creationobjectoptional
Details on the state of invoice creation for the Checkout Session.
line_itemsobjectoptional
The line items purchased by the customer.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
localestringoptional
The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used.
Allowed:autobgcsdadeelenen-GBeses-419etfi
managed_paymentsobjectoptional
Settings for Managed Payments for this Checkout Session and resulting [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object).
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
modestringrequired
The mode of the Checkout Session.
Allowed:paymentsetupsubscription
name_collectionobjectoptional
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:checkout.session
optional_itemsarray<PaymentPagesCheckoutSessionOptionalItem>optional
The optional items presented to the customer at checkout.
origin_contextstringoptional
Where the user is coming from. This informs the optimizations that are applied to the session.
Allowed:mobile_appweb
payment_intentstringoptional
The ID of the PaymentIntent for Checkout Sessions in `payment` mode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://docs.stripe.com/api/checkout/sessions/expire) instead.
payment_linkstringoptional
The ID of the Payment Link that created this Session.
payment_method_collectionstringoptional
Configure whether a Checkout Session should collect a payment method for sessions with mode `payment`. Defaults to `always`.
Allowed:alwaysif_required
payment_method_configuration_detailsobjectoptional
Information about the payment method configuration used for this Checkout session if using dynamic payment methods.
payment_method_optionsobjectoptional
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
payment_method_typesarray<string>required
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
payment_statusstringrequired
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.
Allowed:no_payment_requiredpaidunpaid
permissionsobjectoptional
This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. For specific permissions, please refer to their dedicated subsections, such as `permissions.update_shipping_details`.
phone_number_collectionobjectoptional
presentment_detailsobjectoptional
recovered_fromstringoptional
The ID of the original expired Checkout Session that triggered the recovery flow.
redirect_on_completionstringoptional
This parameter applies to `ui_mode: embedded_page`. Learn more about the [redirect behavior](https://docs.stripe.com/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`.
Allowed:alwaysif_requirednever
return_urlstringoptional
Applies to Checkout Sessions with `ui_mode: embedded_page` or `ui_mode: elements`. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
saved_payment_method_optionsobjectoptional
Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode.
setup_intentstringoptional
The ID of the SetupIntent for Checkout Sessions in `setup` mode. You can't confirm or cancel the SetupIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://docs.stripe.com/api/checkout/sessions/expire) instead.
shipping_address_collectionobjectoptional
When set, provides configuration for Checkout to collect a shipping address from a customer.
shipping_costobjectoptional
The details of the customer cost of shipping, including the customer chosen ShippingRate.
shipping_optionsarray<PaymentPagesCheckoutSessionShippingOption>required
The shipping rate options applied to this Session.
statusstringoptional
The status of the Checkout Session, one of `open`, `complete`, or `expired`.
Allowed:completeexpiredopen
submit_typestringoptional
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. If blank or `auto`, `pay` is used.
Allowed:autobookdonatepaysubscribe
subscriptionstringoptional
The ID of the [Subscription](https://docs.stripe.com/api/subscriptions) for Checkout Sessions in `subscription` mode.
success_urlstringoptional
The URL the customer will be directed to after the payment or subscription creation is successful.
tax_id_collectionobjectoptional
total_detailsobjectoptional
Tax and discount details for the computed total amount.
ui_modestringoptional
The UI mode of the Session. Defaults to `hosted_page`.
Allowed:elementsembedded_pagehosted_page
urlstringoptional
The URL to the Checkout Session. Applies to Checkout Sessions with `ui_mode: hosted_page`. Redirect customers to this URL to take them to Checkout. If you’re using [Custom Domains](https://docs.stripe.com/payments/checkout/custom-domains), the URL will use your subdomain. Otherwise, it’ll use `checkout.stripe.com.` This value is only present when the session is active.
wallet_optionsobjectoptional
Wallet-specific configuration for this Checkout Session.
defaultReturned when the Checkout Session cannot be retrieved for the supplied identifier.
errorobjectrequired

Error handling

session must be a string no longer than 66 characters and must identify the Checkout Session to retrieve. Each expand value can be used to request an expanded response field and must not exceed 5,000 characters.