Skip to content

๐Ÿ“ฆ Ordering โ€‹

The ordering system supports delivery and pickup, guest checkout, scheduled orders, and a complete status lifecycle.

Admin Orders

๐Ÿšš Order Types โ€‹

TypeDescription
DELIVERY๐Ÿ  Order delivered to customer's address
PICKUP๐Ÿช Customer picks up from location

Each location can independently enable/disable delivery and pickup, and set minimum order amounts and lead times.

๐Ÿ”„ Order Status Lifecycle โ€‹

PENDING โ†’ CONFIRMED โ†’ PREPARING โ†’ READY โ†’ DELIVERED / PICKED_UP
                                        โ†˜ CANCELLED (from any status)
StatusDescription
PENDINGโณ Order placed, awaiting confirmation
CONFIRMEDโœ… Staff confirmed the order
PREPARING๐Ÿณ Kitchen is preparing the order
READY๐Ÿ”” Order is ready for pickup or delivery
OUT_FOR_DELIVERY๐Ÿš— Delivery driver is on the way (delivery only)
DELIVERED๐Ÿ“ฌ Order delivered to customer
PICKED_UP๐Ÿค Customer picked up the order
CANCELLEDโŒ Order cancelled

Staff update order status via PATCH /api/orders/:id/status.

๐Ÿ‘ค Guest Checkout โ€‹

Customers can place orders without registering. Guest orders include:

  • ๐Ÿ“› guestName โ€” Customer name
  • ๐Ÿ“ง guestEmail โ€” Email for notifications
  • ๐Ÿ“ฑ guestPhone โ€” Phone number

The optionalAuth middleware allows both authenticated and guest orders on the same endpoint.

๐Ÿ“… Scheduled Orders โ€‹

Set scheduledAt to a future datetime when creating an order. The kitchen can see scheduled orders and prepare them ahead of time.

Storefront Menu

๐Ÿ’ฐ Order Totals โ€‹

FieldDescription
subtotalSum of item prices ร— quantities
deliveryFeeBased on delivery zone
taxCalculated tax amount
discountCoupon discount (if applied)
tipOptional customer tip
totalFinal total

๐Ÿท๏ธ Coupons โ€‹

Apply a coupon code at checkout. The coupon is validated against:

  • ๐Ÿ“… Expiration date
  • ๐Ÿ”ข Usage limits (total and per-customer)
  • ๐Ÿ’ต Minimum order amount
  • โœ… Active status

See Coupons for details.

๐Ÿ“ก Real-Time Updates โ€‹

When an order is created or its status changes, a Socket.IO event is emitted. See Kitchen Display and Real-Time Events.

๐Ÿ”— API โ€‹

See Orders API for the complete endpoint reference.