Skip to content

Online store

  • the Online shop module enabled, with a channel
  • published products with price and stock
  • the channel linked to the site (or the channel key), payment and shipping methods

Paste it after the base prompt, then add Design without the AI look.

Build an online store on /api/site/v1/shop. Read GET /shop/openapi.json and GET /shop/channel first.
Sales flow:
1. Catalog: collections, filters, sorting, search, pagination. Filter URLs are shareable.
2. Product page: photos, variants, price, old price, availability, "tell me when it is back" (POST /shop/stock-alerts), reviews.
3. Cart: POST /shop/carts, keep the token in a cookie; lines through /shop/carts/<token>/lines; discount code. The cart also opens in a side drawer.
4. Shipping: GET /shop/shipping/quote, parcel lockers if available (/shop/shipping/lockers), counties and cities from /shop/geo.
5. Payment: methods from GET /shop/payment-methods.
6. One page checkout: POST /shop/carts/<token>/checkout with Idempotency-Key. Field errors arrive in error.details. For card payment send the person to payment.payment_url.
7. After the order: thank you page and order tracking.
Shopper account (optional, guest checkout also works): register, login, orders, addresses, wishlist, returns. Session in an httpOnly cookie, sent as X-Shop-Session.
Rules:
- Do not compute totals, VAT or shipping in the frontend: show what the cart returns.
- Legal pages and menus from /shop/pages and /shop/menus.
- Product structured data, sitemap, redirects.
- A shop.changed webhook that purges the cache.
Store performance, as in the Casa Lumen demo:
- Cache products, collections, menus; the shop.changed webhook marks only the affected entries stale and refreshes them in the background, two at most.
- At startup warm channel, menus, collections and products; the healthcheck says "ready" only afterwards.
- Keep public page HTML compressed in memory for 60 s, for signed-out visitors only.
- On the product page: preload the main photo; load reviews separately (server island).
- In grids only the first cards are eager, the rest lazy.
- Hero in AVIF with a separate phone variant, preloaded with fetchpriority high.
- Speculation rules for prefetch, excluding cart, account and checkout.
- Keep the cart returned by each change for a few seconds; shipping quote 60 s, dropped on any change.