Class Session
- All Implemented Interfaces:
HasId,MetadataStore<Session>,StripeActiveObject,StripeObjectInterface
Once payment is successful, the Checkout Session will contain a reference to the Customer, and either the successful PaymentIntent or an active Subscription.
You can create a Checkout Session on your server and redirect to its URL to begin Checkout.
Related guide: Checkout quickstart
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about AdaptivePricing, please refer to the API Reference.static classFor more details about AfterExpiration, please refer to the API Reference.static classFor more details about AutomaticTax, please refer to the API Reference.static classFor more details about BrandingSettings, please refer to the API Reference.static classFor more details about CheckoutItem, please refer to the API Reference.static classFor more details about CollectedInformation, please refer to the API Reference.static classFor more details about Consent, please refer to the API Reference.static classFor more details about ConsentCollection, please refer to the API Reference.static classFor more details about CurrencyConversion, please refer to the API Reference.static classFor more details about CustomerDetails, please refer to the API Reference.static classFor more details about CustomField, please refer to the API Reference.static classFor more details about CustomText, please refer to the API Reference.static classFor more details about Discount, please refer to the API Reference.static classFor more details about InvoiceCreation, please refer to the API Reference.static classFor more details about NameCollection, please refer to the API Reference.static classFor more details about OptionalItem, please refer to the API Reference.static classFor more details about PaymentMethodConfigurationDetails, please refer to the API Reference.static classFor more details about PaymentMethodOptions, please refer to the API Reference.static classFor more details about Permissions, please refer to the API Reference.static classFor more details about PhoneNumberCollection, please refer to the API Reference.static classFor more details about PresentmentDetails, please refer to the API Reference.static classFor more details about SavedPaymentMethodOptions, please refer to the API Reference.static classFor more details about ShippingAddressCollection, please refer to the API Reference.static classFor more details about ShippingCost, please refer to the API Reference.static classFor more details about ShippingOption, please refer to the API Reference.static classFor more details about TaxIdCollection, please refer to the API Reference.static classFor more details about TotalDetails, please refer to the API Reference.static classFor more details about WalletOptions, please refer to the API Reference.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic Sessioncreate(SessionCreateParams params) Creates a Checkout Session object.static Sessioncreate(SessionCreateParams params, RequestOptions options) Creates a Checkout Session object.static SessionCreates a Checkout Session object.static Sessioncreate(Map<String, Object> params, RequestOptions options) Creates a Checkout Session object.booleanexpire()A Checkout Session can be expired when it is in one of these statuses:openexpire(RequestOptions options) A Checkout Session can be expired when it is in one of these statuses:openexpire(SessionExpireParams params) A Checkout Session can be expired when it is in one of these statuses:openexpire(SessionExpireParams params, RequestOptions options) A Checkout Session can be expired when it is in one of these statuses:openA Checkout Session can be expired when it is in one of these statuses:openexpire(Map<String, Object> params, RequestOptions options) A Checkout Session can be expired when it is in one of these statuses:openSettings for price localization with Adaptive Pricing.When set, provides configuration for actions to take if this Checkout Session expires.Enables user redeemable promotion codes.Total of all items before discounts or taxes are applied.Total of all items after discounts and taxes are applied.Describes whether Checkout should collect the customer's billing address.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.A unique string to reference the Checkout Session.The client secret of your Checkout Session.Information about the customer collected within the Checkout Session.Results ofconsent_collectionfor this session.When set, provides configuration for the Checkout Session to gather active consent from customers.Time at which the object was created.Three-letter ISO currency code, in lowercase.Currency conversion details for Adaptive Pricing sessions created before 2025-03-31.Get ID of expandablecustomerobject.The ID of the account for this Session.Configure whether a Checkout Session creates a Customer when the Checkout Session completes.The customer details including the customer's tax exempt status and the customer's tax IDs.If provided, this value will be used when the Customer object is created.Get expandedcustomer.Collect additional information from your customer using custom fields.List of coupons and promotion codes attached to the Checkout Session.A list of the types of payment methods (e.g.,card) that should be excluded from this Checkout Session.The timestamp at which the Checkout Session will expire.getId()Unique identifier for the object.Get ID of expandableinvoiceobject.Details on the state of invoice creation for the Checkout Session.Get expandedinvoice.The line items purchased by the customer.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.The IETF language tag of the locale Checkout is displayed in.Set of key-value pairs that you can attach to an object.getMode()The mode of the Checkout Session.String representing the object's type.The optional items presented to the customer at checkout.Where the user is coming from.Get ID of expandablepaymentIntentobject.Get expandedpaymentIntent.Get ID of expandablepaymentLinkobject.Get expandedpaymentLink.Configure whether a Checkout Session should collect a payment method.Information about the payment method configuration used for this Checkout session if using dynamic payment methods.Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.A list of the types of payment methods (e.g.The payment status of the Checkout Session, one ofpaid,unpaid, orno_payment_required.This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.The ID of the original expired Checkout Session that triggered the recovery flow.This parameter applies toui_mode: embedded.Applies to Checkout Sessions withui_mode: embeddedorui_mode: custom.Controls saved payment method settings for the session.Get ID of expandablesetupIntentobject.Get expandedsetupIntent.When set, provides configuration for Checkout to collect a shipping address from a customer.The details of the customer cost of shipping, including the customer chosen ShippingRate.The shipping rate options applied to this Session.The status of the Checkout Session, one ofopen,complete, orexpired.Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.Get ID of expandablesubscriptionobject.Get expandedsubscription.The URL the customer will be directed to after the payment or subscription creation is successful.Tax and discount details for the computed total amount.The UI mode of the Session.getUrl()The URL to the Checkout Session.Wallet-specific configuration for this Checkout Session.inthashCode()static SessionCollectionlist(SessionListParams params) Returns a list of Checkout Sessions.static SessionCollectionlist(SessionListParams params, RequestOptions options) Returns a list of Checkout Sessions.static SessionCollectionReturns a list of Checkout Sessions.static SessionCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of Checkout Sessions.When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.listLineItems(SessionListLineItemsParams params, RequestOptions options) When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.listLineItems(Map<String, Object> params) When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.listLineItems(Map<String, Object> params, RequestOptions options) When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.static SessionRetrieves a Checkout Session object.static Sessionretrieve(String session, RequestOptions options) Retrieves a Checkout Session object.static Sessionretrieve(String session, SessionRetrieveParams params, RequestOptions options) Retrieves a Checkout Session object.static SessionRetrieves a Checkout Session object.voidsetAdaptivePricing(Session.AdaptivePricing adaptivePricing) Settings for price localization with Adaptive Pricing.voidsetAfterExpiration(Session.AfterExpiration afterExpiration) When set, provides configuration for actions to take if this Checkout Session expires.voidsetAllowPromotionCodes(Boolean allowPromotionCodes) Enables user redeemable promotion codes.voidsetAmountSubtotal(Long amountSubtotal) Total of all items before discounts or taxes are applied.voidsetAmountTotal(Long amountTotal) Total of all items after discounts and taxes are applied.voidsetAutomaticTax(Session.AutomaticTax automaticTax) voidsetBillingAddressCollection(String billingAddressCollection) Describes whether Checkout should collect the customer's billing address.voidsetBrandingSettings(Session.BrandingSettings brandingSettings) voidsetCancelUrl(String cancelUrl) 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.voidsetCheckoutItems(List<Session.CheckoutItem> checkoutItems) voidsetClientReferenceId(String clientReferenceId) A unique string to reference the Checkout Session.voidsetClientSecret(String clientSecret) The client secret of your Checkout Session.voidsetCollectedInformation(Session.CollectedInformation collectedInformation) Information about the customer collected within the Checkout Session.voidsetConsent(Session.Consent consent) Results ofconsent_collectionfor this session.voidsetConsentCollection(Session.ConsentCollection consentCollection) When set, provides configuration for the Checkout Session to gather active consent from customers.voidsetCreated(Long created) Time at which the object was created.voidsetCurrency(String currency) Three-letter ISO currency code, in lowercase.voidsetCurrencyConversion(Session.CurrencyConversion currencyConversion) Currency conversion details for Adaptive Pricing sessions created before 2025-03-31.voidsetCustomer(String id) voidsetCustomerAccount(String customerAccount) The ID of the account for this Session.voidsetCustomerCreation(String customerCreation) Configure whether a Checkout Session creates a Customer when the Checkout Session completes.voidsetCustomerDetails(Session.CustomerDetails customerDetails) The customer details including the customer's tax exempt status and the customer's tax IDs.voidsetCustomerEmail(String customerEmail) If provided, this value will be used when the Customer object is created.voidsetCustomerObject(Customer expandableObject) voidsetCustomFields(List<Session.CustomField> customFields) Collect additional information from your customer using custom fields.voidsetCustomText(Session.CustomText customText) voidsetDiscounts(List<Session.Discount> discounts) List of coupons and promotion codes attached to the Checkout Session.voidsetExcludedPaymentMethodTypes(List<String> excludedPaymentMethodTypes) A list of the types of payment methods (e.g.,card) that should be excluded from this Checkout Session.voidsetExpiresAt(Long expiresAt) The timestamp at which the Checkout Session will expire.voidUnique identifier for the object.voidsetInvoice(String id) voidsetInvoiceCreation(Session.InvoiceCreation invoiceCreation) Details on the state of invoice creation for the Checkout Session.voidsetInvoiceObject(Invoice expandableObject) voidsetLineItems(LineItemCollection lineItems) The line items purchased by the customer.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidThe IETF language tag of the locale Checkout is displayed in.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidThe mode of the Checkout Session.voidsetNameCollection(Session.NameCollection nameCollection) voidString representing the object's type.voidsetOptionalItems(List<Session.OptionalItem> optionalItems) The optional items presented to the customer at checkout.voidsetOriginContext(String originContext) Where the user is coming from.voidvoidsetPaymentIntentObject(PaymentIntent expandableObject) voidsetPaymentLink(String id) voidsetPaymentLinkObject(PaymentLink expandableObject) voidsetPaymentMethodCollection(String paymentMethodCollection) Configure whether a Checkout Session should collect a payment method.voidsetPaymentMethodConfigurationDetails(Session.PaymentMethodConfigurationDetails paymentMethodConfigurationDetails) Information about the payment method configuration used for this Checkout session if using dynamic payment methods.voidsetPaymentMethodOptions(Session.PaymentMethodOptions paymentMethodOptions) Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.voidsetPaymentMethodTypes(List<String> paymentMethodTypes) A list of the types of payment methods (e.g.voidsetPaymentStatus(String paymentStatus) The payment status of the Checkout Session, one ofpaid,unpaid, orno_payment_required.voidsetPermissions(Session.Permissions permissions) This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.voidsetPhoneNumberCollection(Session.PhoneNumberCollection phoneNumberCollection) voidsetPresentmentDetails(Session.PresentmentDetails presentmentDetails) voidsetRecoveredFrom(String recoveredFrom) The ID of the original expired Checkout Session that triggered the recovery flow.voidsetRedirectOnCompletion(String redirectOnCompletion) This parameter applies toui_mode: embedded.voidsetResponseGetter(StripeResponseGetter responseGetter) Describes whether Checkout should display Link.voidsetReturnUrl(String returnUrl) Applies to Checkout Sessions withui_mode: embeddedorui_mode: custom.voidsetSavedPaymentMethodOptions(Session.SavedPaymentMethodOptions savedPaymentMethodOptions) Controls saved payment method settings for the session.voidsetSetupIntent(String id) voidsetSetupIntentObject(SetupIntent expandableObject) voidsetShippingAddressCollection(Session.ShippingAddressCollection shippingAddressCollection) When set, provides configuration for Checkout to collect a shipping address from a customer.voidsetShippingCost(Session.ShippingCost shippingCost) The details of the customer cost of shipping, including the customer chosen ShippingRate.voidsetShippingOptions(List<Session.ShippingOption> shippingOptions) The shipping rate options applied to this Session.voidThe status of the Checkout Session, one ofopen,complete, orexpired.voidsetSubmitType(String submitType) Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.voidvoidsetSubscriptionObject(Subscription expandableObject) voidsetSuccessUrl(String successUrl) The URL the customer will be directed to after the payment or subscription creation is successful.voidsetTaxIdCollection(Session.TaxIdCollection taxIdCollection) voidsetTotalDetails(Session.TotalDetails totalDetails) Tax and discount details for the computed total amount.voidThe UI mode of the Session.voidThe URL to the Checkout Session.voidsetWalletOptions(Session.WalletOptions walletOptions) Wallet-specific configuration for this Checkout Session.update(SessionUpdateParams params) Updates a Checkout Session object.update(SessionUpdateParams params, RequestOptions options) Updates a Checkout Session object.Updates a Checkout Session object.update(Map<String, Object> params, RequestOptions options) Updates a Checkout Session object.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Session
public Session()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomerobject. -
setCustomer
-
getCustomerObject
Get expandedcustomer. -
setCustomerObject
-
getInvoice
Get ID of expandableinvoiceobject. -
setInvoice
-
getInvoiceObject
Get expandedinvoice. -
setInvoiceObject
-
getPaymentIntent
Get ID of expandablepaymentIntentobject. -
setPaymentIntent
-
getPaymentIntentObject
Get expandedpaymentIntent. -
setPaymentIntentObject
-
getPaymentLink
Get ID of expandablepaymentLinkobject. -
setPaymentLink
-
getPaymentLinkObject
Get expandedpaymentLink. -
setPaymentLinkObject
-
getSetupIntent
Get ID of expandablesetupIntentobject. -
setSetupIntent
-
getSetupIntentObject
Get expandedsetupIntent. -
setSetupIntentObject
-
getSubscription
Get ID of expandablesubscriptionobject. -
setSubscription
-
getSubscriptionObject
Get expandedsubscription. -
setSubscriptionObject
-
create
Creates a Checkout Session object.- Throws:
StripeException
-
create
public static Session create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a Checkout Session object.- Throws:
StripeException
-
create
Creates a Checkout Session object.- Throws:
StripeException
-
create
public static Session create(SessionCreateParams params, RequestOptions options) throws StripeException Creates a Checkout Session object.- Throws:
StripeException
-
expire
A Checkout Session can be expired when it is in one of these statuses:openAfter it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
- Throws:
StripeException
-
expire
A Checkout Session can be expired when it is in one of these statuses:openAfter it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
- Throws:
StripeException
-
expire
A Checkout Session can be expired when it is in one of these statuses:openAfter it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
- Throws:
StripeException
-
expire
A Checkout Session can be expired when it is in one of these statuses:openAfter it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
- Throws:
StripeException
-
expire
A Checkout Session can be expired when it is in one of these statuses:openAfter it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
- Throws:
StripeException
-
expire
A Checkout Session can be expired when it is in one of these statuses:openAfter it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
- Throws:
StripeException
-
list
Returns a list of Checkout Sessions.- Throws:
StripeException
-
list
public static SessionCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of Checkout Sessions.- Throws:
StripeException
-
list
Returns a list of Checkout Sessions.- Throws:
StripeException
-
list
public static SessionCollection list(SessionListParams params, RequestOptions options) throws StripeException Returns a list of Checkout Sessions.- Throws:
StripeException
-
listLineItems
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(Map<String, Object> params, RequestOptions options) throws StripeExceptionWhen retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(SessionListLineItemsParams params, RequestOptions options) throws StripeException When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
retrieve
Retrieves a Checkout Session object.- Throws:
StripeException
-
retrieve
Retrieves a Checkout Session object.- Throws:
StripeException
-
retrieve
public static Session retrieve(String session, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves a Checkout Session object.- Throws:
StripeException
-
retrieve
public static Session retrieve(String session, SessionRetrieveParams params, RequestOptions options) throws StripeException Retrieves a Checkout Session object.- Throws:
StripeException
-
update
Updates a Checkout Session object.Related guide: Dynamically update Checkout.
- Specified by:
updatein interfaceMetadataStore<Session>- Throws:
StripeException
-
update
Updates a Checkout Session object.Related guide: Dynamically update Checkout.
- Specified by:
updatein interfaceMetadataStore<Session>- Throws:
StripeException
-
update
Updates a Checkout Session object.Related guide: Dynamically update Checkout.
- Throws:
StripeException
-
update
Updates a Checkout Session object.Related guide: Dynamically update Checkout.
- Throws:
StripeException
-
setResponseGetter
Describes whether Checkout should display Link. Defaults toauto.One of
auto, ornever.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getAdaptivePricing
Settings for price localization with Adaptive Pricing. -
getAfterExpiration
When set, provides configuration for actions to take if this Checkout Session expires. -
getAllowPromotionCodes
Enables user redeemable promotion codes. -
getAmountSubtotal
Total of all items before discounts or taxes are applied. -
getAmountTotal
Total of all items after discounts and taxes are applied. -
getAutomaticTax
-
getBillingAddressCollection
Describes whether Checkout should collect the customer's billing address. Defaults toauto.One of
auto, orrequired. -
getBrandingSettings
-
getCancelUrl
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. -
getCheckoutItems
-
getClientReferenceId
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. -
getClientSecret
The client secret of your Checkout Session. Applies to Checkout Sessions withui_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. -
getCollectedInformation
Information about the customer collected within the Checkout Session. -
getConsent
Results ofconsent_collectionfor this session. -
getConsentCollection
When set, provides configuration for the Checkout Session to gather active consent from customers. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getCurrencyConversion
Currency conversion details for Adaptive Pricing sessions created before 2025-03-31. -
getCustomFields
Collect additional information from your customer using custom fields. Up to 3 fields are supported. -
getCustomText
-
getCustomerAccount
The ID of the account for this Session. -
getCustomerCreation
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.One of
always, orif_required. -
getCustomerDetails
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 insetupmode. -
getCustomerEmail
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 thecustomerattribute. -
getDiscounts
List of coupons and promotion codes attached to the Checkout Session. -
getExcludedPaymentMethodTypes
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. -
getExpiresAt
The timestamp at which the Checkout Session will expire. -
getInvoiceCreation
Details on the state of invoice creation for the Checkout Session. -
getLineItems
The line items purchased by the customer. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getLocale
The IETF language tag of the locale Checkout is displayed in. If blank orauto, the browser's locale is used.One of
auto,bg,cs,da,de,el,en,en-GB,es,es-419,et,fi,fil,fr,fr-CA,hr,hu,id,it,ja,ko,lt,lv,ms,mt,nb,nl,pl,pt,pt-BR,ro,ru,sk,sl,sv,th,tr,vi,zh,zh-HK, orzh-TW. -
getMode
The mode of the Checkout Session.One of
payment,setup, orsubscription. -
getNameCollection
-
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
checkout.session. -
getOptionalItems
The optional items presented to the customer at checkout. -
getOriginContext
Where the user is coming from. This informs the optimizations that are applied to the session.One of
mobile_app, orweb. -
getPaymentMethodCollection
Configure whether a Checkout Session should collect a payment method. Defaults toalways.One of
always, orif_required. -
getPaymentMethodConfigurationDetails
Information about the payment method configuration used for this Checkout session if using dynamic payment methods. -
getPaymentMethodOptions
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. -
getPaymentMethodTypes
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. -
getPaymentStatus
The payment status of the Checkout Session, one ofpaid,unpaid, orno_payment_required. You can use this value to decide when to fulfill your customer's order. -
getPermissions
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. -
getPhoneNumberCollection
-
getPresentmentDetails
-
getRecoveredFrom
The ID of the original expired Checkout Session that triggered the recovery flow. -
getRedirectOnCompletion
This parameter applies toui_mode: embedded. Learn more about the redirect behavior of embedded sessions. Defaults toalways.One of
always,if_required, ornever. -
getReturnUrl
Applies to Checkout Sessions withui_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. -
getSavedPaymentMethodOptions
Controls saved payment method settings for the session. Only available inpaymentandsubscriptionmode. -
getShippingAddressCollection
When set, provides configuration for Checkout to collect a shipping address from a customer. -
getShippingCost
The details of the customer cost of shipping, including the customer chosen ShippingRate. -
getShippingOptions
The shipping rate options applied to this Session. -
getStatus
The status of the Checkout Session, one ofopen,complete, orexpired. -
getSubmitType
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.submit_typecan only be specified on Checkout Sessions inpaymentmode. If blank orauto,payis used.One of
auto,book,donate,pay, orsubscribe. -
getSuccessUrl
The URL the customer will be directed to after the payment or subscription creation is successful. -
getTaxIdCollection
-
getTotalDetails
Tax and discount details for the computed total amount. -
getUiMode
The UI mode of the Session. Defaults tohosted.One of
custom,embedded, orhosted. -
getUrl
The URL to the Checkout Session. Applies to Checkout Sessions withui_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. -
getWalletOptions
Wallet-specific configuration for this Checkout Session. -
setAdaptivePricing
Settings for price localization with Adaptive Pricing. -
setAfterExpiration
When set, provides configuration for actions to take if this Checkout Session expires. -
setAllowPromotionCodes
Enables user redeemable promotion codes. -
setAmountSubtotal
Total of all items before discounts or taxes are applied. -
setAmountTotal
Total of all items after discounts and taxes are applied. -
setAutomaticTax
-
setBillingAddressCollection
Describes whether Checkout should collect the customer's billing address. Defaults toauto.One of
auto, orrequired. -
setBrandingSettings
-
setCancelUrl
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. -
setCheckoutItems
-
setClientReferenceId
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. -
setClientSecret
The client secret of your Checkout Session. Applies to Checkout Sessions withui_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. -
setCollectedInformation
Information about the customer collected within the Checkout Session. -
setConsent
Results ofconsent_collectionfor this session. -
setConsentCollection
When set, provides configuration for the Checkout Session to gather active consent from customers. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setCurrencyConversion
Currency conversion details for Adaptive Pricing sessions created before 2025-03-31. -
setCustomFields
Collect additional information from your customer using custom fields. Up to 3 fields are supported. -
setCustomText
-
setCustomerAccount
The ID of the account for this Session. -
setCustomerCreation
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.One of
always, orif_required. -
setCustomerDetails
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 insetupmode. -
setCustomerEmail
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 thecustomerattribute. -
setDiscounts
List of coupons and promotion codes attached to the Checkout Session. -
setExcludedPaymentMethodTypes
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. -
setExpiresAt
The timestamp at which the Checkout Session will expire. -
setId
Unique identifier for the object. -
setInvoiceCreation
Details on the state of invoice creation for the Checkout Session. -
setLineItems
The line items purchased by the customer. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setLocale
The IETF language tag of the locale Checkout is displayed in. If blank orauto, the browser's locale is used.One of
auto,bg,cs,da,de,el,en,en-GB,es,es-419,et,fi,fil,fr,fr-CA,hr,hu,id,it,ja,ko,lt,lv,ms,mt,nb,nl,pl,pt,pt-BR,ro,ru,sk,sl,sv,th,tr,vi,zh,zh-HK, orzh-TW. -
setMetadata
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. -
setMode
The mode of the Checkout Session.One of
payment,setup, orsubscription. -
setNameCollection
-
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
checkout.session. -
setOptionalItems
The optional items presented to the customer at checkout. -
setOriginContext
Where the user is coming from. This informs the optimizations that are applied to the session.One of
mobile_app, orweb. -
setPaymentMethodCollection
Configure whether a Checkout Session should collect a payment method. Defaults toalways.One of
always, orif_required. -
setPaymentMethodConfigurationDetails
public void setPaymentMethodConfigurationDetails(Session.PaymentMethodConfigurationDetails paymentMethodConfigurationDetails) Information about the payment method configuration used for this Checkout session if using dynamic payment methods. -
setPaymentMethodOptions
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. -
setPaymentMethodTypes
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. -
setPaymentStatus
The payment status of the Checkout Session, one ofpaid,unpaid, orno_payment_required. You can use this value to decide when to fulfill your customer's order. -
setPermissions
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. -
setPhoneNumberCollection
-
setPresentmentDetails
-
setRecoveredFrom
The ID of the original expired Checkout Session that triggered the recovery flow. -
setRedirectOnCompletion
This parameter applies toui_mode: embedded. Learn more about the redirect behavior of embedded sessions. Defaults toalways.One of
always,if_required, ornever. -
setReturnUrl
Applies to Checkout Sessions withui_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. -
setSavedPaymentMethodOptions
public void setSavedPaymentMethodOptions(Session.SavedPaymentMethodOptions savedPaymentMethodOptions) Controls saved payment method settings for the session. Only available inpaymentandsubscriptionmode. -
setShippingAddressCollection
public void setShippingAddressCollection(Session.ShippingAddressCollection shippingAddressCollection) When set, provides configuration for Checkout to collect a shipping address from a customer. -
setShippingCost
The details of the customer cost of shipping, including the customer chosen ShippingRate. -
setShippingOptions
The shipping rate options applied to this Session. -
setStatus
The status of the Checkout Session, one ofopen,complete, orexpired. -
setSubmitType
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.submit_typecan only be specified on Checkout Sessions inpaymentmode. If blank orauto,payis used.One of
auto,book,donate,pay, orsubscribe. -
setSuccessUrl
The URL the customer will be directed to after the payment or subscription creation is successful. -
setTaxIdCollection
-
setTotalDetails
Tax and discount details for the computed total amount. -
setUiMode
The UI mode of the Session. Defaults tohosted.One of
custom,embedded, orhosted. -
setUrl
The URL to the Checkout Session. Applies to Checkout Sessions withui_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. -
setWalletOptions
Wallet-specific configuration for this Checkout Session. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
getMetadata
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.- Specified by:
getMetadatain interfaceMetadataStore<Session>
-