Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/EstefanoARG/FridgeRadar/llms.txt

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

The inventory module is the core of FridgeRadar. Every product stored in a household is represented as an inventory item that records where it lives (which shelf), how much is left, when it was bought, and when it expires. FridgeRadar automatically calculates an estado_caducidad (freshness state) for each item — ranging from verde (fresh) through amarillo (expiring soon) and rojo (expiring very soon) to vencido (expired) — so you always know what needs to be used first. All inventory endpoints require a valid bearer token in the Authorization header.

Adding an item to the pantry

Send a POST request to /api/v1/inventario/hogar/{id_hogar} with an InventarioCreate body.
FieldTypeRequiredDefaultDescription
id_productointProduct catalogue ID
id_estanteintShelf ID where the item is stored
cantidadfloat1.0Quantity on hand
fecha_compradatenullPurchase date (YYYY-MM-DD)
fecha_vencimientodatenullExpiry date — drives the semáforo state
abiertoboolfalseWhether the package has been opened
observacionesstrnullFree-text notes
curl -X POST https://your-fridgeradar-host/api/v1/inventario/hogar/1 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id_producto": 7,
    "id_estante": 3,
    "cantidad": 2.0,
    "fecha_compra": "2024-07-01",
    "fecha_vencimiento": "2024-07-15",
    "abierto": false,
    "observaciones": "Bought on sale"
  }'
A successful request returns 201 Created with an InventarioResponse:
{
  "id_inventario": 101,
  "id_hogar": 1,
  "id_producto": 7,
  "id_estante": 3,
  "id_usuario_agrego": 42,
  "cantidad": 2.0,
  "fecha_compra": "2024-07-01",
  "fecha_vencimiento": "2024-07-15",
  "abierto": false,
  "observaciones": "Bought on sale",
  "estado_caducidad": "amarillo",
  "fecha_registro": "2024-07-01T11:30:00"
}

Listing inventory items

Retrieve all items for a household with an optional freshness filter:
# All items
curl -X GET "https://your-fridgeradar-host/api/v1/inventario/hogar/1" \
  -H "Authorization: Bearer <token>"

# Only items expiring very soon
curl -X GET "https://your-fridgeradar-host/api/v1/inventario/hogar/1?estado=rojo" \
  -H "Authorization: Bearer <token>"

estado filter values

verde

Fresh items with plenty of time before expiry.

amarillo

Items approaching their expiry date — use soon.

rojo

Items very close to expiry — use immediately.

vencido

Items that have already passed their expiry date.

Getting a single item

curl -X GET https://your-fridgeradar-host/api/v1/inventario/101 \
  -H "Authorization: Bearer <token>"
Returns the full InventarioResponse for that item, or 404 Not Found if it does not exist.

Updating an item

Send a PATCH request to /api/v1/inventario/{id_inventario} with an InventarioUpdate body. All fields are optional — only include the fields you want to change.
FieldTypeDescription
id_estanteint | nullMove item to a different shelf
cantidadfloat | nullUpdate the quantity on hand
fecha_vencimientodate | nullCorrect or set the expiry date
abiertobool | nullMark the package as opened
observacionesstr | nullUpdate free-text notes
curl -X PATCH https://your-fridgeradar-host/api/v1/inventario/101 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "cantidad": 1.0,
    "abierto": true
  }'

Deleting an item

curl -X DELETE https://your-fridgeradar-host/api/v1/inventario/101 \
  -H "Authorization: Bearer <token>"
Returns 204 No Content on success. Deletion is permanent — consider logging a waste event first if the item is being discarded.

The estado_caducidad field

Every InventarioResponse includes an estado_caducidad string. This value is computed automatically by the backend based on the fecha_vencimiento and the current date. You never set it directly — it updates itself each time the semáforo recalculation task runs (daily at 00:05) or when you call the manual recalculation endpoint.
Filter your inventory by estado=rojo or estado=vencido regularly to catch items that need to be consumed or discarded. Pairing this with the Tengo Hambre (“I’m Hungry”) feature lets you automatically surface recipe suggestions that use your most at-risk pantry items before they go to waste.

Build docs developers (and LLMs) love