Skip to main content

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.

Categories group products on the order form and, crucially, determine which preparation queue each item enters. A category’s slug field is the routing key: the reserved values cafes and bebidas direct items to the Barista queue, while mesas is excluded from all queues entirely. Every other slug routes items to the Kitchen queue. All write endpoints are restricted to Admin accounts (rol_id = 1).

Create Category

POST /public/api/nuevaCategoria.php Creates a new product category. If slug is omitted or sent as an empty string, the API automatically generates one from the nombre value (lowercased, spaces replaced with hyphens). Both nombre and slug must be unique across all categories.

Request Parameters

nombre
string
required
Human-readable category name shown in the admin UI and on order forms (e.g. Cafés, Postres).
slug
string
URL-safe identifier used for routing and product filtering. Auto-generated from nombre when left blank. Must be unique. Do not use cafes, bebidas, or mesas for new categories unless you intend the associated routing behaviour.
icono
string
Font Awesome icon class for this category. Defaults to fa-tags.
orden
integer
Display sort order on the order form tab bar. Defaults to 1.
activo
integer
Checkbox value — 1 to show the category on order forms, 0 (or omit) to create it as hidden.

Responses

OutcomeRedirect
Successviews/admin/productos.php?categoryCreated=1
Validation failure (duplicate nombre or slug)Back to form with error details

Example Request

curl -b 'PHPSESSID=...' \
  -X POST \
  -F 'nombre=Postres' \
  -F 'slug=postres' \
  -F 'icono=fa-ice-cream' \
  -F 'orden=4' \
  -F 'activo=1' \
  'http://localhost:8080/public/api/nuevaCategoria.php'

Edit Category

POST /public/api/editarCategoria.php Updates an existing category. Supply the category id along with every field you want to change; omitted fields are reset to their default values, so always include the full current state.
Renaming the slug away from cafes or bebidas will break barista queue routing for all products in those categories. Existing pending orders may be misrouted until the slug is restored or the affected products are reassigned.

Request Parameters

id
integer
required
ID of the category to update.
nombre
string
Updated category name. Must remain unique.
slug
string
Updated routing slug. Must remain unique. See Routing Slug Rules before changing.
icono
string
Updated Font Awesome icon class.
orden
integer
Updated sort position.
activo
integer
1 to activate, 0 to deactivate.

Responses

OutcomeRedirect
Successviews/admin/productos.php?categoryUpdated=1

Example Request

curl -b 'PHPSESSID=...' \
  -X POST \
  -F 'id=3' \
  -F 'nombre=Postres' \
  -F 'slug=postres' \
  -F 'icono=fa-ice-cream' \
  -F 'orden=4' \
  -F 'activo=1' \
  'http://localhost:8080/public/api/editarCategoria.php'

Delete Category

POST /public/api/eliminarCategoria.php Permanently deletes a category. Deletion is blocked if any products are still associated with the category; reassign or delete those products first.

Request Parameters

id
integer
required
ID of the category to delete.

Responses

OutcomeRedirect
Successviews/admin/productos.php?categoryDeleted=1
Category has associated productsRedirect with error message

Example Request

curl -b 'PHPSESSID=...' \
  -X POST \
  -F 'id=3' \
  'http://localhost:8080/public/api/eliminarCategoria.php'

Routing Slug Rules

The slug field on each category is the sole mechanism that determines which preparation station receives an order item. The routing logic is evaluated when an order is submitted and cannot be overridden per-item.
SlugQueue
cafesBarista
bebidasBarista
mesasIgnored — never appears in any queue
Any other value (e.g. comidas, postres)Kitchen
When creating a new hot-drinks sub-category (e.g. tés, chocolates), assign it a distinct slug and ensure you have a workflow for routing — it will default to Kitchen unless you extend the routing logic in the application.
The mesas category is reserved for table-charge line items. Products assigned to it will never appear in the kitchen or barista queues and will return an empty array from listarProductos.php.

Build docs developers (and LLMs) love