View Source Stripe.Checkout.Session (stripity_stripe v3.3.1)
A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout or Payment Links. We recommend creating a new Session each time your customer attempts to pay.
Once payment is successful, the Checkout Session will contain a reference to the Customer, 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
Summary
Types
contains details about the ACSS Debit payment method options.
Settings for price localization with Adaptive Pricing.
Shipping address.
When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order.
contains details about the Affirm payment method options.
Configure actions after a Checkout Session has expired.
contains details about the Afterpay Clearpay payment method options.
contains details about the Alipay payment method options.
contains details about the Alma payment method options.
contains details about the AmazonPay payment method options.
contains details about the AU Becs Debit payment method options.
Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions.
contains details about the Bacs Debit payment method options.
contains details about the Bancontact payment method options.
Configuration for the bank transfer funding type, if the funding_type is set to bank_transfer.
contains details about the Billie payment method options.
Controls how prorations and invoices for subscriptions are calculated and orchestrated.
contains details about the Boleto payment method options.
The branding settings for the Checkout Session. This parameter is not allowed if ui_mode is custom.
Controls settings applied for collecting the customer's business name on the session.
contains details about the Card payment method options.
contains details about the Cashapp Pay payment method options.
Information about the customer collected within the Checkout Session. Can only be set when updating embedded or custom sessions.
Configure fields for the Checkout Session to gather active consent from customers.
Display additional text for your customers using custom text.
contains details about the Customer Balance payment method options.
Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when customer is provided.
The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
contains details about the DemoPay payment method options.
Configuration for type=dropdown fields.
Defines how the subscription should behave when the user's free trial ends.
contains details about the EPS payment method options.
Configuration for eu_bank_transfer funding type.
Additional fields for Financial Connections Session creation
Describes a fixed amount to charge for shipping. Must be present if type is fixed_amount.
Configure behavior for flexible billing mode.
contains details about the FPX payment method options.
contains details about the Giropay payment method options.
contains details about the Grabpay payment method options.
The icon for the Checkout Session. For best results, use a square image.
contains details about the Ideal payment method options.
Controls settings applied for collecting the customer's individual name on the session.
Installment options for card payments
Generate a post-purchase Invoice for one-time payments.
Parameters passed when creating invoices for payment-mode Checkout Sessions.
All invoices will be billed using the specified settings.
The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
contains details about the Kakao Pay payment method options.
contains details about the Klarna payment method options.
contains details about the Konbini payment method options.
contains details about the Korean card payment method options.
The label for the field, displayed to the customer.
The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
contains details about the Link payment method options.
The logo for the Checkout Session.
Additional fields for Mandate creation
The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
The lower bound of the estimated range. If empty, represents no lower bound.
contains details about the Mobilepay payment method options.
contains details about the Multibanco payment method options.
Controls name collection settings for the session.
contains details about the Naver Pay payment method options.
Describes the upcoming charge for this subscription.
Configuration for type=numeric fields.
contains details about the OXXO payment method options.
contains details about the P24 payment method options.
contains details about the PAYCO payment method options.
A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in payment mode.
This parameter allows you to set some attributes on the payment method created during a Checkout session.
Payment-method-specific configuration.
Determines the display of payment method reuse agreement text in the UI. If set to hidden, it will hide legal text related to the reuse of a payment method.
contains details about the PayNow payment method options.
contains details about the PayPal payment method options.
This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. Can only be set when creating embedded or custom sessions.
Controls phone number collection settings for the session.
contains details about the Pix payment method options.
Data used to generate a new Price object inline. One of price or price_data is required.
Data used to generate a new Product object inline. One of product or product_data is required.
Configure a Checkout Session that can be used to recover an expired session.
The recurring components of a price such as interval and interval_count.
Restrictions to apply to the card payment method. For example, you can block specific card brands.
contains details about the RevolutPay payment method options.
contains details about the Samsung Pay payment method options.
contains details about the Satispay payment method options.
Controls saved payment method settings for the session. Only available in payment and subscription mode.
contains details about the Sepa Debit payment method options.
A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in setup mode.
Shipping information for this payment.
When set, provides configuration for Checkout to collect a shipping address from a customer.
The shipping details to apply to this Session.
Parameters to be passed to Shipping Rate creation for this shipping option.
contains details about the Sofort payment method options.
A subset of parameters to be passed to subscription creation for Checkout Sessions in subscription mode.
contains details about the Swish payment method options.
The checkout.session type.
Controls tax ID collection during checkout.
Configuration for type=text fields.
If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
Settings related to subscription trials.
contains details about the TWINT payment method options.
contains details about the Us Bank Account payment method options.
Wallet-specific configuration.
contains details about the WeChat Pay payment method options.
Functions
Creates a Checkout Session object.
A Checkout Session can be expired when it is in one of these statuses: open
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. There is also a URL where you can retrieve the full (paginated) list of line items.
Retrieves a Checkout Session object.
Updates a Checkout Session object.
Types
@type acss_debit() :: %{ optional(:currency) => :cad | :usd, optional(:mandate_options) => mandate_options(), optional(:setup_future_usage) => :none | :off_session | :on_session, optional(:target_date) => binary(), optional(:verification_method) => :automatic | :instant | :microdeposits }
contains details about the ACSS Debit payment method options.
@type adaptive_pricing() :: %{optional(:enabled) => boolean()}
Settings for price localization with Adaptive Pricing.
@type address() :: %{ optional(:city) => binary(), optional(:country) => binary(), optional(:line1) => binary(), optional(:line2) => binary(), optional(:postal_code) => binary(), optional(:state) => binary() }
Shipping address.
@type adjustable_quantity() :: %{ optional(:enabled) => boolean(), optional(:maximum) => integer(), optional(:minimum) => integer() }
When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order.
@type affirm() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none
}
contains details about the Affirm payment method options.
@type after_expiration() :: %{optional(:recovery) => recovery()}
Configure actions after a Checkout Session has expired.
@type after_submit() :: %{optional(:message) => binary()}
@type afterpay_clearpay() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none
}
contains details about the Afterpay Clearpay payment method options.
@type alipay() :: %{optional(:setup_future_usage) => :none}
contains details about the Alipay payment method options.
@type alma() :: %{optional(:capture_method) => :manual}
contains details about the Alma payment method options.
@type amazon_pay() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none | :off_session
}
contains details about the AmazonPay payment method options.
@type au_becs_debit() :: %{ optional(:setup_future_usage) => :none, optional(:target_date) => binary() }
contains details about the AU Becs Debit payment method options.
Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions.
@type bacs_debit() :: %{ optional(:mandate_options) => mandate_options(), optional(:setup_future_usage) => :none | :off_session | :on_session, optional(:target_date) => binary() }
contains details about the Bacs Debit payment method options.
@type bancontact() :: %{optional(:setup_future_usage) => :none}
contains details about the Bancontact payment method options.
@type bank_transfer() :: %{ optional(:eu_bank_transfer) => eu_bank_transfer(), optional(:requested_address_types) => [ :aba | :iban | :sepa | :sort_code | :spei | :swift | :zengin ], optional(:type) => :eu_bank_transfer | :gb_bank_transfer | :jp_bank_transfer | :mx_bank_transfer | :us_bank_transfer }
Configuration for the bank transfer funding type, if the funding_type is set to bank_transfer.
@type billie() :: %{optional(:capture_method) => :manual}
contains details about the Billie payment method options.
@type billing_mode() :: %{ optional(:flexible) => flexible(), optional(:type) => :classic | :flexible }
Controls how prorations and invoices for subscriptions are calculated and orchestrated.
@type boleto() :: %{ optional(:expires_after_days) => integer(), optional(:setup_future_usage) => :none | :off_session | :on_session }
contains details about the Boleto payment method options.
@type branding_settings() :: %{ optional(:background_color) => binary() | binary(), optional(:border_style) => :pill | :rectangular | :rounded, optional(:button_color) => binary() | binary(), optional(:display_name) => binary(), optional(:font_family) => :be_vietnam_pro | :bitter | :chakra_petch | :default | :hahmlet | :inconsolata | :inter | :lato | :lora | :m_plus_1_code | :montserrat | :noto_sans | :noto_sans_jp | :noto_serif | :nunito | :open_sans | :pridi | :pt_sans | :pt_serif | :raleway | :roboto | :roboto_slab | :source_sans_pro | :titillium_web | :ubuntu_mono | :zen_maru_gothic, optional(:icon) => icon(), optional(:logo) => logo() }
The branding settings for the Checkout Session. This parameter is not allowed if ui_mode is custom.
Controls settings applied for collecting the customer's business name on the session.
@type card() :: %{ optional(:capture_method) => :manual, optional(:installments) => installments(), optional(:request_extended_authorization) => :if_available | :never, optional(:request_incremental_authorization) => :if_available | :never, optional(:request_multicapture) => :if_available | :never, optional(:request_overcapture) => :if_available | :never, optional(:request_three_d_secure) => :any | :automatic | :challenge, optional(:restrictions) => restrictions(), optional(:setup_future_usage) => :off_session | :on_session, optional(:statement_descriptor_suffix_kana) => binary(), optional(:statement_descriptor_suffix_kanji) => binary() }
contains details about the Card payment method options.
@type cashapp() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none | :off_session | :on_session
}
contains details about the Cashapp Pay payment method options.
@type collected_information() :: %{optional(:shipping_details) => shipping_details()}
Information about the customer collected within the Checkout Session. Can only be set when updating embedded or custom sessions.
@type consent_collection() :: %{ optional(:payment_method_reuse_agreement) => payment_method_reuse_agreement(), optional(:promotions) => :auto | :none, optional(:terms_of_service) => :none | :required }
Configure fields for the Checkout Session to gather active consent from customers.
@type custom_text() :: %{ optional(:after_submit) => after_submit() | binary(), optional(:shipping_address) => shipping_address() | binary(), optional(:submit) => submit() | binary(), optional(:terms_of_service_acceptance) => terms_of_service_acceptance() | binary() }
Display additional text for your customers using custom text.
@type customer_balance() :: %{ optional(:bank_transfer) => bank_transfer(), optional(:funding_type) => :bank_transfer, optional(:setup_future_usage) => :none }
contains details about the Customer Balance payment method options.
@type customer_details() :: %{optional(:email) => binary()}
@type customer_update() :: %{
optional(:address) => :auto | :never,
optional(:name) => :auto | :never,
optional(:shipping) => :auto | :never
}
Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when customer is provided.
The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
@type demo_pay() :: %{optional(:setup_future_usage) => :none | :off_session}
contains details about the DemoPay payment method options.
Configuration for type=dropdown fields.
@type end_behavior() :: %{
optional(:missing_payment_method) => :cancel | :create_invoice | :pause
}
Defines how the subscription should behave when the user's free trial ends.
@type eps() :: %{optional(:setup_future_usage) => :none}
contains details about the EPS payment method options.
@type eu_bank_transfer() :: %{optional(:country) => binary()}
Configuration for eu_bank_transfer funding type.
@type financial_connections() :: %{
optional(:permissions) => [
:balances | :ownership | :payment_method | :transactions
],
optional(:prefetch) => [:balances | :ownership | :transactions]
}
Additional fields for Financial Connections Session creation
@type fixed_amount() :: %{ optional(:amount) => integer(), optional(:currency) => binary(), optional(:currency_options) => map() }
Describes a fixed amount to charge for shipping. Must be present if type is fixed_amount.
@type flexible() :: %{optional(:proration_discounts) => :included | :itemized}
Configure behavior for flexible billing mode.
@type fpx() :: %{optional(:setup_future_usage) => :none}
contains details about the FPX payment method options.
@type giropay() :: %{optional(:setup_future_usage) => :none}
contains details about the Giropay payment method options.
@type grabpay() :: %{optional(:setup_future_usage) => :none}
contains details about the Grabpay payment method options.
@type icon() :: %{ optional(:file) => binary(), optional(:type) => :file | :url, optional(:url) => binary() }
The icon for the Checkout Session. For best results, use a square image.
@type ideal() :: %{optional(:setup_future_usage) => :none}
contains details about the Ideal payment method options.
Controls settings applied for collecting the customer's individual name on the session.
@type installments() :: %{optional(:enabled) => boolean()}
Installment options for card payments
@type invoice_creation() :: %{ optional(:enabled) => boolean(), optional(:invoice_data) => invoice_data() }
Generate a post-purchase Invoice for one-time payments.
@type invoice_data() :: %{ optional(:account_tax_ids) => [binary()] | binary(), optional(:custom_fields) => [custom_fields()] | binary(), optional(:description) => binary(), optional(:footer) => binary(), optional(:issuer) => issuer(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:rendering_options) => rendering_options() | binary() }
Parameters passed when creating invoices for payment-mode Checkout Sessions.
@type invoice_settings() :: %{optional(:issuer) => issuer()}
All invoices will be billed using the specified settings.
@type issuer() :: %{ optional(:account) => binary(), optional(:type) => :account | :self }
The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
@type kakao_pay() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none | :off_session
}
contains details about the Kakao Pay payment method options.
@type klarna() :: %{ optional(:capture_method) => :manual, optional(:setup_future_usage) => :none, optional(:subscriptions) => [subscriptions()] | binary() }
contains details about the Klarna payment method options.
@type konbini() :: %{ optional(:expires_after_days) => integer(), optional(:setup_future_usage) => :none }
contains details about the Konbini payment method options.
@type kr_card() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none | :off_session
}
contains details about the Korean card payment method options.
@type label() :: %{optional(:custom) => binary(), optional(:type) => :custom}
The label for the field, displayed to the customer.
@type liability() :: %{ optional(:account) => binary(), optional(:type) => :account | :self }
The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
@type line_items() :: %{ optional(:adjustable_quantity) => adjustable_quantity(), optional(:dynamic_tax_rates) => [binary()], optional(:price) => binary(), optional(:price_data) => price_data(), optional(:quantity) => integer(), optional(:tax_rates) => [binary()] }
@type link() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none | :off_session
}
contains details about the Link payment method options.
@type logo() :: %{ optional(:file) => binary(), optional(:type) => :file | :url, optional(:url) => binary() }
The logo for the Checkout Session.
@type mandate_options() :: %{ optional(:custom_mandate_url) => binary() | binary(), optional(:default_for) => [:invoice | :subscription], optional(:interval_description) => binary(), optional(:payment_schedule) => :combined | :interval | :sporadic, optional(:transaction_type) => :business | :personal }
Additional fields for Mandate creation
@type maximum() :: %{ optional(:unit) => :business_day | :day | :hour | :month | :week, optional(:value) => integer() }
The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
@type minimum() :: %{ optional(:unit) => :business_day | :day | :hour | :month | :week, optional(:value) => integer() }
The lower bound of the estimated range. If empty, represents no lower bound.
@type mobilepay() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none
}
contains details about the Mobilepay payment method options.
@type multibanco() :: %{optional(:setup_future_usage) => :none}
contains details about the Multibanco payment method options.
@type name_collection() :: %{ optional(:business) => business(), optional(:individual) => individual() }
Controls name collection settings for the session.
You can configure Checkout to collect your customers' business names, individual names, or both. Each name field can be either required or optional.
If a Customer is created or provided, the names can be saved to the Customer object as well.
Describes the upcoming charge for this subscription.
@type numeric() :: %{ optional(:default_value) => binary(), optional(:maximum_length) => integer(), optional(:minimum_length) => integer() }
Configuration for type=numeric fields.
@type optional_items() :: %{ optional(:adjustable_quantity) => adjustable_quantity(), optional(:price) => binary(), optional(:quantity) => integer() }
@type oxxo() :: %{ optional(:expires_after_days) => integer(), optional(:setup_future_usage) => :none }
contains details about the OXXO payment method options.
@type p24() :: %{ optional(:setup_future_usage) => :none, optional(:tos_shown_and_accepted) => boolean() }
contains details about the P24 payment method options.
@type payco() :: %{optional(:capture_method) => :manual}
contains details about the PAYCO payment method options.
@type payment_intent_data() :: %{ optional(:application_fee_amount) => integer(), optional(:capture_method) => :automatic | :automatic_async | :manual, optional(:description) => binary(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:on_behalf_of) => binary(), optional(:receipt_email) => binary(), optional(:setup_future_usage) => :off_session | :on_session, optional(:shipping) => shipping(), optional(:statement_descriptor) => binary(), optional(:statement_descriptor_suffix) => binary(), optional(:transfer_data) => transfer_data(), optional(:transfer_group) => binary() }
A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in payment mode.
@type payment_method_data() :: %{
optional(:allow_redisplay) => :always | :limited | :unspecified
}
This parameter allows you to set some attributes on the payment method created during a Checkout session.
@type payment_method_options() :: %{ optional(:sofort) => sofort(), optional(:customer_balance) => customer_balance(), optional(:satispay) => satispay(), optional(:boleto) => boleto(), optional(:alipay) => alipay(), optional(:au_becs_debit) => au_becs_debit(), optional(:amazon_pay) => amazon_pay(), optional(:bancontact) => bancontact(), optional(:bacs_debit) => bacs_debit(), optional(:affirm) => affirm(), optional(:mobilepay) => mobilepay(), optional(:pay_by_bank) => map(), optional(:grabpay) => grabpay(), optional(:eps) => eps(), optional(:billie) => billie(), optional(:ideal) => ideal(), optional(:pix) => pix(), optional(:giropay) => giropay(), optional(:multibanco) => multibanco(), optional(:revolut_pay) => revolut_pay(), optional(:klarna) => klarna(), optional(:card) => card(), optional(:twint) => twint(), optional(:naver_pay) => naver_pay(), optional(:acss_debit) => acss_debit(), optional(:link) => link(), optional(:kr_card) => kr_card(), optional(:konbini) => konbini(), optional(:p24) => p24(), optional(:paypal) => paypal(), optional(:fpx) => fpx(), optional(:oxxo) => oxxo(), optional(:paynow) => paynow(), optional(:alma) => alma(), optional(:wechat_pay) => wechat_pay(), optional(:demo_pay) => demo_pay(), optional(:samsung_pay) => samsung_pay(), optional(:kakao_pay) => kakao_pay(), optional(:cashapp) => cashapp(), optional(:sepa_debit) => sepa_debit(), optional(:afterpay_clearpay) => afterpay_clearpay(), optional(:payco) => payco(), optional(:us_bank_account) => us_bank_account(), optional(:swish) => swish() }
Payment-method-specific configuration.
@type payment_method_reuse_agreement() :: %{optional(:position) => :auto | :hidden}
Determines the display of payment method reuse agreement text in the UI. If set to hidden, it will hide legal text related to the reuse of a payment method.
@type paynow() :: %{optional(:setup_future_usage) => :none}
contains details about the PayNow payment method options.
@type paypal() :: %{ optional(:capture_method) => :manual, optional(:preferred_locale) => :"cs-CZ" | :"da-DK" | :"de-AT" | :"de-DE" | :"de-LU" | :"el-GR" | :"en-GB" | :"en-US" | :"es-ES" | :"fi-FI" | :"fr-BE" | :"fr-FR" | :"fr-LU" | :"hu-HU" | :"it-IT" | :"nl-BE" | :"nl-NL" | :"pl-PL" | :"pt-PT" | :"sk-SK" | :"sv-SE", optional(:reference) => binary(), optional(:risk_correlation_id) => binary(), optional(:setup_future_usage) => :none | :off_session }
contains details about the PayPal payment method options.
@type permissions() :: %{
optional(:update_shipping_details) => :client_only | :server_only
}
This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. Can only be set when creating embedded or custom sessions.
For specific permissions, please refer to their dedicated subsections, such as permissions.update_shipping_details.
@type phone_number_collection() :: %{optional(:enabled) => boolean()}
Controls phone number collection settings for the session.
We recommend that you review your privacy policy and check with your legal contacts before using this feature. Learn more about collecting phone numbers with Checkout.
@type pix() :: %{ optional(:amount_includes_iof) => :always | :never, optional(:expires_after_seconds) => integer(), optional(:setup_future_usage) => :none }
contains details about the Pix payment method options.
@type price_data() :: %{ optional(:currency) => binary(), optional(:product) => binary(), optional(:product_data) => product_data(), optional(:recurring) => recurring(), optional(:tax_behavior) => :exclusive | :inclusive | :unspecified, optional(:unit_amount) => integer(), optional(:unit_amount_decimal) => binary() }
Data used to generate a new Price object inline. One of price or price_data is required.
@type product_data() :: %{ optional(:description) => binary(), optional(:images) => [binary()], optional(:metadata) => %{optional(binary()) => binary()}, optional(:name) => binary(), optional(:tax_code) => binary(), optional(:unit_label) => binary() }
Data used to generate a new Product object inline. One of product or product_data is required.
@type recovery() :: %{ optional(:allow_promotion_codes) => boolean(), optional(:enabled) => boolean() }
Configure a Checkout Session that can be used to recover an expired session.
@type recurring() :: %{ optional(:interval) => :day | :month | :week | :year, optional(:interval_count) => integer() }
The recurring components of a price such as interval and interval_count.
@type rendering_options() :: %{ optional(:amount_tax_display) => :exclude_tax | :include_inclusive_tax, optional(:template) => binary() }
@type restrictions() :: %{
optional(:brands_blocked) => [
:american_express | :discover_global_network | :mastercard | :visa
]
}
Restrictions to apply to the card payment method. For example, you can block specific card brands.
@type revolut_pay() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none | :off_session
}
contains details about the RevolutPay payment method options.
@type samsung_pay() :: %{optional(:capture_method) => :manual}
contains details about the Samsung Pay payment method options.
@type satispay() :: %{optional(:capture_method) => :manual}
contains details about the Satispay payment method options.
@type saved_payment_method_options() :: %{
optional(:allow_redisplay_filters) => [:always | :limited | :unspecified],
optional(:payment_method_remove) => :disabled | :enabled,
optional(:payment_method_save) => :disabled | :enabled
}
Controls saved payment method settings for the session. Only available in payment and subscription mode.
@type sepa_debit() :: %{ optional(:mandate_options) => mandate_options(), optional(:setup_future_usage) => :none | :off_session | :on_session, optional(:target_date) => binary() }
contains details about the Sepa Debit payment method options.
@type setup_intent_data() :: %{ optional(:description) => binary(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:on_behalf_of) => binary() }
A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in setup mode.
@type shipping() :: %{ optional(:address) => address(), optional(:carrier) => binary(), optional(:name) => binary(), optional(:phone) => binary(), optional(:tracking_number) => binary() }
Shipping information for this payment.
@type shipping_address() :: %{optional(:message) => binary()}
@type shipping_address_collection() :: %{
optional(:allowed_countries) => [
:AC
| :AD
| :AE
| :AF
| :AG
| :AI
| :AL
| :AM
| :AO
| :AQ
| :AR
| :AT
| :AU
| :AW
| :AX
| :AZ
| :BA
| :BB
| :BD
| :BE
| :BF
| :BG
| :BH
| :BI
| :BJ
| :BL
| :BM
| :BN
| :BO
| :BQ
| :BR
| :BS
| :BT
| :BV
| :BW
| :BY
| :BZ
| :CA
| :CD
| :CF
| :CG
| :CH
| :CI
| :CK
| :CL
| :CM
| :CN
| :CO
| :CR
| :CV
| :CW
| :CY
| :CZ
| :DE
| :DJ
| :DK
| :DM
| :DO
| :DZ
| :EC
| :EE
| :EG
| :EH
| :ER
| :ES
| :ET
| :FI
| :FJ
| :FK
| :FO
| :FR
| :GA
| :GB
| :GD
| :GE
| :GF
| :GG
| :GH
| :GI
| :GL
| :GM
| :GN
| :GP
| :GQ
| :GR
| :GS
| :GT
| :GU
| :GW
| :GY
| :HK
| :HN
| :HR
| :HT
| :HU
| :ID
| :IE
| :IL
| :IM
| :IN
| :IO
| :IQ
| :IS
| :IT
| :JE
| :JM
| :JO
| :JP
| :KE
| :KG
| :KH
| :KI
| :KM
| :KN
| :KR
| :KW
| :KY
| :KZ
| :LA
| :LB
| :LC
| :LI
| :LK
| :LR
| :LS
| :LT
| :LU
| :LV
| :LY
| :MA
| :MC
| :MD
| :ME
| :MF
| :MG
| :MK
| :ML
| :MM
| :MN
| :MO
| :MQ
| :MR
| :MS
| :MT
| :MU
| :MV
| :MW
| :MX
| :MY
| :MZ
| :NA
| :NC
| :NE
| :NG
| :NI
| :NL
| :NO
| :NP
| :NR
| :NU
| :NZ
| :OM
| :PA
| :PE
| :PF
| :PG
| :PH
| :PK
| :PL
| :PM
| :PN
| :PR
| :PS
| :PT
| :PY
| :QA
| :RE
| :RO
| :RS
| :RU
| :RW
| :SA
| :SB
| :SC
| :SD
| :SE
| :SG
| :SH
| :SI
| :SJ
| :SK
| :SL
| :SM
| :SN
| :SO
| :SR
| :SS
| :ST
| :SV
| :SX
| :SZ
| :TA
| :TC
| :TD
| :TF
| :TG
| :TH
| :TJ
| :TK
| :TL
| :TM
| :TN
| :TO
| :TR
| :TT
| :TV
| :TW
| :TZ
| :UA
| :UG
| :US
| :UY
| :UZ
| :VA
| :VC
| :VE
| :VG
| :VN
| :VU
| :WF
| :WS
| :XK
| :YE
| :YT
| :ZA
| :ZM
| :ZW
| :ZZ
]
}
When set, provides configuration for Checkout to collect a shipping address from a customer.
The shipping details to apply to this Session.
@type shipping_options() :: %{ optional(:shipping_rate) => binary(), optional(:shipping_rate_data) => shipping_rate_data() }
@type shipping_rate_data() :: %{ optional(:delivery_estimate) => delivery_estimate(), optional(:display_name) => binary(), optional(:fixed_amount) => fixed_amount(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:tax_behavior) => :exclusive | :inclusive | :unspecified, optional(:tax_code) => binary(), optional(:type) => :fixed_amount }
Parameters to be passed to Shipping Rate creation for this shipping option.
@type sofort() :: %{optional(:setup_future_usage) => :none}
contains details about the Sofort payment method options.
@type submit() :: %{optional(:message) => binary()}
@type subscription_data() :: %{ optional(:application_fee_percent) => number(), optional(:billing_cycle_anchor) => integer(), optional(:billing_mode) => billing_mode(), optional(:default_tax_rates) => [binary()], optional(:description) => binary(), optional(:invoice_settings) => invoice_settings(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:on_behalf_of) => binary(), optional(:proration_behavior) => :create_prorations | :none, optional(:transfer_data) => transfer_data(), optional(:trial_end) => integer(), optional(:trial_period_days) => integer(), optional(:trial_settings) => trial_settings() }
A subset of parameters to be passed to subscription creation for Checkout Sessions in subscription mode.
@type subscriptions() :: %{ optional(:interval) => :day | :month | :week | :year, optional(:interval_count) => integer(), optional(:name) => binary(), optional(:next_billing) => next_billing(), optional(:reference) => binary() }
@type swish() :: %{optional(:reference) => binary()}
contains details about the Swish payment method options.
@type t() :: %Stripe.Checkout.Session{ adaptive_pricing: term() | nil, after_expiration: term() | nil, allow_promotion_codes: boolean() | nil, amount_subtotal: integer() | nil, amount_total: integer() | nil, automatic_tax: term(), billing_address_collection: binary() | nil, branding_settings: term(), cancel_url: binary() | nil, client_reference_id: binary() | nil, client_secret: binary() | nil, collected_information: term() | nil, consent: term() | nil, consent_collection: term() | nil, created: integer(), currency: binary() | nil, currency_conversion: term() | nil, custom_fields: term(), custom_text: term(), customer: (binary() | Stripe.Customer.t() | Stripe.DeletedCustomer.t()) | nil, customer_creation: binary() | nil, customer_details: term() | nil, customer_email: binary() | nil, discounts: term() | nil, excluded_payment_method_types: term(), expires_at: integer(), id: binary(), invoice: (binary() | Stripe.Invoice.t()) | nil, invoice_creation: term() | nil, line_items: term(), livemode: boolean(), locale: binary() | nil, metadata: term() | nil, mode: binary(), name_collection: term(), object: binary(), optional_items: term() | nil, origin_context: binary() | nil, payment_intent: (binary() | Stripe.PaymentIntent.t()) | nil, payment_link: (binary() | Stripe.PaymentLink.t()) | nil, payment_method_collection: binary() | nil, payment_method_configuration_details: term() | nil, payment_method_options: term() | nil, payment_method_types: term(), payment_status: binary(), permissions: term() | nil, phone_number_collection: term(), presentment_details: term(), recovered_from: binary() | nil, redirect_on_completion: binary(), return_url: binary(), saved_payment_method_options: term() | nil, setup_intent: (binary() | Stripe.SetupIntent.t()) | nil, shipping_address_collection: term() | nil, shipping_cost: term() | nil, shipping_options: term(), status: binary() | nil, submit_type: binary() | nil, subscription: (binary() | Stripe.Subscription.t()) | nil, success_url: binary() | nil, tax_id_collection: term(), total_details: term() | nil, ui_mode: binary() | nil, url: binary() | nil, wallet_options: term() | nil }
The checkout.session type.
adaptive_pricingSettings for price localization with Adaptive Pricing.after_expirationWhen set, provides configuration for actions to take if this Checkout Session expires.allow_promotion_codesEnables user redeemable promotion codes.amount_subtotalTotal of all items before discounts or taxes are applied.amount_totalTotal of all items after discounts and taxes are applied.automatic_taxbilling_address_collectionDescribes whether Checkout should collect the customer's billing address. Defaults toauto.branding_settingscancel_urlIf 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_idA 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_secretThe 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.collected_informationInformation about the customer collected within the Checkout Session.consentResults ofconsent_collectionfor this session.consent_collectionWhen set, provides configuration for the Checkout Session to gather active consent from customers.createdTime at which the object was created. Measured in seconds since the Unix epoch.currencyThree-letter ISO currency code, in lowercase. Must be a supported currency.currency_conversionCurrency conversion details for Adaptive Pricing sessions created before 2025-03-31.custom_fieldsCollect additional information from your customer using custom fields. Up to 3 fields are supported.custom_textcustomerThe ID of the customer for this Session. For Checkout Sessions insubscriptionmode or Checkout Sessions withcustomer_creationset asalwaysinpaymentmode, 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_creationConfigure whether a Checkout Session creates a Customer when the Checkout Session completes.customer_detailsThe 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.customer_emailIf 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.discountsList of coupons and promotion codes attached to the Checkout Session.excluded_payment_method_typesA 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.expires_atThe timestamp at which the Checkout Session will expire.idUnique identifier for the object.invoiceID of the invoice created by the Checkout Session, if it exists.invoice_creationDetails on the state of invoice creation for the Checkout Session.line_itemsThe line items purchased by the customer.livemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.localeThe IETF language tag of the locale Checkout is displayed in. If blank orauto, the browser's locale is used.metadataSet 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.modeThe mode of the Checkout Session.name_collectionobjectString representing the object's type. Objects of the same type share the same value.optional_itemsThe optional items presented to the customer at checkout.origin_contextWhere the user is coming from. This informs the optimizations that are applied to the session.payment_intentThe ID of the PaymentIntent for Checkout Sessions inpaymentmode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, expire the Checkout Session instead.payment_linkThe ID of the Payment Link that created this Session.payment_method_collectionConfigure whether a Checkout Session should collect a payment method. Defaults toalways.payment_method_configuration_detailsInformation about the payment method configuration used for this Checkout session if using dynamic payment methods.payment_method_optionsPayment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.payment_method_typesA list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.payment_statusThe 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.permissionsThis 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_collectionpresentment_detailsrecovered_fromThe ID of the original expired Checkout Session that triggered the recovery flow.redirect_on_completionThis parameter applies toui_mode: embedded. Learn more about the redirect behavior of embedded sessions. Defaults toalways.return_urlApplies 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.saved_payment_method_optionsControls saved payment method settings for the session. Only available inpaymentandsubscriptionmode.setup_intentThe ID of the SetupIntent for Checkout Sessions insetupmode. You can't confirm or cancel the SetupIntent for a Checkout Session. To cancel, expire the Checkout Session instead.shipping_address_collectionWhen set, provides configuration for Checkout to collect a shipping address from a customer.shipping_costThe details of the customer cost of shipping, including the customer chosen ShippingRate.shipping_optionsThe shipping rate options applied to this Session.statusThe status of the Checkout Session, one ofopen,complete, orexpired.submit_typeDescribes 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.subscriptionThe ID of the Subscription for Checkout Sessions insubscriptionmode.success_urlThe URL the customer will be directed to after the payment or subscription creation is successful.tax_id_collectiontotal_detailsTax and discount details for the computed total amount.ui_modeThe UI mode of the Session. Defaults tohosted.urlThe 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.wallet_optionsWallet-specific configuration for this Checkout Session.
@type tax_id_collection() :: %{ optional(:enabled) => boolean(), optional(:required) => :if_supported | :never }
Controls tax ID collection during checkout.
@type terms_of_service_acceptance() :: %{optional(:message) => binary()}
@type text() :: %{ optional(:default_value) => binary(), optional(:maximum_length) => integer(), optional(:minimum_length) => integer() }
Configuration for type=text fields.
@type transfer_data() :: %{ optional(:amount_percent) => number(), optional(:destination) => binary() }
If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
@type trial_settings() :: %{optional(:end_behavior) => end_behavior()}
Settings related to subscription trials.
@type twint() :: %{optional(:setup_future_usage) => :none}
contains details about the TWINT payment method options.
@type us_bank_account() :: %{ optional(:financial_connections) => financial_connections(), optional(:setup_future_usage) => :none | :off_session | :on_session, optional(:target_date) => binary(), optional(:verification_method) => :automatic | :instant }
contains details about the Us Bank Account payment method options.
@type wallet_options() :: %{optional(:link) => link()}
Wallet-specific configuration.
@type wechat_pay() :: %{ optional(:app_id) => binary(), optional(:client) => :android | :ios | :web, optional(:setup_future_usage) => :none }
contains details about the WeChat Pay payment method options.
Functions
@spec create( params :: %{ optional(:submit_type) => :auto | :book | :donate | :pay | :subscribe, optional(:branding_settings) => branding_settings(), optional(:shipping_address_collection) => shipping_address_collection(), optional(:custom_text) => custom_text(), optional(:excluded_payment_method_types) => [ :acss_debit | :affirm | :afterpay_clearpay | :alipay | :alma | :amazon_pay | :au_becs_debit | :bacs_debit | :bancontact | :billie | :blik | :boleto | :card | :cashapp | :crypto | :customer_balance | :eps | :fpx | :giropay | :grabpay | :ideal | :kakao_pay | :klarna | :konbini | :kr_card | :mb_way | :mobilepay | :multibanco | :naver_pay | :nz_bank_account | :oxxo | :p24 | :pay_by_bank | :payco | :paynow | :paypal | :pix | :promptpay | :revolut_pay | :samsung_pay | :satispay | :sepa_debit | :sofort | :swish | :twint | :us_bank_account | :wechat_pay | :zip ], optional(:metadata) => %{optional(binary()) => binary()}, optional(:custom_fields) => [custom_fields()], optional(:setup_intent_data) => setup_intent_data(), optional(:redirect_on_completion) => :always | :if_required | :never, optional(:payment_method_configuration) => binary(), optional(:name_collection) => name_collection(), optional(:shipping_options) => [shipping_options()], optional(:locale) => :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" | :"zh-TW", optional(:payment_intent_data) => payment_intent_data(), optional(:customer_email) => binary(), optional(:client_reference_id) => binary(), optional(:saved_payment_method_options) => saved_payment_method_options(), optional(:tax_id_collection) => tax_id_collection(), optional(:permissions) => permissions(), optional(:payment_method_types) => [ :acss_debit | :affirm | :afterpay_clearpay | :alipay | :alma | :amazon_pay | :au_becs_debit | :bacs_debit | :bancontact | :billie | :blik | :boleto | :card | :cashapp | :crypto | :customer_balance | :eps | :fpx | :giropay | :grabpay | :ideal | :kakao_pay | :klarna | :konbini | :kr_card | :link | :mb_way | :mobilepay | :multibanco | :naver_pay | :nz_bank_account | :oxxo | :p24 | :pay_by_bank | :payco | :paynow | :paypal | :pix | :promptpay | :revolut_pay | :samsung_pay | :satispay | :sepa_debit | :sofort | :swish | :twint | :us_bank_account | :wechat_pay | :zip ], optional(:discounts) => [discounts()], optional(:payment_method_collection) => :always | :if_required, optional(:optional_items) => [optional_items()], optional(:currency) => binary(), optional(:payment_method_options) => payment_method_options(), optional(:invoice_creation) => invoice_creation(), optional(:phone_number_collection) => phone_number_collection(), optional(:adaptive_pricing) => adaptive_pricing(), optional(:automatic_tax) => automatic_tax(), optional(:cancel_url) => binary(), optional(:wallet_options) => wallet_options(), optional(:customer_creation) => :always | :if_required, optional(:expires_at) => integer(), optional(:subscription_data) => subscription_data(), optional(:return_url) => binary(), optional(:after_expiration) => after_expiration(), optional(:billing_address_collection) => :auto | :required, optional(:customer) => binary(), optional(:expand) => [binary()], optional(:payment_method_data) => payment_method_data(), optional(:origin_context) => :mobile_app | :web, optional(:ui_mode) => :custom | :embedded | :hosted, optional(:mode) => :payment | :setup | :subscription, optional(:consent_collection) => consent_collection(), optional(:allow_promotion_codes) => boolean(), optional(:success_url) => binary(), optional(:line_items) => [line_items()], optional(:customer_update) => customer_update() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Creates a Checkout Session object.
Details
- Method:
post - Path:
/v1/checkout/sessions
@spec expire( session :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
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.
Details
- Method:
post - Path:
/v1/checkout/sessions/{session}/expire
@spec list( params :: %{ optional(:created) => created() | integer(), optional(:customer) => binary(), optional(:customer_details) => customer_details(), optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:limit) => integer(), optional(:payment_intent) => binary(), optional(:payment_link) => binary(), optional(:starting_after) => binary(), optional(:status) => :complete | :expired | :open, optional(:subscription) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Returns a list of Checkout Sessions.
Details
- Method:
get - Path:
/v1/checkout/sessions
@spec list_line_items( session :: binary(), params :: %{ optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:limit) => integer(), optional(:starting_after) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(Stripe.Item.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
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.
Details
- Method:
get - Path:
/v1/checkout/sessions/{session}/line_items
@spec retrieve( session :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieves a Checkout Session object.
Details
- Method:
get - Path:
/v1/checkout/sessions/{session}
@spec update( session :: binary(), params :: %{ optional(:collected_information) => collected_information(), optional(:expand) => [binary()], optional(:metadata) => %{optional(binary()) => binary()} | binary(), optional(:shipping_options) => [shipping_options()] | binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Updates a Checkout Session object.
Related guide: Dynamically update Checkout
Details
- Method:
post - Path:
/v1/checkout/sessions/{session}