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 Menu API exposes the live, orderable product catalogue to any authenticated user, regardless of role. It is the primary data source for the customer cart and the operator’s order-creation screen. Unlike the admin-facing /api/products endpoint, GET /api/menu applies three visibility filters automatically: the category must be active, the product must be active, and the product must have at least one unit in stock. The response contains two top-level arrays — categories and products — so that front-end clients can render a categorised menu without additional requests.

GET /api/menu

Returns all active, in-stock products alongside their active categories. Auth required: Yes — any authenticated user (all roles)

Request body

None.

Query parameters

None.

Response 200 OK

categories
array
An array of active category objects filtered from the full CATEGORIAS table.
products
array
An array of active, in-stock product objects that belong to an active category. Each object is sourced from a JOIN between PRODUCTOS and CATEGORIAS.
curl -X GET https://api.ordervista.com/api/menu \
  -H "Authorization: Bearer <token>"
{
  "categories": [
    {
      "id_categoria": 1,
      "nombre": "Hamburguesas",
      "descripcion": "Hamburguesas artesanales de res y pollo",
      "activo": true
    },
    {
      "id_categoria": 2,
      "nombre": "Bebidas",
      "descripcion": null,
      "activo": true
    }
  ],
  "products": [
    {
      "id_producto": 1,
      "nombre": "Hamburguesa Clásica",
      "descripcion": "Carne 200g, lechuga, tomate",
      "precio": 8500.00,
      "stock": 50,
      "imagen": "https://example.com/img.jpg",
      "activo": true,
      "id_categoria": 1,
      "categoria": "Hamburguesas"
    },
    {
      "id_producto": 4,
      "nombre": "Agua Mineral",
      "descripcion": null,
      "precio": 1200.00,
      "stock": 100,
      "imagen": null,
      "activo": true,
      "id_categoria": 2,
      "categoria": "Bebidas"
    }
  ]
}
Only products that satisfy all three of the following conditions are included in the response:
  1. The product’s activo flag is true.
  2. The product’s parent category has activo = true.
  3. The product’s stock is greater than 0.
Products that are inactive, belong to an inactive category, or have zero stock are silently excluded. Use GET /api/products (Administrator only) to view the complete, unfiltered product list.

Error responses

StatusmensajeCause
401"Token no proporcionado" / "Token inválido"Missing or invalid JWT.
500"Error al obtener el menú"Unexpected server-side error.

Build docs developers (and LLMs) love