Mayson Monorepo Documentation
    Preparing search index...

    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

    interface Session {
        id: string;
        object: "checkout.session";
        adaptive_pricing: Stripe.Checkout.Session.AdaptivePricing;
        after_expiration: Stripe.Checkout.Session.AfterExpiration;
        allow_promotion_codes: boolean;
        amount_subtotal: number;
        amount_total: number;
        automatic_tax: Stripe.Checkout.Session.AutomaticTax;
        billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection;
        branding_settings?: Stripe.Checkout.Session.BrandingSettings;
        cancel_url: string;
        client_reference_id: string;
        client_secret: string;
        collected_information: Stripe.Checkout.Session.CollectedInformation;
        consent: Stripe.Checkout.Session.Consent;
        consent_collection: Stripe.Checkout.Session.ConsentCollection;
        created: number;
        currency: string;
        currency_conversion: CurrencyConversion;
        custom_fields: Stripe.Checkout.Session.CustomField[];
        custom_text: Stripe.Checkout.Session.CustomText;
        customer: string | Stripe.Customer | DeletedCustomer;
        customer_account: string;
        customer_creation: Stripe.Checkout.Session.CustomerCreation;
        customer_details: Stripe.Checkout.Session.CustomerDetails;
        customer_email: string;
        discounts: Stripe.Checkout.Session.Discount[];
        excluded_payment_method_types?: string[];
        expires_at: number;
        invoice: string | Stripe.Invoice;
        invoice_creation: Stripe.Checkout.Session.InvoiceCreation;
        line_items?: ApiList<Stripe.LineItem>;
        livemode: boolean;
        locale: Stripe.Checkout.Session.Locale;
        metadata: Metadata;
        mode: Stripe.Checkout.Session.Mode;
        name_collection?: Stripe.Checkout.Session.NameCollection;
        optional_items?: Stripe.Checkout.Session.OptionalItem[];
        origin_context: Stripe.Checkout.Session.OriginContext;
        payment_intent: string | Stripe.PaymentIntent;
        payment_link: string | Stripe.PaymentLink;
        payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection;
        payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails;
        payment_method_options: Stripe.Checkout.Session.PaymentMethodOptions;
        payment_method_types: string[];
        payment_status: PaymentStatus;
        permissions: Stripe.Checkout.Session.Permissions;
        phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection;
        presentment_details?: Stripe.Checkout.Session.PresentmentDetails;
        recovered_from: string;
        redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion;
        return_url?: string;
        saved_payment_method_options: Stripe.Checkout.Session.SavedPaymentMethodOptions;
        setup_intent: string | Stripe.SetupIntent;
        shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection;
        shipping_cost: Stripe.Checkout.Session.ShippingCost;
        shipping_options: Stripe.Checkout.Session.ShippingOption[];
        status: Stripe.Checkout.Session.Status;
        submit_type: Stripe.Checkout.Session.SubmitType;
        subscription: string | Stripe.Subscription;
        success_url: string;
        tax_id_collection?: Stripe.Checkout.Session.TaxIdCollection;
        total_details: Stripe.Checkout.Session.TotalDetails;
        ui_mode: Stripe.Checkout.Session.UiMode;
        url: string;
        wallet_options: Stripe.Checkout.Session.WalletOptions;
    }
    Index

    Properties

    id: string

    Unique identifier for the object.

    object: "checkout.session"

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

    Settings for price localization with Adaptive Pricing.

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

    allow_promotion_codes: boolean

    Enables user redeemable promotion codes.

    amount_subtotal: number

    Total of all items before discounts or taxes are applied.

    amount_total: number

    Total of all items after discounts and taxes are applied.

    billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection

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

    cancel_url: string

    If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.

    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.

    client_secret: string

    The client secret of your Checkout Session. Applies to Checkout Sessions with ui_mode: embedded or ui_mode: custom. For ui_mode: embedded, the client secret is to be used when initializing Stripe.js embedded checkout. For ui_mode: custom, use the client secret with initCheckout on your front end.

    Information about the customer collected within the Checkout Session.

    Results of consent_collection for this session.

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

    created: number

    Time at which the object was created. Measured in seconds since the Unix epoch.

    currency: string

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

    currency_conversion: CurrencyConversion

    Currency conversion details for Adaptive Pricing sessions created before 2025-03-31.

    Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if ui_mode is custom.

    customer: string | Stripe.Customer | DeletedCustomer

    The ID of the customer for this Session. For Checkout Sessions in subscription mode or Checkout Sessions with customer_creation set as always in payment 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.

    customer_account: string

    The ID of the account for this Session.

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

    The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in setup 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.

    List of coupons and promotion codes attached to the Checkout Session.

    excluded_payment_method_types?: string[]

    A list of the types of payment methods (e.g., card) that should be excluded from this Checkout Session. This should only be used when payment methods for this Checkout Session are managed through the Stripe Dashboard.

    expires_at: number

    The timestamp at which the Checkout Session will expire.

    invoice: string | Stripe.Invoice

    ID of the invoice created by the Checkout Session, if it exists.

    Details on the state of invoice creation for the Checkout Session.

    line_items?: ApiList<Stripe.LineItem>

    The line items purchased by the customer.

    livemode: boolean

    Has the value true if the object exists in live mode or the value false if the object exists in test mode.

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

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

    The mode of the Checkout Session.

    optional_items?: Stripe.Checkout.Session.OptionalItem[]

    The optional items presented to the customer at checkout.

    Where the user is coming from. This informs the optimizations that are applied to the session.

    payment_intent: string | Stripe.PaymentIntent

    The ID of the PaymentIntent for Checkout Sessions in payment mode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, expire the Checkout Session instead.

    payment_link: string | Stripe.PaymentLink

    The ID of the Payment Link that created this Session.

    payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection

    Configure whether a Checkout Session should collect a payment method. Defaults to always.

    payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails

    Information about the payment method configuration used for this Checkout session if using dynamic payment methods.

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

    payment_method_types: string[]

    A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.

    payment_status: PaymentStatus

    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.

    This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.

    For specific permissions, please refer to their dedicated subsections, such as permissions.update_shipping_details.

    phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection
    recovered_from: string

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

    redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion

    This parameter applies to ui_mode: embedded. Learn more about the redirect behavior of embedded sessions. Defaults to always.

    return_url?: string

    Applies to Checkout Sessions with ui_mode: embedded or ui_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_options: Stripe.Checkout.Session.SavedPaymentMethodOptions

    Controls saved payment method settings for the session. Only available in payment and subscription mode.

    setup_intent: string | Stripe.SetupIntent

    The ID of the SetupIntent for Checkout Sessions in setup mode. You can't confirm or cancel the SetupIntent for a Checkout Session. To cancel, expire the Checkout Session instead.

    shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection

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

    The details of the customer cost of shipping, including the customer chosen ShippingRate.

    The shipping rate options applied to this Session.

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

    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. If blank or auto, pay is used.

    subscription: string | Stripe.Subscription

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

    success_url: string

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

    Tax and discount details for the computed total amount.

    The UI mode of the Session. Defaults to hosted.

    url: string

    The URL to the Checkout Session. Applies to Checkout Sessions with ui_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 use checkout.stripe.com. This value is only present when the session is active.

    Wallet-specific configuration for this Checkout Session.