Skip to content

REST API reference

All endpoints are owned by apps/api, a Hono application on Cloudflare Workers. Owner routes are guarded by a session token stored in the SESSIONS KV namespace; public routes are unauthenticated. Data is persisted to D1 via Drizzle, and realtime traffic is routed through the per-restaurant OrderHub Durable Object.

This is a summarized reference grouped by area. For the realtime streams see realtime: reconnect and snapshots.

Auth

Owner identity and sessions.

MethodPathPurpose
POST/v1/auth/signupSelf-serve owner signup with a mock card. Creates the restaurant and the owner user, returns a session, and deep-links into the onboarding wizard.
POST/v1/auth/loginOwner login. Issues an opaque session token stored in SESSIONS KV and sets a cookie.
POST/v1/auth/logoutInvalidate the current session in KV.
GET/v1/auth/meReturn the current authenticated owner plus restaurant context for the console and KDS.

Public menu

Unauthenticated customer-facing menu read.

MethodPathPurpose
GET/v1/r/:slug/menuPublic customer menu: ordered, non-hidden categories with products, modifiers, sold-out and hidden flags, and the current store open and accepting state. Cached in MENU_CACHE KV and invalidated on owner mutations.

Categories (owner)

Menu category management.

MethodPathPurpose
GET/v1/categoriesList categories in display order.
POST/v1/categoriesCreate a category.
PATCH/v1/categories/:idUpdate name, description, or hidden flag.
DELETE/v1/categories/:idDelete a category.
PATCH/v1/categories/reorderPersist drag-to-reorder display order in one call.

Products (owner)

Menu product management, including the signature 86 toggle.

MethodPathPurpose
GET/v1/productsList products, optionally by category, with hidden and sold-out flags.
POST/v1/productsCreate a product with price, description, and modifiers.
PATCH/v1/products/:idUpdate product fields (price, description, category, modifiers).
DELETE/v1/products/:idDelete a product.
PATCH/v1/products/reorderPersist drag-to-reorder display order.
PATCH/v1/products/:id/sold-outThe 86 toggle. Flip is_sold_out, invalidate the menu cache, and push the update so the item vanishes from the customer portal within seconds.
PATCH/v1/products/:id/visibilityToggle published or hidden.

Media

Image upload.

MethodPathPurpose
POST/v1/media/upload-urlGet a direct upload path to store a product or logo image in R2. Returns the r2_key.

Cart and orders

Stateless pricing, order placement, payment, and KDS state advance.

MethodPathPurpose
POST/v1/cart/priceStateless cart pricing. The client sends items plus modifiers; the server uses packages/core to compute authoritative subtotal, tax, and total and to validate availability before checkout. No server-side cart persistence.
POST/v1/ordersPlace an order from a priced cart. Re-validate availability and price server-side, create the order (status placed) plus the order-items snapshot plus the order_placed event, and return order_number and tracker_token.
POST/v1/orders/:id/payMock payment. Take a card token through the mock processor, create the payment, transition placed to paid, and emit the order_paid event that lights up the KDS, tracker, and receipt pipeline.
POST/v1/orders/:id/transitionsKDS state advance. The body specifies the target (accept, start, ready, complete, cancel); the packages/core state machine guards the transition, appends an order_event with the next seq, and OrderHub fans it out. One endpoint for all forward transitions keeps the spine single-sourced.
GET/v1/ordersKDS and console: list active and recent orders for the restaurant (board hydration on load).
GET/v1/orders/:idFull order detail with items, events, payment, and receipt.

Customer tracker and realtime

Public order tracking plus the two realtime streams. See realtime: reconnect and snapshots for the snapshot and reconnect semantics.

MethodPathPurpose
GET/v1/track/:trackerTokenPublic customer tracker snapshot: current status plus timestamps for the shareable status URL.
GET/v1/track/:trackerToken/streamCustomer-facing SSE stream of order status events for one order, served via OrderHub. Sends a snapshot, then incremental events, deduplicated by seq on reconnect.
GET/v1/kds/streamKDS WebSocket or SSE upgrade to OrderHub for the restaurant. Snapshot of open tickets on connect, then ordered incremental order events. The client acks its last seq so reconnect replays only the gap, with no dropped or duplicated tickets.

Settings

Restaurant settings, the kill switch, and opening hours.

MethodPathPurpose
GET/v1/settingsRead restaurant settings (accepting orders, tax, ETA, KDS age threshold).
PATCH/v1/settingsUpdate settings.
PATCH/v1/settings/accepting-ordersMaster kill switch. Toggle accepting orders; immediately reflected on the customer portal so new orders pause when the kitchen is slammed.
GET/v1/settings/hoursRead the weekly opening-hours schedule.
PUT/v1/settings/hoursReplace the weekly opening-hours schedule.

Receipts and export

The fixed receipt template, generated receipts, and owner data export.

MethodPathPurpose
GET/v1/receipt-templateRead the fixed receipt template (header, footer, show-logo). The template editor is deferred to V1.1.
PATCH/v1/receipt-templateUpdate the limited fixed-template fields (header text, footer text, logo on or off).
GET/v1/orders/:id/receiptFetch the generated fixed-format receipt (HTML or JSON) for render or browser-print on the KDS. Generated on Accept from the order event.
GET/v1/exportOwner data export. Downloadable menu, customer order history, and receipts as JSON or CSV. The no-lock-in story.