Categories group products on the order form and, crucially, determine which preparation queue each item enters. A category’sDocumentation 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.
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
Human-readable category name shown in the admin UI and on order forms (e.g.
Cafés, Postres).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.Font Awesome icon class for this category. Defaults to
fa-tags.Display sort order on the order form tab bar. Defaults to
1.Checkbox value —
1 to show the category on order forms, 0 (or omit) to create it as hidden.Responses
| Outcome | Redirect |
|---|---|
| Success | views/admin/productos.php?categoryCreated=1 |
| Validation failure (duplicate nombre or slug) | Back to form with error details |
Example Request
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.
Request Parameters
ID of the category to update.
Updated category name. Must remain unique.
Updated routing slug. Must remain unique. See Routing Slug Rules before changing.
Updated Font Awesome icon class.
Updated sort position.
1 to activate, 0 to deactivate.Responses
| Outcome | Redirect |
|---|---|
| Success | views/admin/productos.php?categoryUpdated=1 |
Example Request
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 of the category to delete.
Responses
| Outcome | Redirect |
|---|---|
| Success | views/admin/productos.php?categoryDeleted=1 |
| Category has associated products | Redirect with error message |
Example Request
Routing Slug Rules
Theslug 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.
| Slug | Queue |
|---|---|
cafes | Barista |
bebidas | Barista |
mesas | Ignored — never appears in any queue |
Any other value (e.g. comidas, postres) | Kitchen |
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.