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 class
For more details about AdaptivePricing, please refer to the API Reference.static class
For more details about AfterExpiration, please refer to the API Reference.static class
For more details about AutomaticTax, please refer to the API Reference.static class
For more details about CollectedInformation, please refer to the API Reference.static class
For more details about Consent, please refer to the API Reference.static class
For more details about ConsentCollection, please refer to the API Reference.static class
For more details about CurrencyConversion, please refer to the API Reference.static class
For more details about CustomerDetails, please refer to the API Reference.static class
For more details about CustomField, please refer to the API Reference.static class
For more details about CustomText, please refer to the API Reference.static class
For more details about Discount, please refer to the API Reference.static class
For more details about InvoiceCreation, please refer to the API Reference.static class
For more details about OptionalItem, please refer to the API Reference.static class
For more details about PaymentMethodConfigurationDetails, please refer to the API Reference.static class
For more details about PaymentMethodOptions, please refer to the API Reference.static class
For more details about Permissions, please refer to the API Reference.static class
For more details about PhoneNumberCollection, please refer to the API Reference.static class
For more details about PresentmentDetails, please refer to the API Reference.static class
For more details about SavedPaymentMethodOptions, please refer to the API Reference.static class
For more details about ShippingAddressCollection, please refer to the API Reference.static class
For more details about ShippingCost, please refer to the API Reference.static class
For more details about ShippingOption, please refer to the API Reference.static class
For more details about TaxIdCollection, please refer to the API Reference.static class
For more details about TotalDetails, please refer to the API Reference.static class
For 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_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static Session
create
(SessionCreateParams params) Creates a Checkout Session object.static Session
create
(SessionCreateParams params, RequestOptions options) Creates a Checkout Session object.static Session
Creates a Checkout Session object.static Session
create
(Map<String, Object> params, RequestOptions options) Creates a Checkout Session object.boolean
expire()
A Checkout Session can be expired when it is in one of these statuses:open
expire
(RequestOptions options) A Checkout Session can be expired when it is in one of these statuses:open
expire
(SessionExpireParams params) A Checkout Session can be expired when it is in one of these statuses:open
expire
(SessionExpireParams params, RequestOptions options) A Checkout Session can be expired when it is in one of these statuses:open
A Checkout Session can be expired when it is in one of these statuses:open
expire
(Map<String, Object> params, RequestOptions options) A Checkout Session can be expired when it is in one of these statuses:open
Settings 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_collection
for 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 expandablecustomer
object.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.The timestamp at which the Checkout Session will expire.getId()
Unique identifier for the object.Get ID of expandableinvoice
object.Details on the state of invoice creation for the Checkout Session.Get expandedinvoice
.The line items purchased by the customer.Has the valuetrue
if the object exists in live mode or the valuefalse
if 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.Get ID of expandablepaymentIntent
object.Get expandedpaymentIntent
.Get ID of expandablepaymentLink
object.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: embedded
orui_mode: custom
.Controls saved payment method settings for the session.Get ID of expandablesetupIntent
object.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 expandablesubscription
object.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.int
hashCode()
static SessionCollection
list
(SessionListParams params) Returns a list of Checkout Sessions.static SessionCollection
list
(SessionListParams params, RequestOptions options) Returns a list of Checkout Sessions.static SessionCollection
Returns a list of Checkout Sessions.static SessionCollection
list
(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 Session
Retrieves a Checkout Session object.static Session
retrieve
(String session, RequestOptions options) Retrieves a Checkout Session object.static Session
retrieve
(String session, SessionRetrieveParams params, RequestOptions options) Retrieves a Checkout Session object.static Session
Retrieves a Checkout Session object.void
setAdaptivePricing
(Session.AdaptivePricing adaptivePricing) Settings for price localization with Adaptive Pricing.void
setAfterExpiration
(Session.AfterExpiration afterExpiration) When set, provides configuration for actions to take if this Checkout Session expires.void
setAllowPromotionCodes
(Boolean allowPromotionCodes) Enables user redeemable promotion codes.void
setAmountSubtotal
(Long amountSubtotal) Total of all items before discounts or taxes are applied.void
setAmountTotal
(Long amountTotal) Total of all items after discounts and taxes are applied.void
setAutomaticTax
(Session.AutomaticTax automaticTax) void
setBillingAddressCollection
(String billingAddressCollection) Describes whether Checkout should collect the customer's billing address.void
setCancelUrl
(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.void
setClientReferenceId
(String clientReferenceId) A unique string to reference the Checkout Session.void
setClientSecret
(String clientSecret) The client secret of your Checkout Session.void
setCollectedInformation
(Session.CollectedInformation collectedInformation) Information about the customer collected within the Checkout Session.void
setConsent
(Session.Consent consent) Results ofconsent_collection
for this session.void
setConsentCollection
(Session.ConsentCollection consentCollection) When set, provides configuration for the Checkout Session to gather active consent from customers.void
setCreated
(Long created) Time at which the object was created.void
setCurrency
(String currency) Three-letter ISO currency code, in lowercase.void
setCurrencyConversion
(Session.CurrencyConversion currencyConversion) Currency conversion details for Adaptive Pricing sessions created before 2025-03-31.void
setCustomer
(String id) void
setCustomerCreation
(String customerCreation) Configure whether a Checkout Session creates a Customer when the Checkout Session completes.void
setCustomerDetails
(Session.CustomerDetails customerDetails) The customer details including the customer's tax exempt status and the customer's tax IDs.void
setCustomerEmail
(String customerEmail) If provided, this value will be used when the Customer object is created.void
setCustomerObject
(Customer expandableObject) void
setCustomFields
(List<Session.CustomField> customFields) Collect additional information from your customer using custom fields.void
setCustomText
(Session.CustomText customText) void
setDiscounts
(List<Session.Discount> discounts) List of coupons and promotion codes attached to the Checkout Session.void
setExpiresAt
(Long expiresAt) The timestamp at which the Checkout Session will expire.void
Unique identifier for the object.void
setInvoice
(String id) void
setInvoiceCreation
(Session.InvoiceCreation invoiceCreation) Details on the state of invoice creation for the Checkout Session.void
setInvoiceObject
(Invoice expandableObject) void
setLineItems
(LineItemCollection lineItems) The line items purchased by the customer.void
setLivemode
(Boolean livemode) Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
The IETF language tag of the locale Checkout is displayed in.void
setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.void
The mode of the Checkout Session.void
String representing the object's type.void
setOptionalItems
(List<Session.OptionalItem> optionalItems) The optional items presented to the customer at checkout.void
void
setPaymentIntentObject
(PaymentIntent expandableObject) void
setPaymentLink
(String id) void
setPaymentLinkObject
(PaymentLink expandableObject) void
setPaymentMethodCollection
(String paymentMethodCollection) Configure whether a Checkout Session should collect a payment method.void
setPaymentMethodConfigurationDetails
(Session.PaymentMethodConfigurationDetails paymentMethodConfigurationDetails) Information about the payment method configuration used for this Checkout session if using dynamic payment methods.void
setPaymentMethodOptions
(Session.PaymentMethodOptions paymentMethodOptions) Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.void
setPaymentMethodTypes
(List<String> paymentMethodTypes) A list of the types of payment methods (e.g.void
setPaymentStatus
(String paymentStatus) The payment status of the Checkout Session, one ofpaid
,unpaid
, orno_payment_required
.void
setPermissions
(Session.Permissions permissions) This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.void
setPhoneNumberCollection
(Session.PhoneNumberCollection phoneNumberCollection) void
setPresentmentDetails
(Session.PresentmentDetails presentmentDetails) void
setRecoveredFrom
(String recoveredFrom) The ID of the original expired Checkout Session that triggered the recovery flow.void
setRedirectOnCompletion
(String redirectOnCompletion) This parameter applies toui_mode: embedded
.void
setResponseGetter
(StripeResponseGetter responseGetter) Describes whether Checkout should display Link.void
setReturnUrl
(String returnUrl) Applies to Checkout Sessions withui_mode: embedded
orui_mode: custom
.void
setSavedPaymentMethodOptions
(Session.SavedPaymentMethodOptions savedPaymentMethodOptions) Controls saved payment method settings for the session.void
setSetupIntent
(String id) void
setSetupIntentObject
(SetupIntent expandableObject) void
setShippingAddressCollection
(Session.ShippingAddressCollection shippingAddressCollection) When set, provides configuration for Checkout to collect a shipping address from a customer.void
setShippingCost
(Session.ShippingCost shippingCost) The details of the customer cost of shipping, including the customer chosen ShippingRate.void
setShippingOptions
(List<Session.ShippingOption> shippingOptions) The shipping rate options applied to this Session.void
The status of the Checkout Session, one ofopen
,complete
, orexpired
.void
setSubmitType
(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.void
void
setSubscriptionObject
(Subscription expandableObject) void
setSuccessUrl
(String successUrl) The URL the customer will be directed to after the payment or subscription creation is successful.void
setTaxIdCollection
(Session.TaxIdCollection taxIdCollection) void
setTotalDetails
(Session.TotalDetails totalDetails) Tax and discount details for the computed total amount.void
The UI mode of the Session.void
The URL to the Checkout Session.void
setWalletOptions
(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, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Session
public Session()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomer
object. -
setCustomer
-
getCustomerObject
Get expandedcustomer
. -
setCustomerObject
-
getInvoice
Get ID of expandableinvoice
object. -
setInvoice
-
getInvoiceObject
Get expandedinvoice
. -
setInvoiceObject
-
getPaymentIntent
Get ID of expandablepaymentIntent
object. -
setPaymentIntent
-
getPaymentIntentObject
Get expandedpaymentIntent
. -
setPaymentIntentObject
-
getPaymentLink
Get ID of expandablepaymentLink
object. -
setPaymentLink
-
getPaymentLinkObject
Get expandedpaymentLink
. -
setPaymentLinkObject
-
getSetupIntent
Get ID of expandablesetupIntent
object. -
setSetupIntent
-
getSetupIntentObject
Get expandedsetupIntent
. -
setSetupIntentObject
-
getSubscription
Get ID of expandablesubscription
object. -
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:open
After 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:open
After 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:open
After 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:open
After 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:open
After 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:open
After 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.- Specified by:
update
in interfaceMetadataStore<Session>
- Throws:
StripeException
-
update
Updates a Checkout Session object.- Specified by:
update
in interfaceMetadataStore<Session>
- Throws:
StripeException
-
update
Updates a Checkout Session object.- Throws:
StripeException
-
update
Updates a Checkout Session object.- Throws:
StripeException
-
setResponseGetter
Describes whether Checkout should display Link. Defaults toauto
.One of
auto
, ornever
.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance 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
. -
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. -
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: embedded
orui_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_collection
for 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
-
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 insetup
mode. -
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 thecustomer
attribute. -
getDiscounts
List of coupons and promotion codes attached to the Checkout Session. -
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 valuetrue
if the object exists in live mode or the valuefalse
if 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
. -
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. -
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: embedded
orui_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 inpayment
andsubscription
mode. -
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_type
can only be specified on Checkout Sessions inpayment
mode. If blank orauto
,pay
is 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
. -
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. -
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: embedded
orui_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_collection
for 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
-
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 insetup
mode. -
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 thecustomer
attribute. -
setDiscounts
List of coupons and promotion codes attached to the Checkout Session. -
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 valuetrue
if the object exists in live mode or the valuefalse
if 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
. -
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. -
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: embedded
orui_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 inpayment
andsubscription
mode. -
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_type
can only be specified on Checkout Sessions inpayment
mode. If blank orauto
,pay
is 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:
getMetadata
in interfaceMetadataStore<Session>
-