The Inventory API tracks stock levels for each product at each bakery location. Every record links a product (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/luisllatas-dev/Proyecto_Pasteleria_DonMamino/llms.txt
Use this file to discover all available pages before exploring further.
id_producto) to a location (id_sede) and stores both the current quantity on hand and the minimum acceptable quantity. When cantidad_actual falls below cantidad_minima, the system considers the product eligible for a restocking alert. All five endpoints require a valid JWT Bearer token.
GET /api/inventario
Returns a list of all inventory records across all products and locations. Auth required: YesResponse fields
Unique identifier for the inventory record.
ID of the product this record tracks. References the
Productos table.ID of the bakery location where this stock is held. References the
Sedes table.Current quantity of the product available at this location.
Minimum quantity threshold. When
cantidad_actual drops below this value, the product should be restocked.Example response
In the example above, the second record has
cantidad_actual (12) below cantidad_minima (15), indicating that product 7 at location 2 needs restocking.GET /api/inventario/:id
Returns a single inventory record by its unique ID. Auth required: YesPath parameters
The
id_inventario of the record to retrieve.Response fields
Unique identifier for the inventory record.
ID of the product this record tracks.
ID of the bakery location where this stock is held.
Current quantity available at this location.
Minimum quantity threshold before a restocking alert is triggered.
Example response
Error responses
| Status | Description |
|---|---|
404 | No record found with the given ID. Response body: { "message": "Registro de inventario no encontrado" } |
500 | Internal server error. |
POST /api/inventario
Creates a new inventory record for a product at a specific location. Auth required: YesRequest body
ID of the product to track. Must reference an existing record in the
Productos table.ID of the bakery location where the stock is held. Must reference an existing record in the
Sedes table.Initial stock quantity available at this location.
Minimum quantity threshold. When
cantidad_actual falls below this value, the product is flagged for restocking.Response fields
The auto-generated
id_inventario of the newly created record.Confirmation message:
"Registro de inventario creado exitosamente".Example response
PUT /api/inventario/:id
Updates all fields of an existing inventory record. All body fields must be provided. Auth required: YesPath parameters
The
id_inventario of the record to update.Request body
Updated product ID for this inventory record.
Updated location ID for this inventory record.
Updated current stock quantity.
Updated minimum quantity threshold.
Response fields
Confirmation message:
"Registro de inventario actualizado exitosamente".Example response
Error responses
| Status | Description |
|---|---|
404 | No record found with the given ID. Response body: { "message": "Registro de inventario no encontrado" } |
500 | Internal server error. |
DELETE /api/inventario/:id
Permanently deletes an inventory record. Auth required: YesPath parameters
The
id_inventario of the record to delete.Response fields
Confirmation message:
"Registro de inventario eliminado exitosamente".Example response
Error responses
| Status | Description |
|---|---|
404 | No record found with the given ID. Response body: { "message": "Registro de inventario no encontrado" } |
500 | Internal server error. |