Checkout in plain HTML
Time: ~15 minutes | Difficulty: Beginner | Type: part of ExamplesFinished project:
headless-vanilla. Clone it if you want the working funnel first — or keep reading and rebuild the three pages yourself.Setup — two lines to edit
No.env, no build. Provision a demo store from the terminal, then paste your store id:
npx serve, nginx, S3, a USB stick) and open index.html.
The SDK ships as an IIFE bundle on jsDelivr —
window.TagadaHeadless appears after one <script> tag. TagadaHeadless.create({ storeId, environment }) gives you the same client as the npm package.Page 1 — cart to checkout in one call
The home page lists real products from your catalog and keeps the cart inlocalStorage. Checkout is a single call — createSessionUrl creates the session and builds the URL to send the customer to:
Page 2 — the checkout
checkout.html starts with the two lines that make redirects painless. If the customer is coming back from a 3DS challenge or a processor redirect, maybeResumeFromUrl() polls the payment to a terminal state and hands you the result; otherwise it returns null and the page renders normally:
Page 3 — one-click upsells
The thank-you page lists upsell offers and charges the saved card in one click — a MIT charge, no card form the second time:Next
Finished project on GitHub
Three HTML files, ready to serve — edit
config.js and openSame thing in React
headless-react-store — the fork-ready boutique storefrontCheckout flow reference
Sessions, addresses, shipping rates, promo codes
Offers reference
listOffers, previewOffer, processOfferPayment