Skip to main content
The Checkout Embed SDK opens Shoppex checkout in a modal, directly on your site, with a script tag and no build step.

What this is (and what it is not)

Quick start

Option A: data attributes (fastest)
Option A2: group button
Option B: JavaScript API (more control)

Common events

Current behavior to know

  • Group embeds work through data-shoppex-group-id or Shoppex.open({ groupId }).
  • Group embeds show a product picker first, then continue into the normal product checkout.
  • The API accepts multiple items, but the current modal flow uses the first valid item.
  • Quantity is normalized to 1..999.
  • Invalid or empty items do not open checkout, unless a valid groupId is provided.

If you already have your own product cards

This setup causes the most confusion in real projects, so here is the simple rule.
  • Use the Checkout Embed SDK when you only need Shoppex to open checkout.
  • Use a product data source when you also render your own product list, prices, images, stock, or categories.
In plain terms:
  • window.Shoppex handles the modal checkout.
  • If you want to build custom cards around it, your app still needs product data from somewhere.
Common setups: Typical product data sources:
  • Shoppex Storefront API
  • Storefront SDK (@shoppexio/storefront)
  • Your own backend that already proxies Shoppex product data
Important:
  • data-shoppex-product-id is part of the public Embed SDK integration.
  • data-shoppex-group-id is also part of the public Embed SDK integration.
  • Local helpers, TypeScript types, or lib/shoppex.ts-style files are not required by Shoppex itself.
  • Those files are app-level code you can add to keep your own project organized.
Here, your app owns the ProductCard, and Shoppex owns the checkout modal.

Framework snippets

Replace all placeholder values: PRODUCT_ID, GROUP_ID, VARIANT_ID, and https://your-site.com/thank-you.

Next.js

React SPA

WordPress

Paste this into a Custom HTML block.
If your theme strips script tags, add the script globally, for example in footer settings or the theme template, and keep only the button markup in content.

Webflow

Add an Embed element and paste this.
If you already load the script site-wide in Webflow project settings, keep only the button in each Embed block.

Bonus: programmatic multi-item button

The current modal flow uses the first valid item when multiple items are passed.

Group embed button

Use this when you want buyers to choose one product from a Shoppex group inside the modal. The group view opens first, and when the buyer picks a product, Shoppex continues into the normal product checkout flow.

Hybrid: your own product cards + Shoppex checkout

Use this when you already render your own catalog UI and only want Shoppex for the checkout modal. Fetch product data however you want, render your own cards, and put data-shoppex-product-id on the CTA button. Shoppex handles the rest.
Notes:
  • The product card layout is yours, not Shoppex’s.
  • The checkout modal is Shoppex’s.
  • You can get products from the Storefront API, @shoppexio/storefront, or your own backend.
  • You do not need to copy any specific lib/shoppex.ts file from another project. That kind of helper is one possible app structure.

Event snippet (analytics)

Embed SDK reference

Full config, data attributes, API methods, event contracts, CSP, and the production checklist.

Embed demo

Interactive demo with real embed patterns.