1. Checkout
Documentation
  • Back to home
  • StripeKit
  • Installation
  • Getting Started
  • Choosing a Mode
  • Type Reference
  • Setup
    • Configuration
    • Timezones
    • Storage Adapter
    • Money and Currency
    • Error Handling
  • Stripe
    • Elements
  • Modules
    • Overview
    • Customers
      • Overview
      • List
      • Retrieve
      • Find or Create by Email
      • Create
      • Update
      • Sync
      • Delete
    • Payment Methods
      • Overview
      • Create Setup Intent
      • List
      • Attach
      • Detach
      • Set Default
      • Sync
    • Payments
      • Overview
      • Pay With Saved Method
      • Create
      • Retrieve
      • Confirm
      • Cancel
      • Sync
    • Checkout
      • Overview
      • Get
      • Create
      • Submit Fields
      • Apply Coupon
      • Mark Complete
    • Subscriptions
      • Overview
      • Create
      • Retrieve
      • Cancel
      • Resume
      • Toggle Collection Method
      • Update Fields
      • Apply Promotion Code
      • List By Customer
      • Find By Metadata
      • Sync
    • Invoices
      • Overview
      • Retrieve
      • List By Customer
      • List By Subscription
      • Pay With Saved Method
      • Void
      • Finalize
      • Sync
    • Coupons
      • Overview
      • Create
      • Validate
      • Apply To Subscription
      • List
      • Deactivate
    • Webhooks
      • Overview
      • Process
      • Events Reference
    • Sync
      • Overview
  1. Checkout

Overview

kit.checkout is the high-level module for building your own checkout flow: one-off payments or subscriptions, with optional custom form fields and coupon codes, in either the api or elements flow.
Unlike other modules, checkout sessions are StripeKit's own concept layered on top of Stripe (either a Stripe Checkout Session in the api flow, or a PaymentIntent in the elements flow), plus some in-flight state (custom field values, coupon codes) that has nowhere to live in Stripe itself. That state is stored through your storage adapter's saveCheckoutSession() / getCheckoutSession(), or in local process memory if you haven't provided one. See Storage adapter for why that matters in production.

Methods#

MethodDescription
create()Start a new checkout session.
get()Fetch the current state of a checkout session.
submitFields()Submit and validate custom field values for a session.
applyCoupon()Apply or remove a coupon code, recalculating the amount.
markComplete()Mark a session as complete.

The CheckoutResult shape#

Returned by create() and get():
requiresFields is true whenever customFields were defined but no matching fieldValues were supplied yet, meaning your frontend should collect and submit them via submitFields() before the customer can pay.
Previous
Sync
Next
Get
Built with