The Headless Checkout SDK is for merchants who want a fully custom checkout page on their own domain. You own the layout, fields, and buyer experience. Shoppex still creates the invoice, starts the payment session, handles 3DS or redirects, receives webhooks, and fulfills the order. Use this when the hosted checkout page or modal embed is not flexible enough.Documentation Index
Fetch the complete documentation index at: https://docs.shoppex.io/llms.txt
Use this file to discover all available pages before exploring further.
Headless checkout requires an active Business plan.
What You Need
- A storefront or app page on your own domain.
- An active Business plan.
- A headless checkout publishable key from the dashboard.
- At least one allowed origin for the site that will call the browser API.
@shoppexio/checkout-jsinstalled in your frontend app.
Dashboard Setup
Open Dashboard -> Settings -> Developer -> Headless Checkout.Generate a publishable key
Click Generate key. Copy the
pk_live_... key immediately. The full key is shown only once.Add your storefront origin
Add the exact origin that hosts your checkout page, for example
https://yourstore.com.| URL you paste | Saved origin |
|---|---|
https://vyy.gg/checkout | https://vyy.gg |
https://www.vyy.gg | https://www.vyy.gg |
http://localhost:3000/cart | http://localhost:3000 |
https://vyy.gg and https://www.vyy.gg, add both origins.
Install
React Example
ShoppexPoweredBy is required unless your account has a server-side white-label entitlement. The SDK checks that the badge is visible before payment confirmation.API Shape
The browser SDK sends the publishable key in thex-shoppex-publishable-key header. Shoppex also checks the request Origin header against your allowed origins.
The SDK can:
- create a checkout session
- read the current session status
- apply or remove coupons
- set tips
- select add-ons
- start a gateway payment session
- fetch delivery after the payment is complete
kind, not the provider name, so your UI works across card, redirect, crypto, balance, and manual payment flows.
Troubleshooting
Generate key fails
Check these first:- The shop has an active Business plan.
- You are using the shop owner account or a team member with permission to manage webhooks/developer settings.
- Your dashboard session is fresh. Refresh the page or log out and back in.
| Status | Meaning |
|---|---|
403 BUSINESS_PLAN_REQUIRED | The shop is not on an active Business plan. |
401 | The dashboard session or shop permission is invalid. |
500 | Backend or database issue. Contact support with the request id if available. |
Add origin fails
Use a fullhttp:// or https:// origin. These are valid:
Browser API calls fail
Check the browser response code:| Status | Meaning |
|---|---|
401 | Missing, malformed, or unknown publishable key. Make sure it starts with pk_live_ or pk_test_. |
403 ORIGIN_NOT_ALLOWED | The calling site’s origin is not in the allowed origins list. |
403 BUSINESS_PLAN_REQUIRED | Headless checkout is not enabled for the shop’s current plan. |
Related Docs
Headless Commerce Overview
Pick the right integration shape for custom storefronts, apps, and backend flows.
Checkout Embed SDK
Use the hosted modal when you do not need a fully custom checkout UI.
Storefront SDK
Read public product, cart, and storefront data from browser code.
Webhooks
Fulfill orders and update your app after Shoppex receives payment events.