Skip to main content
The sdk.checkout namespace handles the checkout flow. After the customer’s cart is ready, create a checkout session to initiate payment. Once payment is complete, retrieve the result.

Methods

checkout.create()

Create a new checkout session from the current cart. The response varies based on the order total:
Returns:
For free orders (100% discount, free products), the order is created immediately and no payment redirect is needed. For paid orders, redirect the customer to checkout_url to complete payment.

checkout.getResult(sessionId)

After the customer returns from payment, check the result of the checkout session.
Parameters: Returns:

Complete Checkout Flow

Ensure the customer is either authenticated (Bearer token set) or has a valid cart token before calling checkout.create(). The API needs to identify the cart to process.