Session Lifecycle
Sessions progress through these statuses:- pending: Customer requested access, awaiting staff approval
- active: Staff approved, customer can place orders
- completed: Session ended, table available
- rejected: Staff rejected the session request
Start Table Session
This endpoint is for internal/staff use. Customers should use the
/api/customer endpoints to request access.POST /api/tables/sessions
Create a new table session with a customer token.
Request Body
UUID of the table
Customer’s name (1-255 characters)
Customer’s phone number (max 20 characters)
Response
Indicates if the request was successful
Example
List Sessions
GET /api/tables/sessions
Retrieve sessions for the current branch with optional filtering.
Query Parameters
Filter by status:
pending, active, completed, or rejectedResponse
Indicates if the request was successful
Example
List Pending Sessions
GET /api/tables/sessions/pending
Retrieve all sessions awaiting staff approval.
Response
Indicates if the request was successful
Approve Session
PATCH /api/tables/sessions/:id/approve
Approve a pending session, allowing the customer to place orders.
Path Parameters
Session UUID
Response
Indicates if the request was successful
Updated session object with
active statusExample
Events
Broadcasts WebSocket events:session:approvedto branch channelsession:approvedto session-specific channel
Reject Session
PATCH /api/tables/sessions/:id/reject
Reject a pending session request.
Path Parameters
Session UUID
Response
Indicates if the request was successful
Updated session object with
rejected statusEvents
Broadcasts WebSocket events:session:rejectedto branch channelsession:rejectedto session-specific channel
End Session
PATCH /api/tables/sessions/:id/end
End an active session, freeing the table for new customers.
Path Parameters
Session UUID
Response
Indicates if the request was successful
Updated session object with
completed status and ended_at timestampExample
Events
Broadcastssession:ended to branch channel.
Get Session Details
GET /api/tables/sessions/:id
Retrieve detailed information about a specific session.
Path Parameters
Session UUID
Response
Indicates if the request was successful
Complete session object including all fields
Error Responses
404 NOT_FOUND
Session not found or doesn’t belong to your branch
404 PENDING_SESSION_NOT_FOUND
No pending session found with that ID (for approve/reject)
404 ACTIVE_SESSION_NOT_FOUND
No active session found with that ID (for end)