API reference
Every endpoint SwagByte exposes, grouped by resource. Click an endpoint id to anchor-link directly to it (used by the sidebar). All endpoints accept and return JSON unless noted; errors follow { error: string } with an appropriate HTTP status.
Products
/api/productspublicList products with optional category + active filters.
/api/products/{productId}publicFetch a single product by product_id.
Designs
/api/account/designsownerList saved designs for the calling owner (auth or guest).
/api/account/designsownerCreate a new saved design. Mints sb_anon for guests if missing.
/api/account/designs/{id}ownerOverwrite the live design row in place. Returns 409 on stale expected_version_id.
/api/account/designs/{id}/versionsownerList version snapshots, newest first.
/api/account/designs/{id}/versions/{versionId}/restoreownerRevert the live row to a snapshot. 410 if archived.
Cart
/api/account/cartownerGet the active cart for the calling owner.
/api/account/cartownerReplace the active cart's items. Inventory holds for auth users.
Checkout
/api/checkout/submitownerSubmit a checkout. Intents: pay_now, quote_only, po_deposit, po_net_terms.
/api/checkout/quotepublicCompute a totals quote (subtotal + shipping + tax) without submitting.
Orders
/api/orders/guest-lookuppublicMagic-link order lookup for guests (token query param).
/api/orders/by-number/{orderNumber}ownerFetch an order by order_number, owner-gated.
Need full request/response bodies?
Per-endpoint detail pages with curl examples + typed schemas land in a follow-up round. Until then, the source endpoints live under src/app/api/ in the codebase.