Session class
auto generated A Checkout Session represents your customer's session as they pay forone-time purchases or subscriptions through Checkoutor Payment Links. We recommend creating anew Session each time your customer attempts to pay.Once payment is successful, the Checkout Session will contain a referenceto the Customer, and either the successfulPaymentIntent or an activeSubscription.You can create a Checkout Session on your server and redirect to its URLto begin Checkout.Related guide: Checkout quickstart
Properties
- adaptivePricing ↔ PaymentPagesCheckoutSessionAdaptivePricing?
-
Settings for price localization with Adaptive Pricing.
getter/setter pair
-
additionalData
↔ Map<
String, Object?> -
Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
getter/setter pairoverride
- afterExpiration ↔ PaymentPagesCheckoutSessionAfterExpiration?
-
When set, provides configuration for actions to take if this Checkout Session expires.
getter/setter pair
- allowPromotionCodes ↔ bool?
-
Enables user redeemable promotion codes.
getter/setter pair
- amountSubtotal ↔ int?
-
Total of all items before discounts or taxes are applied.
getter/setter pair
- amountTotal ↔ int?
-
Total of all items after discounts and taxes are applied.
getter/setter pair
- automaticTax ↔ PaymentPagesCheckoutSessionAutomaticTax?
-
The automatic_tax property
getter/setter pair
- billingAddressCollection ↔ SessionBillingAddressCollection?
-
Describes whether Checkout should collect the customer's billing address. Defaults to
auto.getter/setter pair - brandingSettings ↔ PaymentPagesCheckoutSessionBrandingSettings?
-
The branding_settings property
getter/setter pair
- cancelUrl ↔ String?
-
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.
getter/setter pair
- clientReferenceId ↔ String?
-
A unique string to reference the Checkout Session. This can be acustomer ID, a cart ID, or similar, and can be used to reconcile theSession with your internal systems.
getter/setter pair
- clientSecret ↔ String?
-
The client secret of your Checkout Session. Applies to Checkout Sessions with
ui_mode: embeddedorui_mode: custom. Forui_mode: embedded, the client secret is to be used when initializing Stripe.js embedded checkout. Forui_mode: custom, use the client secret with initCheckout on your front end.getter/setter pair - collectedInformation ↔ PaymentPagesCheckoutSessionCollectedInformation?
-
Information about the customer collected within the Checkout Session.
getter/setter pair
- consent ↔ PaymentPagesCheckoutSessionConsent?
-
Results of
consent_collectionfor this session.getter/setter pair - consentCollection ↔ PaymentPagesCheckoutSessionConsentCollection?
-
When set, provides configuration for the Checkout Session to gather active consent from customers.
getter/setter pair
- created ↔ int?
-
Time at which the object was created. Measured in seconds since the Unix epoch.
getter/setter pair
- currency ↔ String?
-
Three-letter ISO currency code, in lowercase. Must be a supported currency.
getter/setter pair
- currencyConversion ↔ PaymentPagesCheckoutSessionCurrencyConversion?
-
Currency conversion details for Adaptive Pricing sessions created before 2025-03-31.
getter/setter pair
- customer ↔ SessionCustomer?
-
The ID of the customer for this Session.For Checkout Sessions in
subscriptionmode or Checkout Sessions withcustomer_creationset asalwaysinpaymentmode, Checkoutwill create a new customer object based on information providedduring the payment flow unless an existing customer was provided whenthe Session was created.getter/setter pair - customerAccount ↔ String?
-
The ID of the account for this Session.
getter/setter pair
- customerCreation ↔ SessionCustomerCreation?
-
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
getter/setter pair
- customerDetails ↔ PaymentPagesCheckoutSessionCustomerDetails?
-
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
setupmode.getter/setter pair - customerEmail ↔ String?
-
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 emailon file. To access information about the customer once the payment flow iscomplete, use the
customerattribute.getter/setter pair -
customFields
↔ Iterable<
PaymentPagesCheckoutSessionCustomFields> ? -
Collect additional information from your customer using custom fields. Up to 3 fields are supported.
getter/setter pair
- customText ↔ PaymentPagesCheckoutSessionCustomText?
-
The custom_text property
getter/setter pair
-
discounts
↔ Iterable<
PaymentPagesCheckoutSessionDiscount> ? -
List of coupons and promotion codes attached to the Checkout Session.
getter/setter pair
-
excludedPaymentMethodTypes
↔ Iterable<
String> ? -
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.getter/setter pair - expiresAt ↔ int?
-
The timestamp at which the Checkout Session will expire.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
Unique identifier for the object.
getter/setter pair
- invoice ↔ SessionInvoice?
-
ID of the invoice created by the Checkout Session, if it exists.
getter/setter pair
- invoiceCreation ↔ PaymentPagesCheckoutSessionInvoiceCreation?
-
Details on the state of invoice creation for the Checkout Session.
getter/setter pair
- lineItems ↔ SessionLineItems?
-
The line items purchased by the customer.
getter/setter pair
- livemode ↔ bool?
-
Has the value
trueif the object exists in live mode or the valuefalseif the object exists in test mode.getter/setter pair - locale ↔ SessionLocale?
-
The IETF language tag of the locale Checkout is displayed in. If blank or
auto, the browser's locale is used.getter/setter pair - metadata ↔ SessionMetadata?
-
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
getter/setter pair
- mode ↔ SessionMode?
-
The mode of the Checkout Session.
getter/setter pair
- nameCollection ↔ PaymentPagesCheckoutSessionNameCollection?
-
The name_collection property
getter/setter pair
- object ↔ SessionObject?
-
String representing the object's type. Objects of the same type share the same value.
getter/setter pair
-
optionalItems
↔ Iterable<
PaymentPagesCheckoutSessionOptionalItem> ? -
The optional items presented to the customer at checkout.
getter/setter pair
- originContext ↔ SessionOriginContext?
-
Where the user is coming from. This informs the optimizations that are applied to the session.
getter/setter pair
- paymentIntent ↔ SessionPaymentIntent?
-
The ID of the PaymentIntent for Checkout Sessions in
paymentmode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, expire the Checkout Session instead.getter/setter pair - paymentLink ↔ SessionPaymentLink?
-
The ID of the Payment Link that created this Session.
getter/setter pair
- paymentMethodCollection ↔ SessionPaymentMethodCollection?
-
Configure whether a Checkout Session should collect a payment method. Defaults to
always.getter/setter pair - paymentMethodConfigurationDetails ↔ PaymentMethodConfigBizPaymentMethodConfigurationDetails?
-
Information about the payment method configuration used for this Checkout session if using dynamic payment methods.
getter/setter pair
- paymentMethodOptions ↔ CheckoutSessionPaymentMethodOptions?
-
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
getter/setter pair
-
paymentMethodTypes
↔ Iterable<
String> ? -
A list of the types of payment methods (e.g. card) this CheckoutSession is allowed to accept.
getter/setter pair
- paymentStatus ↔ SessionPaymentStatus?
-
The payment status of the Checkout Session, one of
paid,unpaid, orno_payment_required.You can use this value to decide when to fulfill your customer's order.getter/setter pair - permissions ↔ PaymentPagesCheckoutSessionPermissions?
-
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.getter/setter pair - phoneNumberCollection ↔ PaymentPagesCheckoutSessionPhoneNumberCollection?
-
The phone_number_collection property
getter/setter pair
- presentmentDetails ↔ PaymentFlowsPaymentIntentPresentmentDetails?
-
The presentment_details property
getter/setter pair
- recoveredFrom ↔ String?
-
The ID of the original expired Checkout Session that triggered the recovery flow.
getter/setter pair
- redirectOnCompletion ↔ SessionRedirectOnCompletion?
-
This parameter applies to
ui_mode: embedded. Learn more about the redirect behavior of embedded sessions. Defaults toalways.getter/setter pair - returnUrl ↔ String?
-
Applies to Checkout Sessions with
ui_mode: embeddedorui_mode: custom. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- savedPaymentMethodOptions ↔ PaymentPagesCheckoutSessionSavedPaymentMethodOptions?
-
Controls saved payment method settings for the session. Only available in
paymentandsubscriptionmode.getter/setter pair - setupIntent ↔ SessionSetupIntent?
-
The ID of the SetupIntent for Checkout Sessions in
setupmode. You can't confirm or cancel the SetupIntent for a Checkout Session. To cancel, expire the Checkout Session instead.getter/setter pair - shippingAddressCollection ↔ PaymentPagesCheckoutSessionShippingAddressCollection?
-
When set, provides configuration for Checkout to collect a shipping address from a customer.
getter/setter pair
- shippingCost ↔ PaymentPagesCheckoutSessionShippingCost?
-
The details of the customer cost of shipping, including the customer chosen ShippingRate.
getter/setter pair
-
shippingOptions
↔ Iterable<
PaymentPagesCheckoutSessionShippingOption> ? -
The shipping rate options applied to this Session.
getter/setter pair
- status ↔ SessionStatus?
-
The status of the Checkout Session, one of
open,complete, orexpired.getter/setter pair - submitType ↔ SessionSubmitType?
-
Describes the type of transaction being performed by Checkout in order to customizerelevant text on the page, such as the submit button.
submit_typecan only bespecified on Checkout Sessions inpaymentmode. If blank orauto,payis used.getter/setter pair - subscription ↔ SessionSubscription?
-
The ID of the Subscription for Checkout Sessions in
subscriptionmode.getter/setter pair - successUrl ↔ String?
-
The URL the customer will be directed to after the payment orsubscription creation is successful.
getter/setter pair
- taxIdCollection ↔ PaymentPagesCheckoutSessionTaxIdCollection?
-
The tax_id_collection property
getter/setter pair
- totalDetails ↔ PaymentPagesCheckoutSessionTotalDetails?
-
Tax and discount details for the computed total amount.
getter/setter pair
- uiMode ↔ SessionUiMode?
-
The UI mode of the Session. Defaults to
hosted.getter/setter pair - url ↔ String?
-
The URL to the Checkout Session. Applies to Checkout Sessions with
ui_mode: hosted. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll usecheckout.stripe.com.This value is only present when the session is active.getter/setter pair - walletOptions ↔ CheckoutSessionWalletOptions?
-
Wallet-specific configuration for this Checkout Session.
getter/setter pair
Methods
-
getFieldDeserializers(
) → Map< String, void Function(ParseNode)> -
The deserialization information for the current model
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
serialize(
SerializationWriter writer) → void -
Serializes information the current object
writerSerialization writer to use to serialize this modeloverride -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createFromDiscriminatorValue(
ParseNode parseNode) → Session -
Creates a new instance of the appropriate class based on discriminator value
parseNodeThe parse node to use to read the discriminator value and create the object