- Widget script (recommended) — a single script tag + button with data attributes. The widget handles the entire UI and purchase flow automatically.
- Direct API — HTTP endpoints for building a fully custom checkout experience.
Widget Script (Recommended)
Add the script and a button to any HTML page:| Attribute | Required | Description |
|---|---|---|
data-rmz-product | Yes | Product ID from your dashboard |
data-rmz-key | Yes | Embed public key (starts with rmz_pk_) |
data-rmz-theme | No | auto, light, or dark (default: auto) |
Direct API
If you need full control over the UI, use the API endpoints below.Base URL
Use Cases
- Build a fully custom checkout UI
- Integrate embed purchasing into a native mobile app
- Create a headless embed flow with your own design
Authentication
The Embed API uses two authentication mechanisms depending on the endpoint:1. Embed Key (Public Endpoints)
All requests must include your store’s embed public key. Pass it as a header or query parameter:2. Sanctum Token (Authenticated Endpoints)
After a customer completes the OTP authentication flow, they receive a Sanctum Bearer token with limited abilities (embed:checkout, embed:validate). This token is used for authenticated checkout and token validation endpoints.
Embed tokens are scoped to embed-only abilities. They cannot be used to access Storefront API or other platform endpoints.
Origin Validation
When you configure allowed origins in your embed settings, the API validates theOrigin or Referer header of every request against that list. Requests from unauthorized domains are rejected with a 403 status.
If no allowed origins are configured, requests from any origin are accepted.
Rate Limits
The Embed API enforces multi-layer rate limiting to prevent abuse:| Scope | Limit | Window |
|---|---|---|
| Per IP | 30 requests | 1 minute |
| Per IP | 200 requests | 1 hour |
| Per IP | 500 requests | 1 day |
| Global | 5,000 requests | 1 minute |
429 Too Many Requests:
Additional Auth Rate Limits
The OTP authentication endpoints have separate, stricter rate limits:| Scope | Limit | Window |
|---|---|---|
| OTP start per IP | 50 requests | 1 day |
| OTP start per phone | 10 requests | 1 day |
| OTP resend per IP | 20 requests | 1 day |
| OTP resend per phone | 3 requests | 10 minutes |
CORS
Embed endpoints return permissive CORS headers since they are designed to be called from external websites via iframes or JavaScript:OPTIONS requests return 204 No Content with the appropriate headers.
Response Format
All Embed API endpoints return JSON with a consistent structure:Endpoints at a Glance
Product Info
Fetch product details for the embed widget.
Coupons
Apply coupon codes and calculate discounts.
Authentication
OTP-based customer authentication flow.
Checkout
Create checkout sessions and initiate payments.
Payment Status
Check whether a payment has completed.

