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.1
Generate a publishable key
Click Generate key. Copy the
pk_live_... key immediately. The full key is shown only once.2
Add your storefront origin
Add the exact origin that hosts your checkout page, for example
https://yourstore.com.3
Add local development origins
For local testing, add the exact local origin too, for example
http://localhost:3000.
If your site works on both
https://vyy.gg and https://www.vyy.gg, add both origins.
Install
React example
ShoppexPoweredBy is required unless Shoppex has manually assigned the hidden White Label plan to the merchant. The SDK checks that the badge is visible before payment confirmation whenever the server returns attribution.required: true. The server owns this directive; the browser cannot disable it.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
- save buyer email, marketing preference, billing address, and method-specific terms acceptance
- save product custom fields and delivery instructions
- start a gateway payment session
- complete zero-total checkouts
- request and verify Customer Balance OTPs, then apply full or partial balance payments
- submit browser-bound proof for manual payment methods
- capture/finalize PayPal and SumUp payments
- 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.
Buyer details and payment requirements
Each entry insession.gateways_available contains:
fee_preview: the server-calculated fee for that methodpresentation: merchant label, button label, icon, and provider-attribution preferencerequirements: whether method terms and a billing address must be saved
presentation.hide_provider_attribution only controls the payment provider’s
attribution. It does not change the server-owned ShoppexPoweredBy requirement.
Persist the details before starting the gateway:
EU withdrawal consent (digital goods)
EU consumer law (Consumer Rights Directive Art. 16(m)) lets a buyer of digital content waive the 14-day right of withdrawal in exchange for immediate delivery. Shops opt in under Settings → Checkout → EU Withdrawal Consent. When they have, the session carries the server’s verdict for this buyer:required is true only for EU buyers (or an unknown country) with at least
one immediately delivered digital line item; renewals and non-EU buyers are
never asked. While required is true and recorded_at is null, every
startPaymentSession() is refused with 409 withdrawal_consent_required.
Render text verbatim as an unchecked checkbox and record the proof once the
buyer ticks it. The proof is first-write-wins and returns the refreshed view:
useCheckoutSession() exposes recordWithdrawalConsent() and
updates the session in place. useStripePaymentSession() starts its attempt as
soon as the session id arrives; if that start is refused because the consent is
outstanding, the hook re-issues it by itself once the proof is recorded. Other
gateways start on your call, so start them after the consent.
Free and Customer Balance checkout
Crypto progress and underpayments
CallgetSession() or the React refresh() action to read the authoritative
payment projection. session.payment_detail includes the exact decimal strings
needed for a crypto progress or underpayment UI:
expected, received, remaining, crypto_currency,
buyer_actionable, buyer_action_reason, provider_status, credited_fiat,
received_fiat_estimate, fiat_currency, confirmations, and
confirmations_needed when those values are available. credited_fiat is the
amount the provider applied to the invoice. received_fiat_estimate is only a
display estimate for crypto observed on-chain and must never be counted as paid.
Keep the amount values as strings. Do not recalculate the remainder with
JavaScript floating-point numbers.
Embed provider adapters
Stripe usesuseStripePaymentSession. The framework-agnostic Headless export also includes:
Manual payment proof
When a manual payment session hasrequire_proof: true, use proof_type to render a note input, image input, or both. Then submit the proof with the completion grant returned by the start call:
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.
Add origin fails
Use a fullhttp:// or https:// origin. These are valid:
Browser API calls fail
Check the browser response code: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.