View Source ExOAPI.Stripe.Schemas.Checkout_session (exoapi_stripe v0.1.3)

description: 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 Server Quickstart.

:payment_status :: :string

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 :: :boolean

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 :: ExOAPI.Stripe.Schemas.CheckoutSessionPaymentMethodOptions

Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.

::data :: ExOAPI.Stripe.Schemas.Item

:has_more :: :boolean

True if this list has another page of items after this one that can be fetched.

:object :: :string

String representing the object's type. Objects of the same type share the same value. Always has the value list.

:url :: :string

The URL where this list can be accessed.

:customer_creation :: :string

Configure whether a Checkout Session creates a Customer when the Checkout Session completes.

:payment_link :: ExOAPI.Stripe.Schemas.PaymentLink | :string

The ID of the Payment Link that created this Session.

:metadata :: :map

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 :: :string

:locale :: :string

The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used.

:shipping_address_collection :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionShippingAddressCollection

When set, provides configuration for Checkout to collect a shipping address from a customer.

:consent_collection :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionConsentCollection

When set, provides configuration for the Checkout Session to gather active consent from customers.

:payment_intent :: ExOAPI.Stripe.Schemas.PaymentIntent | :string

The ID of the PaymentIntent for Checkout Sessions in payment mode.

:customer_email :: :string

If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute.

:customer_details :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionCustomerDetails

The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in payment or subscription mode.

:phone_number_collection :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionPhoneNumberCollection

:customer :: ExOAPI.Stripe.Schemas.DeletedCustomer | ExOAPI.Stripe.Schemas.Customer | :string

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.

:submit_type :: :string

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.

:mode :: :string

The mode of the Checkout Session.

:success_url :: :string

The URL the customer will be directed to after the payment or subscription creation is successful.

:recovered_from :: :string

The ID of the original expired Checkout Session that triggered the recovery flow.

:object :: :string

String representing the object's type. Objects of the same type share the same value.

:total_details :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionTotalDetails

Tax and discount details for the computed total amount.

:expires_at :: :integer

The timestamp at which the Checkout Session will expire.

:automatic_tax :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionAutomaticTax

:setup_intent :: ExOAPI.Stripe.Schemas.SetupIntent | :string

The ID of the SetupIntent for Checkout Sessions in setup mode.

:client_reference_id :: :string

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 :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionAfterExpiration

When set, provides configuration for actions to take if this Checkout Session expires.

:tax_id_collection :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionTaxIdCollection

:currency :: :string

Three-letter ISO currency code, in lowercase. Must be a supported currency.

:amount_subtotal :: :integer

Total of all items before discounts or taxes are applied.

:amount_total :: :integer

Total of all items after discounts and taxes are applied.

:url :: :string

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.

:subscription :: ExOAPI.Stripe.Schemas.Subscription | :string

The ID of the subscription for Checkout Sessions in subscription mode.

:allow_promotion_codes :: :boolean

Enables user redeemable promotion codes.

:shipping_rate :: ExOAPI.Stripe.Schemas.ShippingRate | :string

The ID of the ShippingRate for Checkout Sessions in payment mode.

:billing_address_collection :: :string

Describes whether Checkout should collect the customer's billing address.

:cancel_url :: :string

The URL the customer will be directed to if they decide to cancel payment and return to your website.

:status :: :string

The status of the Checkout Session, one of open, complete, or expired.

:consent :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionConsent

Results of consent_collection for this session.

:id :: :string

Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js.

::shipping_options :: ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionShippingOption

:shipping :: ExOAPI.Stripe.Schemas.Shipping

Shipping information for this Checkout Session.

Link to this section Summary

Link to this section Types

@type params() :: map()
@type t() :: %ExOAPI.Stripe.Schemas.Checkout_session{
  after_expiration: ExOAPI.EctoTypes.AnyOf.t() | nil,
  allow_promotion_codes: boolean() | nil,
  amount_subtotal: integer() | nil,
  amount_total: integer() | nil,
  automatic_tax:
    ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionAutomaticTax.t() | nil,
  billing_address_collection: (:required | :auto) | nil,
  cancel_url: String.t() | nil,
  client_reference_id: String.t() | nil,
  consent: ExOAPI.EctoTypes.AnyOf.t() | nil,
  consent_collection: ExOAPI.EctoTypes.AnyOf.t() | nil,
  currency: String.t() | nil,
  customer: ExOAPI.EctoTypes.AnyOf.t() | nil,
  customer_creation: (:if_required | :always) | nil,
  customer_details: ExOAPI.EctoTypes.AnyOf.t() | nil,
  customer_email: String.t() | nil,
  expires_at: integer() | nil,
  id: String.t() | nil,
  line_items: map() | nil,
  livemode: boolean() | nil,
  locale:
    (:"zh-TW"
     | :"zh-HK"
     | :zh
     | :vi
     | :tr
     | :th
     | :sv
     | :sl
     | :sk
     | :ru
     | :ro
     | :"pt-BR"
     | :pt
     | :pl
     | :nl
     | :nb
     | :mt
     | :ms
     | :lv
     | :lt
     | :ko
     | :ja
     | :it
     | :id
     | :hu
     | :hr
     | :"fr-CA"
     | :fr
     | :fil
     | :fi
     | :et
     | :"es-419"
     | :es
     | :"en-GB"
     | :en
     | :el
     | :de
     | :da
     | :cs
     | :bg
     | :auto)
    | nil,
  metadata: map() | nil,
  mode: (:subscription | :setup | :payment) | nil,
  object: :"checkout.session" | nil,
  payment_intent: ExOAPI.EctoTypes.AnyOf.t() | nil,
  payment_link: ExOAPI.EctoTypes.AnyOf.t() | nil,
  payment_method_options: ExOAPI.EctoTypes.AnyOf.t() | nil,
  payment_method_types: [String.t()] | nil,
  payment_status: (:unpaid | :paid | :no_payment_required) | nil,
  phone_number_collection:
    ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionPhoneNumberCollection.t()
    | nil,
  recovered_from: String.t() | nil,
  setup_intent: ExOAPI.EctoTypes.AnyOf.t() | nil,
  shipping: ExOAPI.EctoTypes.AnyOf.t() | nil,
  shipping_address_collection: ExOAPI.EctoTypes.AnyOf.t() | nil,
  shipping_options: [
    ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionShippingOption.t()
  ],
  shipping_rate: ExOAPI.EctoTypes.AnyOf.t() | nil,
  status: (:open | :expired | :complete) | nil,
  submit_type: (:pay | :donate | :book | :auto) | nil,
  subscription: ExOAPI.EctoTypes.AnyOf.t() | nil,
  success_url: String.t() | nil,
  tax_id_collection:
    ExOAPI.Stripe.Schemas.PaymentPagesCheckoutSessionTaxIdCollection.t() | nil,
  total_details: ExOAPI.EctoTypes.AnyOf.t() | nil,
  url: String.t() | nil
}

Link to this section Functions

Link to this function

changeset(struct \\ %__MODULE__{}, params)

View Source
@spec changeset(t(), params()) :: Ecto.Changeset.t()