The Products API provides full lifecycle management for menu items. Waitstaff can retrieve products filtered by category slug to populate order forms, while administrators can create new items, update prices or icons, and remove products that are no longer offered. All endpoints require an active PHP session; write operations are further restricted to accounts withDocumentation 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.
rol_id = 1 (Admin).
List Products
Available to any authenticated user. Returns only active products (
activo = 1) matching the given category slug.GET /public/api/listarProductos.php
Returns the list of active products belonging to the specified category. Passing categoria=mesas always returns an empty array because the mesas category is used solely for table-charge line items and contains no orderable products.
Query Parameters
The URL slug of the category to filter by (e.g.
cafes, bebidas, comidas). Use categoria=mesas to intentionally receive an empty product list.Response
Always
"OK" on success.Array of product objects matching the requested category.
Unique product identifier.
Display name of the product.
Unit price in the local currency (decimal).
Font Awesome icon class used to represent this product in the UI (e.g.
fa-mug-hot).Example Request
Create Product
POST /public/api/nuevoProducto.php
Creates a new product and associates it with a category. On success the browser is redirected to the admin products view. Validation errors are written to the PHP session so the form page can display them without losing user input.
Request Parameters
Database ID of the category this product belongs to.
Display name for the product.
Unit price. Accepts integer or decimal values (e.g.
1800 or 1800.50).Font Awesome icon class. Defaults to
fa-mug-hot when omitted.Checkbox value —
1 to make the product visible to staff, 0 (or omit) to create it as inactive.Responses
| Outcome | Redirect |
|---|---|
| Success | views/admin/productos.php?created=1 |
| Validation failure | Back to form; errors in $_SESSION["nuevo_producto_errors"] |
Example Request
Edit Product
POST /public/api/editarProducto.php
Updates an existing product record. You must supply the product id; all other fields overwrite the stored values, so include every field you wish to keep unchanged.
Request Parameters
ID of the product to update.
New category assignment for this product.
Updated product name.
Updated unit price.
Updated Font Awesome icon class.
1 to mark active, 0 to deactivate (hides from order forms).Responses
| Outcome | Redirect |
|---|---|
| Success | views/admin/productos.php?updated=1 |
Example Request
Delete Product
POST /public/api/eliminarProducto.php
Permanently removes a product from the catalog. If the product is referenced by any order detail record, the database foreign-key constraint prevents deletion and the endpoint redirects with an error message.
Request Parameters
ID of the product to delete.
Responses
| Outcome | Redirect |
|---|---|
| Success | views/admin/productos.php?deleted=1 |
| FK constraint or other error | views/admin/productos.php?error=<message> |