The Tables API covers two distinct concerns: real-time occupancy status, which any authenticated staff member can read to know which tables are free, and floor-plan layout management, which lets administrators position table icons on the dining-room canvas. Layout coordinates are stored as viewport percentages so the floor plan scales correctly across different screen sizes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JAQA20/LaComanda/llms.txt
Use this file to discover all available pages before exploring further.
Get Table Status
GET /public/api/estadoMesas.php
Returns the current occupancy state of every table. Available to any authenticated user. The response is a map keyed by table number (as a string) where each value contains at least an estado field and, when occupied, the associated order number.
Response
Always
"OK" on success.Map of table numbers (string keys) to their current status objects.
Occupancy state. One of
"disponible" (free) or "ocupada" (occupied with an open order).Order number associated with the table. Only present when
estado = "ocupada".Example Request
Get Floor Layout
GET /public/api/layoutMesas.php
Returns the saved floor-plan positions for all table icons. Any authenticated user can read the layout; only admins can modify it. The isAdmin flag in the response controls whether the drag-and-drop editor is enabled in the front end.
Response
Always
"OK" on success.Map of table identifiers (e.g.
"mesa-1") to position objects.Horizontal position as a percentage of the canvas width (0 – 100).
Vertical position as a percentage of the canvas height (0 – 100).
true when the requesting session has rol_id = 1, enabling the drag-and-drop editor in the UI.Example Request
Save Floor Layout
POST /public/api/layoutMesas.php
Persists new positions for all table icons. Requires rol_id = 1 (Admin). The request body must be JSON; left and top values are accepted as any number but are clamped to the range −2 .. 98 before saving, preventing tables from being positioned entirely off-canvas.
Request Body
Map of table identifiers to position objects. Each key should follow the
"mesa-{number}" naming convention used by the front end.Desired horizontal position as a percentage of canvas width. Clamped to
−2 .. 98.Desired vertical position as a percentage of canvas height. Clamped to
−2 .. 98.Responses
| HTTP Status | Condition |
|---|---|
200 OK | Layout saved successfully |
403 Forbidden | Requesting session does not have rol_id = 1 |
422 Unprocessable Entity | items is missing or not a valid object/array |
Example Request
Reset Floor Layout
DELETE /public/api/layoutMesas.php
Discards the saved layout and restores all table icons to their default positions. Requires rol_id = 1 (Admin).
The default layout is defined in the application source. After a reset, the next GET request will return the built-in default positions and staff will see the default arrangement immediately on their next page load.