La Comanda operates two parallel preparation queues: the Kitchen queue for food and non-beverage items, and the Barista queue for coffee and drink items. Queue assignment is determined automatically by each product’s category slug at the moment an order is submitted. Both queues expose an identical two-action workflow —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.
preparacion (start preparing) and lista (mark as ready) — through their respective action endpoints. Kitchen endpoints require rol_id = 3 (Cocina) or rol_id = 1 (Admin); Barista endpoints require rol_id = 4 (Barista) or rol_id = 1 (Admin).
Get Kitchen Orders
GET /public/api/obtenerOrdenes.php
Returns all open kitchen orders — those containing at least one non-barista item that has not yet reached the entregado (delivered) state. Accessible to Admin (rol_id = 1) and Kitchen (rol_id = 3).
Response
true on success, false if an error occurred retrieving orders.Array of order objects with pending kitchen items.
Internal database ID of the order record.
Human-facing order number displayed on kitchen tickets and receipts.
Table label (e.g.
"Mesa 3").Free-text notes entered by the waiter at order time (may be an empty string).
Overall order state derived from its items:
pendiente, en_preparacion, or listo.Array of kitchen line items belonging to this order.
ID of the order detail record, used for granular item-level updates.
Product name.
Quantity ordered.
Item-level preparation state:
pendiente, en_preparacion, listo, or entregado.Example Request
Kitchen Action
POST /public/api/cocinaAccion.php
Advances the preparation state of all kitchen items in a given order. Supports both traditional HTML form POST and AJAX requests. The endpoint detects AJAX calls by checking for the X-Requested-With: XMLHttpRequest header or an Accept: application/json header, and adjusts its response format accordingly.
Request Parameters
The human-facing order number (not the internal
id_orden).The action to perform. Accepted values:
preparacion— transitions allpendientekitchen items in the order toen_preparacionand recordsfecha_inicio_preparacion.lista— transitions allpendienteanden_preparacionkitchen items tolisto.
Action State Transitions
| Action | Source States | Target State | Side Effect |
|---|---|---|---|
preparacion | pendiente | en_preparacion | Sets fecha_inicio_preparacion timestamp |
lista | pendiente, en_preparacion | listo | — |
Responses
AJAX response (JSON):views/cocina.php.
Example AJAX Request
Get Barista Orders
GET /public/api/baristaEstado.php
Returns the current state of all barista orders, split into two lists: items still requiring action, and recently delivered items. Accessible to Admin (rol_id = 1) and Barista (rol_id = 4).
Response
true on success.Orders with at least one barista item in
pendiente or en_preparacion state.Up to the 20 most recently delivered barista orders (all items in
listo or entregado state). Displayed on the barista screen as a recent-history reference.The
listas array is capped at 20 entries to keep the barista display uncluttered during long service periods. Older delivered orders remain in the database but are not returned by this endpoint.Example Request
Barista Action
POST /public/api/baristaAccion.php
Advances the preparation state of all barista items (cafes and bebidas category slugs) in a given order. Always returns a JSON response.
Request Parameters
The human-facing order number.
The action to perform:
preparacion— transitions allpendientebarista items toen_preparacion.lista— transitions allpendienteanden_preparacionbarista items tolisto.
Action State Transitions
| Action | Source States | Target State |
|---|---|---|
preparacion | pendiente | en_preparacion |
lista | pendiente, en_preparacion | listo |
Response
Example Request
Barista vs Kitchen Item Routing
Every order item is routed to exactly one queue based on theslug of the category its product belongs to. This routing is applied when the order is first created and does not change if the category slug is later edited.
| Category Slug | Queue |
|---|---|
cafes | Barista |
bebidas | Barista |
mesas | Ignored — never appears in any queue |
comidas, postres, especialidades, etc. | Kitchen |