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.

Shopping lists in FridgeRadar are scoped to a household (id_hogar) so every member of the home can view and contribute to the same list. You can create a list with an optional name and seed it with items in a single request, or build it incrementally by adding items one by one. Each item carries a priority level (alta, media, or baja) and can be marked as purchased (comprado: true) when it lands in the cart. All endpoints require a valid bearer token.

Creating a shopping list

POST /api/v1/listas-compra Send a ListaCompraCreate body. You may optionally include an initial array of items to create the list and its contents in one shot.
FieldTypeRequiredDefaultDescription
id_hogarintThe household this list belongs to
nombrestrnullA human-readable list name
itemsarray[]Optional seed items (see item fields below)
curl -X POST https://your-fridgeradar-host/api/v1/listas-compra \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id_hogar": 1,
    "nombre": "Compras del fin de semana",
    "items": [
      { "id_producto": 12, "cantidad": 2, "unidad": "kg", "prioridad": "alta" },
      { "id_producto": 5,  "cantidad": 1, "unidad": "unidad", "prioridad": "media" }
    ]
  }'
Returns 201 Created with a ListaCompraResponse:
{
  "id_lista": 8,
  "id_hogar": 1,
  "nombre": "Compras del fin de semana",
  "estado": "pendiente",
  "fecha_creacion": "2024-07-01T14:00:00",
  "items": [
    {
      "id_detalle": 21,
      "id_lista": 8,
      "id_producto": 12,
      "cantidad": 2.0,
      "unidad": "kg",
      "prioridad": "alta",
      "comprado": false,
      "nota": null
    },
    {
      "id_detalle": 22,
      "id_lista": 8,
      "id_producto": 5,
      "cantidad": 1.0,
      "unidad": "unidad",
      "prioridad": "media",
      "comprado": false,
      "nota": null
    }
  ]
}

Listing all shopping lists for a household

GET /api/v1/listas-compra?id_hogar={id}
curl -X GET "https://your-fridgeradar-host/api/v1/listas-compra?id_hogar=1" \
  -H "Authorization: Bearer <token>"
Returns an array of ListaCompraResponse objects, each including its nested items array.

Getting a single shopping list

GET /api/v1/listas-compra/{id_lista}
curl -X GET https://your-fridgeradar-host/api/v1/listas-compra/8 \
  -H "Authorization: Bearer <token>"

Adding items to an existing list

POST /api/v1/listas-compra/{id_lista}/items Use a ListaCompraDetalleCreate body to append a single item to a list.
FieldTypeRequiredDefaultDescription
id_productointProduct catalogue ID
cantidadfloatnullAmount to buy
unidadstrnullUnit of measure (e.g. "kg", "unidad")
prioridadstr"media""alta", "media", or "baja"
notastrnullFree-text note about the item
curl -X POST https://your-fridgeradar-host/api/v1/listas-compra/8/items \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id_producto": 33,
    "cantidad": 3,
    "unidad": "latas",
    "prioridad": "baja",
    "nota": "Marca genérica está bien"
  }'
Returns 201 Created with a ListaCompraDetalleResponse.

Marking an item as purchased

PATCH /api/v1/listas-compra/items/{id_detalle} Use ListaCompraDetalleUpdate to update any attribute of a list item. Set comprado: true to check an item off when it goes into the cart. All fields are optional.
FieldTypeDescription
cantidadfloat | nullRevise the quantity
unidadstr | nullRevise the unit
prioridadstr | nullChange priority
compradobool | nulltrue = item has been purchased
notastr | nullUpdate the note
curl -X PATCH https://your-fridgeradar-host/api/v1/listas-compra/items/21 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "comprado": true }'

Removing an item from a list

DELETE /api/v1/listas-compra/items/{id_detalle} Returns 204 No Content on success.
curl -X DELETE https://your-fridgeradar-host/api/v1/listas-compra/items/22 \
  -H "Authorization: Bearer <token>"

Updating a list’s name or state

PATCH /api/v1/listas-compra/{id_lista} Use ListaCompraUpdate to rename a list or change its estado (e.g. marking it as completed).
curl -X PATCH https://your-fridgeradar-host/api/v1/listas-compra/8 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "estado": "completada" }'

Deleting a shopping list

DELETE /api/v1/listas-compra/{id_lista} Returns 204 No Content. This also removes all associated items.

Practical workflow: from creation to checkout

1

Create the list

Create a named list for your household, optionally seeding it with the items you already know you need.
curl -X POST https://your-fridgeradar-host/api/v1/listas-compra \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "id_hogar": 1, "nombre": "Compras semanales" }'
2

Add items as you think of them

Append items to the list over time, using priority to flag what is most urgent.
curl -X POST https://your-fridgeradar-host/api/v1/listas-compra/8/items \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "id_producto": 9, "cantidad": 1, "prioridad": "alta" }'
3

Mark items as purchased at the store

As each item goes into the cart, patch it with comprado: true.
curl -X PATCH https://your-fridgeradar-host/api/v1/listas-compra/items/29 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "comprado": true }'
4

Close the list

Once the shopping run is done, update the list state to "completada".
curl -X PATCH https://your-fridgeradar-host/api/v1/listas-compra/8 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "estado": "completada" }'
Sort your view by prioridad to tackle alta items first. Items with no fecha_vencimiento risk in the pantry are good candidates for baja priority — stock-up buys that can wait.

Build docs developers (and LLMs) love