Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/teofilobetancourt/Tradiciones-y-Sabores/llms.txt

Use this file to discover all available pages before exploring further.

The Inventory API manages the Inventario.Insumos table — the master list of every raw supply or ingredient the kitchen relies on. Each insumo record tracks its current stock level, a safety minimum, and a reorder point that signals when a new purchase order is needed. The API is intentionally flexible: all write endpoints accept both camelCase (nombre, stock, unidad) and PascalCase (Nombre_Insumo, Stock_Actual, Unidad_Medida) field names, so integrations written against either convention work without modification.

GET /api/inventario

Returns the complete list of supply items, ordered alphabetically by Nombre_Insumo. No filtering or pagination is applied — all records are returned in a single response.

Response

Returns an array of insumo objects. Each object contains both a camelCase alias and its original PascalCase database column name for every field.
id_inventario
integer
Supply item ID, mirrored from ID_Insumos. Use this value as the id_inventario path parameter in PUT and DELETE requests.
ID_Insumos
integer
Primary key of the record in the Inventario.Insumos table. Same value as id_inventario.
nombre
string
Supply item name in camelCase alias form, e.g. "Harina de maíz". Same value as Nombre_Insumo.
Nombre_Insumo
string
Supply item name as stored in the database column.
stock
number
Current stock level as a floating-point number, e.g. 24.5. Same value as Stock_Actual. Stored with up to 4 decimal places.
Stock_Actual
number
Current stock level from the database column.
unidad
string
Unit of measurement abbreviation, e.g. "Kg", "L", "und". Same value as Unidad_Medida.
Unidad_Medida
string
Unit of measurement as stored in the database column.
precio_costo
number
Always returns 0.0 in the current implementation. Cost pricing is not tracked at the insumo level in this version of the API.
stock_minimo
number
Minimum safe stock level. If stock drops below this value, operations should initiate a restock. Same value as Stock_Minimo.
Stock_Minimo
number
Minimum safe stock level from the database column.
Punto_Reorden
number
The stock level at which a purchase order should be triggered, typically Stock_Minimo × 1.5. No camelCase alias is provided for this field.
Every response object contains both camelCase and PascalCase versions of the same field (e.g. nombre and Nombre_Insumo, stock and Stock_Actual). This dual-key format is intentional and ensures backward compatibility with clients built against either naming convention. The values in each pair are always identical.
curl -X GET http://localhost:5000/api/inventario \
  -H "Accept: application/json"

POST /api/inventario

Creates a new supply item in the inventory. The endpoint accepts either camelCase or PascalCase key names for all fields — use whichever convention matches your client. Punto_Reorden defaults to stock_minimo × 1.5 if not explicitly provided. Response status: 201 Created

Request Body

nombre
string
required
Name of the supply item. Also accepted as Nombre_Insumo. Maximum 100 characters, must be unique. Defaults to "Insumo Nuevo" if omitted entirely, though providing a meaningful name is strongly recommended.
unidad
string
required
Unit of measurement for this supply. Also accepted as Unidad_Medida. Maximum 20 characters. Common values are "Kg", "g", "L", "ml", "und". Defaults to "Kg" if omitted.
stock
number
Initial stock level on hand. Also accepted as Stock_Actual. Defaults to 0 if omitted.
stock_minimo
number
Minimum safe stock threshold. Also accepted as Stock_Minimo. Defaults to 0 if omitted. This value is used to auto-calculate Punto_Reorden when that field is not provided.
Punto_Reorden
number
Stock level at which a reorder should be triggered. Defaults to stock_minimo × 1.5 when not provided. Supply this field explicitly to override the automatic calculation.

Response

Returns the newly created insumo object with the full dual-key response shape described in GET /api/inventario.
curl -X POST http://localhost:5000/api/inventario \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Harina de maíz precocida",
    "unidad": "Kg",
    "stock": 50.0,
    "stock_minimo": 10.0,
    "Punto_Reorden": 15.0
  }'

PUT /api/inventario/

Updates one or more fields of an existing supply item. Only the fields included in the request body are modified — omitted fields retain their current values. Both camelCase and PascalCase key names are accepted for all updatable fields.

Path Parameters

id_inventario
integer
required
The ID of the insumo to update. This is the id_inventario (or ID_Insumos) value from the GET response.

Request Body

All fields are optional. Include only the fields you want to change.
nombre
string
Updated supply item name. Also accepted as Nombre_Insumo.
unidad
string
Updated unit of measurement. Also accepted as Unidad_Medida.
stock
number
Updated current stock level. Also accepted as Stock_Actual. Use this field to record deliveries or consumption adjustments.
stock_minimo
number
Updated minimum stock threshold. Also accepted as Stock_Minimo. Note: updating stock_minimo does not automatically recalculate Punto_Reorden on existing records — update Punto_Reorden via a subsequent request if needed.

Response

Returns the full updated insumo object with the dual-key response shape. Returns 404 with {"detail": "Insumo no encontrado"} if no record with that ID exists.
To record a stock receipt (incoming delivery), send only {"stock": <new_total>}. For a full restock audit, combine stock, stock_minimo, and Punto_Reorden in a single request.
# Update stock after a delivery
curl -X PUT http://localhost:5000/api/inventario/7 \
  -H "Content-Type: application/json" \
  -d '{"stock": 75.0}'

# Update both stock and reorder threshold
curl -X PUT http://localhost:5000/api/inventario/7 \
  -H "Content-Type: application/json" \
  -d '{
    "stock": 75.0,
    "stock_minimo": 15.0,
    "Punto_Reorden": 22.5
  }'

DELETE /api/inventario/

Permanently removes a supply item from the inventory. This operation returns no response body on success. Response status: 204 No Content

Path Parameters

id_inventario
integer
required
The ID of the insumo to delete. This is the id_inventario (or ID_Insumos) value from the GET response.

Response

Returns 204 No Content with an empty body on success. Returns 404 with {"detail": "Insumo no encontrado"} if no record with that ID exists.
Deleting an insumo is permanent and cannot be undone. If the item is temporarily out of stock, consider setting stock to 0 and updating Punto_Reorden to trigger reorder workflows rather than deleting the record entirely.
curl -X DELETE http://localhost:5000/api/inventario/7 \
  -H "Accept: application/json"

Build docs developers (and LLMs) love