Skip to main content
The Embed API supports two checkout modes: authenticated checkout (using a Sanctum token from the OTP flow) and guest checkout (providing customer details directly). Both modes create a checkout session and return payment options.

Authenticated Checkout

Create a checkout session for an authenticated customer. Customer information is retrieved from the token.

Headers

Request Body

Success Response - Payment Required (200)

Success Response - Free Order (200)

When the total is zero (e.g., 100% discount coupon), the order is created immediately:

Available Payment Methods

Available payment methods depend on the store’s configuration and the order amount. Not all methods are available for every store.

Guest Checkout

Create a checkout session without OTP authentication. Customer details are provided directly in the request body.

Headers

Request Body

The response format is identical to the authenticated checkout response above.

Initiate Payment

After creating a checkout session, initiate the actual payment with the customer’s chosen payment method.

Authenticated Payment

Requires Authorization: Bearer <token> with embed:checkout ability.

Guest Payment

No authentication required.

Request Body (Both Endpoints)

Response Types

The response varies by payment method: Card, Mada, STC Pay, Apple Pay, Coinbase, PayPal (with PayPal.me link)
Redirect the customer to redirect_url to complete payment. PayPal (manual, email only)
Bank Transfer

Error Responses

Checkout sessions expire after a period of time. If a customer takes too long, you may need to create a new checkout session.

Product Fields

Products can have custom fields that customers fill in during checkout. Pass field values in the fields object, keyed by the field’s array index from the product data.

Field Types

Select fields can include price add-ons. The add-on amount is added to the unit price before calculating the total. Check the product info response to see if options have prices.