Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ytabeloved/ordervista/llms.txt

Use this file to discover all available pages before exploring further.

The Commands API exposes the COMANDAS table — kitchen tickets that are automatically generated when an order is placed. A comanda groups an order’s full detail (items, quantities, notes) into a single record that kitchen staff can read from a display or printed slip. Both endpoints are read-only and restricted to Administrator (role 1) and Operator (role 2) users; customers cannot access this resource. All requests require a valid JWT in the Authorization header.

GET /api/commands

Returns all kitchen commands in the system, each joined with its parent order, customer, and a summarised item list. Use this endpoint to power a kitchen display or a live ticket queue in the operator panel. Auth required: Yes — role 1 (Admin) or 2 (Operator)

Response

Array of flat COMANDAS rows joined with order, customer, and item data.
[].id_comanda
integer
Unique kitchen command identifier (primary key of COMANDAS).
[].id_pedido
integer
The order this command belongs to. One-to-one: each order produces exactly one comanda.
[].fecha_generacion
string
ISO 8601 datetime the command was generated.
[].observacion
string | null
Kitchen note carried over from the order (e.g. "Sin cebolla").
[].id_estado
integer
Current status code of the parent order (14).
[].id_tipo_pedido
integer
Order type of the parent order (1 = Delivery, 2 = Retiro, 3 = Consumo Local).
[].total
number
Total value of the parent order.
[].fecha_pedido
string
ISO 8601 datetime the parent order was placed.
[].cliente_nombre
string
Full name of the customer who placed the order.
[].cliente_email
string
Email address of the customer who placed the order.
[].total_items
integer
Count of distinct line items in the order.
[].items_text
string | null
Pipe-separated summary of all line items (e.g. "2x Hamburguesa Clásica||1x Papas Fritas").
curl https://ordervista-backend.onrender.com/api/commands \
  -H "Authorization: Bearer <token>"

Error responses

Statusmensaje
401Unauthorized — missing or invalid token
403Forbidden — insufficient role
500"Error al obtener las comandas"

GET /api/commands/:id

Returns a single kitchen command with full order detail, including every product line item. Returns 404 if no command with the given ID exists. Auth required: Yes — role 1 (Admin) or 2 (Operator)

Path parameters

id
integer
required
The numeric ID of the kitchen command (id_comanda) to retrieve.

Response

A flat object with the comanda’s own fields, the parent order’s summary fields, customer info, and an items array.
id_comanda
integer
Unique kitchen command identifier.
id_pedido
integer
Parent order ID.
fecha_generacion
string
ISO 8601 datetime the command was generated.
observacion
string | null
Kitchen note for this command.
id_estado
integer
Current status code of the parent order (14).
id_tipo_pedido
integer
Order type of the parent order (1 = Delivery, 2 = Retiro, 3 = Consumo Local).
total
number
Total value of the parent order.
fecha_pedido
string
ISO 8601 datetime the parent order was placed.
cliente_nombre
string
Full name of the customer who placed the order.
cliente_email
string
Email address of the customer who placed the order.
items
array
Line items for the order. Each entry contains id_detalle, id_producto, nombre, descripcion, cantidad, precio_unitario, and subtotal.
curl https://ordervista-backend.onrender.com/api/commands/5 \
  -H "Authorization: Bearer <token>"

Sample response

{
  "id_comanda": 5,
  "id_pedido": 12,
  "fecha_generacion": "2025-01-15T14:30:00.000Z",
  "observacion": "Sin cebolla",
  "id_estado": 2,
  "id_tipo_pedido": 1,
  "total": 17000.00,
  "fecha_pedido": "2025-01-15T14:29:50.000Z",
  "cliente_nombre": "María González",
  "cliente_email": "maria@example.com",
  "items": [
    {
      "id_detalle": 18,
      "id_producto": 3,
      "nombre": "Hamburguesa Clásica",
      "descripcion": "Carne, lechuga, tomate y mayonesa",
      "cantidad": 2,
      "precio_unitario": 8500.00,
      "subtotal": 17000.00
    }
  ]
}

Error responses

Statusmensaje
401Unauthorized — missing or invalid token
403Forbidden — insufficient role
404"Comanda no encontrada"
500"Error al obtener el detalle de la comanda"

Build docs developers (and LLMs) love