Skip to main content
Creates and opens a new checkout session for a given price and customer, and renders the payment UI on the page. This is the primary method to initiate a subscription checkout.
You can customize the checkout appearance and styles. Learn more about checkout customization.

Parameters

string
required
Your organization ID, if not already configured globally. Useful if you did not call configure() or need to override it for this checkout.
string
required
The price identifier for the subscription or product.
object
required
Customer information.
string
required
A CSS selector for the DOM element where the checkout form will be mounted.
object
Additional metadata to associate with this checkout or customer. This data will be passed through to your backend.
object
Custom CSS selectors for card input fields. If not provided, FunnelFox will auto-generate the payment form.
object
Custom CSS selectors for payment buttons. Resolved relative to document, not the container.
array
Array of payment method identifiers to control the display order. Available values: 'PAYMENT_CARD', 'PAYPAL', 'GOOGLE_PAY', 'APPLE_PAY'. Defaults to ['APPLE_PAY', 'GOOGLE_PAY', 'PAYPAL', 'PAYMENT_CARD'].
function
Callback invoked when the checkout has been initialized and is ready.
function
Callback to execute when the payment is successful. An alternative to listening for the 'success' event.
function
Callback for handling errors. Alternative to the 'error' event.
function
Callback invoked on every status change. Alternative to the 'status-change' event.

Returns

A Promise<CheckoutInstance> that resolves to a CheckoutInstance object representing the checkout session. You can use this object to monitor events or perform actions on the active checkout.

Example