View Source Stripe.Checkout.Session (Striped v0.5.0) (generated)

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 pass its ID to the client to begin Checkout.

Related guide: Checkout Quickstart.

Link to this section Summary

Types

contains details about the ACSS Debit payment method options.

Shipping address.

When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.

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 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 Boleto payment method options.

contains details about the Card payment method options.

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 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.

contains details about the FPX payment method options.

contains details about the Giropay payment method options.

contains details about the Grabpay payment method options.

contains details about the Ideal payment method options.

Installment options for card payments

contains details about the Klarna payment method options.

contains details about the Konbini payment method options.

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 OXXO payment method options.

contains details about the P24 payment method options.

A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in payment mode.

Payment-method-specific configuration.

contains details about the PayNow payment method options.

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.

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.

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.

t()

The checkout.session type.

Controls tax ID collection settings for the session.

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.

contains details about the Us Bank Account payment method options.

contains details about the WeChat Pay payment method options.

Functions

Creates a Session object.

A 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.

Link to this section Types

@type acss_debit() :: %{
  optional(:currency) => :cad | :usd,
  optional(:mandate_options) => mandate_options(),
  optional(:setup_future_usage) => :none | :off_session | :on_session,
  optional(:verification_method) => :automatic | :instant | :microdeposits
}

contains details about the ACSS Debit payment method options.

@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 this item’s quantity to be adjusted by the customer during Checkout.

@type affirm() :: %{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 afterpay_clearpay() :: %{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 au_becs_debit() :: %{optional(:setup_future_usage) => :none}

contains details about the AU Becs Debit payment method options.

@type automatic_tax() :: %{optional(:enabled) => boolean()}

Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions.

@type bacs_debit() :: %{
  optional(:setup_future_usage) => :none | :off_session | :on_session
}

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) => [
    :iban | :sepa | :sort_code | :spei | :zengin
  ],
  optional(:type) =>
    :eu_bank_transfer
    | :gb_bank_transfer
    | :jp_bank_transfer
    | :mx_bank_transfer
}

Configuration for the bank transfer funding type, if the funding_type is set to bank_transfer.

