Skip to main content
The Orders API allows you to create and manage orders for dine-in, takeout, and delivery. Orders flow through a defined status workflow and support real-time updates via WebSocket.

Order Workflow

Orders progress through the following statuses:
1

pending

Order has been created and is awaiting confirmation
2

confirmed

Order has been confirmed and is queued for preparation
3

preparing

Kitchen is actively preparing the order
4

ready

Order is ready for pickup or serving
5

served

Order has been served to the customer
6

completed

Order is complete and paid (triggers loyalty points and inventory deduction)
Orders can be cancelled from pending, confirmed, or preparing status.

Order Types

  • dine_in - Customer dining at a table
  • takeout - Customer picking up order
  • delivery - Order will be delivered to customer

Authentication

All endpoints require authentication using a Bearer token in the Authorization header:
Authorization: Bearer YOUR_ACCESS_TOKEN

Permissions

Different roles have different access levels:
  • Create orders: orders:create (waiter, cashier, branch_manager, org_admin)
  • Read orders: orders:read (waiter, cashier, kitchen, branch_manager, org_admin)
  • Update orders: orders:update (waiter, cashier, branch_manager, org_admin)
  • Update item status: orders:update_item_status (kitchen staff)

WebSocket Events

When orders are created or updated, the system broadcasts events to relevant WebSocket channels:
  • branch:{branchId} - All branch staff
  • branch:{branchId}:kitchen - Kitchen display systems
  • session:{sessionId} - Customer apps (when order has a table session)
See Kitchen API for WebSocket event details.

Base URL

https://api.restai.com/api/orders

Available Endpoints

Create Order

POST /api/orders

Update Status

PATCH /api/orders/:id/status

Build docs developers (and LLMs) love