Start Table Session
POST /api/customer/:branchSlug/:tableCode/session
Request access to a table by creating a pending session. This is similar to /register but with simpler parameters.
This endpoint is public and does not require authentication.
URL Parameters
Branch slug identifier (e.g.,
downtown-lima)Unique table QR code in format
{branchSlug}-{tableNumber}Request Body
Customer’s full name (1-255 characters)
Customer’s phone number (optional, max 20 characters)
Response
Indicates if the request was successful
Example
Check Session Status
GET /api/customer/:branchSlug/:tableCode/check-session
Check if a table currently has an active or pending session. Useful for UI flows to determine if the customer should join an existing session or create a new one.
This endpoint is public and does not require authentication.
URL Parameters
Branch slug identifier
Unique table QR code
Response
Always
truetrue if table has an active or pending sessionSession status:
active or pending. Only present when hasSession is true.Session UUID. Only present when
hasSession is true.Name of the customer who started the session. Only present when
hasSession is true.Examples
No Active SessionPoll Session Status
GET /api/customer/:branchSlug/:tableCode/session-status/:sessionId
Poll the approval status of a specific session. Use this to check if staff has approved or rejected your request.
This endpoint is public and does not require authentication.
URL Parameters
Branch slug identifier
Unique table QR code
Session UUID from the registration response
Response
Indicates if the request was successful
Example
Customer Approval Workflow
1. Customer Scans QR Code
The QR code contains:https://app.restai.com/{branchSlug}/{tableCode}
2. Check Existing Session
- If
hasSession: false→ Proceed to step 3 - If
hasSession: trueandstatus: active→ Join existing session - If
hasSession: trueandstatus: pending→ Show “waiting for approval” message
3. Request Access
- Session ID
- Customer token
- Pending status
4. Wait for Approval
Option A: WebSocket (Recommended) Connect to WebSocket and subscribe tosession:{sessionId} channel:
status changed to active or rejected.
5. Session Approved
When status becomesactive:
- Store the customer token
- Navigate to menu
- Use token for all subsequent requests
6. Place Orders
Use the customer token:Error Responses
404 NOT_FOUND
Branch, table, or session not found
409 SESSION_PENDING
Table already has a pending session
Staff Approval Process
On the staff side:- Notification: Staff receives WebSocket event
session:pending - Review: Staff views pending session with customer details
- Action: Staff approves via
PATCH /api/tables/sessions/:id/approveor rejects viaPATCH /api/tables/sessions/:id/reject - Broadcast: System broadcasts approval/rejection to customer via WebSocket
Security Notes
- Customer tokens expire after 4 hours (configurable)
- Tokens are scoped to specific table and session
- Once session ends, token becomes invalid
- Customer tokens have
role: "customer"and limited permissions