@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 card() :: %{
  optional(:installments) => installments(),
  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 consent_collection() :: %{
  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(:shipping_address) => shipping_address() | binary(),
  optional(:submit) => submit() | 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.

@type delivery_estimate() :: %{
  optional(:maximum) => maximum(),
  optional(:minimum) => minimum()
}

The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.

@type discounts() :: %{
  optional(:coupon) => binary(),
  optional(:promotion_code) => binary()
}
@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.

Link to this type

financial_connections()

View Source
@type financial_connections() :: %{
  optional(:permissions) => [
    :balances | :ownership | :payment_method | :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 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 ideal() :: %{optional(:setup_future_usage) => :none}

contains details about the Ideal payment method options.

@type installments() :: %{optional(:enabled) => boolean()}

Installment options for card payments

@type klarna() :: %{optional(:setup_future_usage) => :none}

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 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 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 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 payment_intent_data() :: %{
  optional(:application_fee_amount) => integer(),
  optional(:capture_method) => :automatic | :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.

Link to this type

payment_method_options()

View Source
@type payment_method_options() :: %{
  optional(:acss_debit) => acss_debit(),
  optional(:affirm) => affirm(),
  optional(:afterpay_clearpay) => afterpay_clearpay(),
  optional(:alipay) => alipay(),
  optional(:au_becs_debit) => au_becs_debit(),
  optional(:bacs_debit) => bacs_debit(),
  optional(:bancontact) => bancontact(),
  optional(:boleto) => boleto(),
  optional(:card) => card(),
  optional(:customer_balance) => customer_balance(),
  optional(:eps) => eps(),
  optional(:fpx) => fpx(),
  optional(:giropay) => giropay(),
  optional(:grabpay) => grabpay(),
  optional(:ideal) => ideal(),
  optional(:klarna) => klarna(),
  optional(:konbini) => konbini(),
  optional(:oxxo) => oxxo(),
  optional(:p24) => p24(),
  optional(:paynow) => paynow(),
  optional(:pix) => pix(),
  optional(:sepa_debit) => sepa_debit(),
  optional(:sofort) => sofort(),
  optional(:us_bank_account) => us_bank_account(),
  optional(:wechat_pay) => wechat_pay()
}

Payment-method-specific configuration.

@type paynow() :: %{optional(:setup_future_usage) => :none}

contains details about the PayNow payment method options.

Link to this type

phone_number_collection()

View Source
@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(:expires_after_seconds) => integer()}

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()
}

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 sepa_debit() :: %{
  optional(:setup_future_usage) => :none | :off_session | :on_session
}

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()}
Link to this type

shipping_address_collection()

View Source
@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
    | :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.

@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(:coupon) => binary(),
  optional(:default_tax_rates) => [binary()],
  optional(:description) => binary(),
  optional(:metadata) => %{optional(binary()) => binary()},
  optional(:on_behalf_of) => binary(),
  optional(:transfer_data) => transfer_data(),
  optional(:trial_end) => integer(),
  optional(:trial_from_plan) => boolean(),
  optional(:trial_period_days) => integer()
}

A subset of parameters to be passed to subscription creation for Checkout Sessions in subscription mode.

@type t() :: %Stripe.Checkout.Session{
  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,
  cancel_url: binary(),
  client_reference_id: binary() | nil,
  consent: term() | nil,
  consent_collection: term() | nil,
  created: integer(),
  currency: binary() | nil,
  custom_text: term(),
  customer: (binary() | Stripe.Customer.t() | Stripe.DeletedCustomer.t()) | nil,
  customer_creation: binary() | nil,
  customer_details: term() | nil,
  customer_email: binary() | nil,
  expires_at: integer(),
  id: binary(),
  line_items: term(),
  livemode: boolean(),
  locale: binary() | nil,
  metadata: term() | nil,
  mode: binary(),
  object: binary(),
  payment_intent: (binary() | Stripe.PaymentIntent.t()) | nil,
  payment_link: (binary() | Stripe.PaymentLink.t()) | nil,
  payment_method_collection: binary() | nil,
  payment_method_options: term() | nil,
  payment_method_types: term(),
  payment_status: binary(),
  phone_number_collection: term(),
  recovered_from: binary() | nil,
  setup_intent: (binary() | Stripe.SetupIntent.t()) | nil,
  shipping_address_collection: term() | nil,
  shipping_cost: term() | nil,
  shipping_details: term() | nil,
  shipping_options: term(),
  status: binary() | nil,
  submit_type: binary() | nil,
  subscription: (binary() | Stripe.Subscription.t()) | nil,
  success_url: binary(),
  tax_id_collection: term(),
  total_details: term() | nil,
  url: binary() | nil
}

The checkout.session type.

  • payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
  • line_items The line items purchased by the customer.
  • customer_creation Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
  • payment_link The ID of the Payment Link that created this Session.
  • metadata 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.
  • payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
  • locale The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used.
  • shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer.
  • consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers.
  • payment_intent The ID of the PaymentIntent for Checkout Sessions in payment mode.
  • customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute.
  • customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in setup mode.
  • phone_number_collection
  • customer The ID of the customer for this Session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created.
  • shipping_cost The details of the customer cost of shipping, including the customer chosen ShippingRate.
  • submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode.
  • custom_text
  • mode The mode of the Checkout Session.
  • success_url The URL the customer will be directed to after the payment or subscription creation is successful.
  • recovered_from The ID of the original expired Checkout Session that triggered the recovery flow.
  • object String representing the object's type. Objects of the same type share the same value.
  • total_details Tax and discount details for the computed total amount.
  • expires_at The timestamp at which the Checkout Session will expire.
  • automatic_tax
  • setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode.
  • client_reference_id 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.
  • after_expiration When set, provides configuration for actions to take if this Checkout Session expires.
  • tax_id_collection
  • currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • amount_subtotal Total of all items before discounts or taxes are applied.
  • amount_total Total of all items after discounts and taxes are applied.
  • payment_method_collection Configure whether a Checkout Session should collect a payment method.
  • url The URL to the Checkout Session. 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 use checkout.stripe.com. This value is only present when the session is active.
  • subscription The ID of the subscription for Checkout Sessions in subscription mode.
  • allow_promotion_codes Enables user redeemable promotion codes.
  • billing_address_collection Describes whether Checkout should collect the customer's billing address.
  • cancel_url The URL the customer will be directed to if they decide to cancel payment and return to your website.
  • status The status of the Checkout Session, one of open, complete, or expired.
  • shipping_details Shipping information for this Checkout Session.
  • consent Results of consent_collection for this session.
  • id Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js.
  • shipping_options The shipping rate options applied to this Session.
@type tax_id_collection() :: %{optional(:enabled) => boolean()}

Controls tax ID collection settings for the session.

@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 us_bank_account() :: %{
  optional(:financial_connections) => financial_connections(),
  optional(:setup_future_usage) => :none | :off_session | :on_session,
  optional(:verification_method) => :automatic | :instant
}

contains details about the Us Bank Account payment method options.

@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.

Link to this section Functions

Link to this function

create(client, params \\ %{}, opts \\ [])

View Source
@spec create(
  client :: Stripe.t(),
  params :: %{
    optional(:payment_method_options) => payment_method_options(),
    optional(:line_items) => [line_items()],
    optional(:customer_creation) => :always | :if_required,
    optional(:expand) => [binary()],
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:subscription_data) => subscription_data(),
    optional(:payment_method_types) => [
      :acss_debit
      | :affirm
      | :afterpay_clearpay
      | :alipay
      | :au_becs_debit
      | :bacs_debit
      | :bancontact
      | :blik
      | :boleto
      | :card
      | :customer_balance
      | :eps
      | :fpx
      | :giropay
      | :grabpay
      | :ideal
      | :klarna
      | :konbini
      | :oxxo
      | :p24
      | :paynow
      | :pix
      | :promptpay
      | :sepa_debit
      | :sofort
      | :us_bank_account
      | :wechat_pay
    ],
    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(:shipping_address_collection) => shipping_address_collection(),
    optional(:consent_collection) => consent_collection(),
    optional(:customer_email) => binary(),
    optional(:phone_number_collection) => phone_number_collection(),
    optional(:customer) => binary(),
    optional(:submit_type) => :auto | :book | :donate | :pay,
    optional(:customer_update) => customer_update(),
    optional(:custom_text) => custom_text(),
    optional(:mode) => :payment | :setup | :subscription,
    optional(:success_url) => binary(),
    optional(:expires_at) => integer(),
    optional(:automatic_tax) => automatic_tax(),
    optional(:client_reference_id) => binary(),
    optional(:after_expiration) => after_expiration(),
    optional(:tax_id_collection) => tax_id_collection(),
    optional(:currency) => binary(),
    optional(:discounts) => [discounts()],
    optional(:payment_method_collection) => :always | :if_required,
    optional(:allow_promotion_codes) => boolean(),
    optional(:billing_address_collection) => :auto | :required,
    optional(:setup_intent_data) => setup_intent_data(),
    optional(:cancel_url) => binary(),
    optional(:payment_intent_data) => payment_intent_data(),
    optional(:shipping_options) => [shipping_options()],
    optional(:shipping_rates) => [binary()]
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a Session object.

Details

  • Method: post
  • Path: /v1/checkout/sessions
Link to this function

expire(client, session, params \\ %{}, opts \\ [])

View Source
@spec expire(
  client :: Stripe.t(),
  session :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

A Session can be expired when it is in one of these statuses: open.

After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.

Details

  • Method: post
  • Path: /v1/checkout/sessions/{session}/expire
Link to this function

list(client, params \\ %{}, opts \\ [])

View Source
@spec list(
  client :: Stripe.t(),
  params :: %{
    optional(:customer) => binary(),
    optional(:customer_details) => customer_details(),
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:limit) => integer(),
    optional(:payment_intent) => binary(),
    optional(:starting_after) => binary(),
    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
Link to this function

list_line_items(client, session, params \\ %{}, opts \\ [])

View Source
@spec list_line_items(
  client :: Stripe.t(),
  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
Link to this function

retrieve(client, session, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  client :: Stripe.t(),
  session :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves a Session object.

Details

  • Method: get
  • Path: /v1/checkout/sessions/{session}