window.FlexyPeCheckout object to open or close checkout.
Contact the FlexyPe team for your script URL and to register your store domain before you start.
Add the script
Place the script tag in your site’s<head>. The defer attribute ensures it loads without blocking rendering.
window.FlexyPeCheckout object becomes available with open and close methods.
In a Hydrogen or React app, add the tag to your root HTML document (e.g. the
<head> in your root route / document component) so it loads once for the whole app.How store detection works
FlexyPe detects your store from the domain the script runs on. That domain must match the store domain you registered with us during onboarding — otherwise checkout won’t open.- Production: no extra config needed. The SDK uses your live domain automatically.
- Local development: add a
data-shop-domainattribute to the script tag with your registered domain so the SDK can detect the store while running onlocalhost.
Open checkout
FlexyPeCheckout.open accepts a params object whose flow field determines the checkout behavior.
- Cart checkout
- Buy now
Use the
checkout flow to open checkout with cart items.Must be
"checkout".Items to check out. Each item has
product_id, variant_id, and quantity.Optional label identifying where checkout was triggered (for analytics).
Optional session ID for resuming an abandoned checkout.
Close checkout
Close the checkout programmatically at any time:Examples
Quick reference
Testing on localhost
Use thedata-shop-domain attribute (see How store detection works) to point the SDK at your registered store while developing locally.