Dining table management in CafeteriaPM is dynamic — a table’s status is derived in real time from whether it has an active order. There is no separate status column on theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/123048152-JJDS/CafeteriaPM_S203/llms.txt
Use this file to discover all available pages before exploring further.
mesas table; instead, every time table data is requested, the API queries the pedidos table to determine the current occupancy state. This means table status is always consistent with the order system and cannot drift out of sync.
Table Status
EachMesaOut response object includes a computed estado field with one of three values:
| Status | Meaning |
|---|---|
disponible | No active orders are linked to this table |
ocupada | The table has an active order in pendiente, en_preparacion, listo, or entregado state |
reservada | The table has an order in the special reservado state |
MesaOut also includes pedido_activo_id — the ID of the active order, or null if the table is disponible. Use this ID to quickly navigate to the relevant order without a separate lookup.
Table Endpoints
Listing Tables
GET /mesas/ returns all tables with their live computed status. Any authenticated user.
Get by Number
GET /mesas/por-numero/{numero} looks up a table by its human-readable display number rather than the internal database ID. Useful for POS interfaces where staff navigate by table number. Any authenticated user.
404 if no table with that display number exists.
Get by ID
GET /mesas/{mesa_id} looks up a table by its internal ID. Any authenticated user.
Creating Tables
POST /mesas/ (admin only) — Creates a new dining table. Returns 400 if a table with the same numero already exists.
| Field | Type | Description |
|---|---|---|
numero | integer | The display number shown to staff (must be unique) |
capacidad | integer | Seat capacity (must be > 0) |
Deleting Tables
DELETE /mesas/{id} (admin only) — Permanently removes a table. Returns 400 if the table is currently ocupada or reservada, including the active order ID in the error message so staff can resolve it first. Also blocked if the table has any historical orders associated with it.
Occupancy Operations
These action endpoints drive the table lifecycle during a shift.Occupy a Table
PATCH /mesas/{id}/ocupar (admin, mesero)
Creates an empty pendiente order on the table as a placeholder. Returns 400 if the table already has an active order.
Release a Table
PATCH /mesas/{id}/liberar (admin, mesero, caja)
Forces the table’s active order to pagado state, bypassing the normal payment flow. Use this when a table needs to be cleared without processing a formal sale — for example, if a customer leaves without paying and the table needs to be freed for the next party. The transition is recorded in historial_estados_pedido.
Returns 400 if the table has no active order.
Reserve a Table
PATCH /mesas/{id}/reservar (admin, mesero)
Creates an order in the reservado state on the table. This marks the table as reserved without starting an active order. Returns 400 if the table is not currently disponible — you cannot reserve an occupied table.
Cancel a Reservation
PATCH /mesas/{id}/cancelar-reserva (admin, mesero)
Cancels the active reservation by transitioning the placeholder order to cancelado. Returns 400 if the table has no active reservation. After cancellation, GET /mesas/ will show the table as disponible.