The Tables API manages the physical tables in the restaurant. Each table tracks its current occupancy state and seating capacity. Table states are updated automatically by the Orders API when orders are created or completed — staff can also update them manually through the PATCH endpoint. All endpoints require a valid JWT in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/FloresJesus/SS_RESTAURANT/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer <token> header.
Endpoint overview
| Method | Path | Description |
|---|---|---|
GET | /api/tables | List all tables with active-order flag |
GET | /api/tables/disponibles | List tables currently in libre state |
GET | /api/tables/:id | Get a single table by ID |
POST | /api/tables | Create a new table |
PUT | /api/tables/:id | Full update (number, capacity, and state) |
PATCH | /api/tables/:id/estado | Update table state only |
DELETE | /api/tables/:id | Delete a table |
Table object
Unique table identifier.
Human-readable table number displayed on the floor plan (e.g.
5).Maximum number of seated guests.
Current occupancy state. One of:
libre— table is empty and available.ocupada— table has an active order in progress.mantenimiento— table is out of service.
The
tiene_pedido_activo boolean flag is only present on responses from GET /api/tables. It is not returned by GET /api/tables/:id or GET /api/tables/disponibles. See the GET /api/tables section for details.GET /api/tables
Returns all tables ordered by table number ascending. Each table object includes the computedtiene_pedido_activo flag indicating whether the table has an open order today.
true when at least one order for this table has estado_servicio of pendiente, preparando, or listo and was created today. Computed at query time — not stored in the database. Only present on the list response.Example table object (list response)
GET /api/tables/disponibles
Returns only tables whoseestado is currently libre. Useful for quickly building a table-picker UI for new orders or walk-in reservations. Response objects contain id, numero, capacidad, and estado — the tiene_pedido_activo flag is not included.
This endpoint does not cross-check existing reservations. To find tables free during a specific time window, use the reservations availability endpoint:
GET /api/reservations/mesas-disponibles.GET /api/tables/:id
Returns a single table by ID. The response containsid, numero, capacidad, and estado. The tiene_pedido_activo flag is not included in single-record responses. Returns 404 if the table does not exist.
POST /api/tables
Creates a new table. The new table is created inlibre state by default.
Request body
Table number. Must be unique — attempting to create a duplicate returns
400 El numero de mesa ya existe.Seating capacity. Must be a positive integer.
Example request
Example response
PUT /api/tables/:id
Performs a full replacement update on a table record. All three body fields are required.Request body
New table number.
New seating capacity.
New state. Must be one of
libre, ocupada, or mantenimiento.PATCH /api/tables/:id/estado
Updates only theestado field of a table. Ideal for quick status changes from the floor-plan view without sending the full table payload.
Request body
Must be one of
libre, ocupada, or mantenimiento. Any other value returns 400 Estado invalido.Example request
Example response
DELETE /api/tables/:id
Permanently deletes a table record. Returns404 if the table does not exist.
Automatic state transitions
You do not need to call
PATCH /api/tables/:id/estado during normal order flow. The Orders API manages table states automatically:- Creating an order (
POST /api/orders) sets the linked table’sestadotoocupada. - Updating order status to
deliveredorcancelledsets the table’sestadoback tolibre.
PATCH /api/tables/:id/estado only when you need to override state manually — for example, placing a table under mantenimiento for cleaning, or recovering from an interrupted workflow.