Skip to main content

Overview

This page shows the smallest working integration for both display modes of the embedded checkout SDK. Use inline when you want the payment UI to appear within your page layout, or modal when you want a centered overlay above your page.

Prerequisites

Two server-side calls run before any browser code:
  1. Create the payment request — see Create a Payment Request. Receive REQUEST_ID.
  2. Mint a checkout session token — see Mint a Checkout Session Token. Receive CHECKOUT_TOKEN (15-minute TTL).
Your backend then hands REQUEST_ID and CHECKOUT_TOKEN to the browser through your own authenticated endpoint. The browser never sees your apiKey.

Include the SDK

Add the SDK script to your page. It exposes the global CaiboCheckout object.
Replace REQUEST_ID and CHECKOUT_TOKEN in the examples below with the values returned by the two server-side calls above.

Inline Mode

The checkout appears directly within a <div> on your page. Ideal for single-page checkout flows.

When to use inline

Single-step checkout

The whole purchase flow lives on one page; embed the iframe as the next step.

Custom layout control

You decide the iframe size and surrounding elements (totals, terms, support links).
The checkout opens as a centered modal with backdrop overlay. No container element needed. The modal handles its own UI — backdrop, close button (×), and the Esc key — all firing onCancel.

When to use modal

Cart-style flows

Trigger payment from a button without disturbing the underlying page.

Optional payment

Subscriptions, top-ups, donations — the modal can be opened and closed at will.

Behavior Summary

Next Steps