The Items Donación API provides read and management access to the individual line items (ItemDonacion) that make up a donation record. Each item captures a specific product, its quantity, unit value, and expiry date. Items are created as part of aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/alvarezlautaro/BancoAlimentos/llms.txt
Use this file to discover all available pages before exploring further.
Donacion through the Donations API (see Donaciones) — there is no dedicated POST endpoint here. Once created, items can be read, filtered by various criteria, updated, and deleted through this API. All endpoints require a valid JWT and enforce the appropriate Spring Security authority.
Base URL: /api/itemdonacion
Endpoints
GET /api/itemdonacion
Returns all donation line items across every donation record. Required authority:ITEM_DONACION_VER
Response
Returns an array of ItemDonacionResponseDTO objects with HTTP200 OK.
GET /api/itemdonacion/{id}
Returns a single donation item by its numeric ID. Required authority:ITEM_DONACION_VER
Path parameters
The unique numeric identifier of the donation item.
Response
Returns a single ItemDonacionResponseDTO with HTTP200 OK.
GET /api/itemdonacion/producto/{productoId}
Returns all donation items associated with a specific product. Required authority:ITEM_DONACION_VER
Path parameters
The unique numeric identifier of the product to filter by.
Response
Returns an array of ItemDonacionResponseDTO objects whose product matchesproductoId, with HTTP 200 OK.
GET /api/itemdonacion/donacion/{donacionId}
Returns all items belonging to a specific donation record. Required authority:ITEM_DONACION_VER
Path parameters
The unique numeric identifier of the parent donation.
Response
Returns an array of ItemDonacionResponseDTO objects for the given donation, with HTTP200 OK.
GET /api/itemdonacion/categoria/{categoria}
Returns all donation items whose associated product belongs to the specified category. Required authority:ITEM_DONACION_VER
Path parameters
The product category name to filter by (e.g.
"Lácteos", "Cereales").Response
Returns an array of ItemDonacionResponseDTO objects matching the category, with HTTP200 OK.
PUT /api/itemdonacion/{id}
Fully replaces an existing donation item. All fields must be supplied. Required authority:ITEM_DONACION_ACTUALIZAR
Path parameters
The unique numeric identifier of the donation item to update.
Request body
Product expiry date. Must be a future date. Cannot be null.
Unit monetary value of the product. Must be a positive number.
Quantity of units. Must be at least
1.ID of the associated product. Cannot be null.
Response
Returns the updated ItemDonacionResponseDTO with HTTP200 OK.
PATCH /api/itemdonacion/{id}
Updates an existing donation item. Accepts the sameItemDonacionRequestDTO body structure as PUT. The server applies the full DTO — supply all fields you want retained.
Required authority: ITEM_DONACION_ACTUALIZAR
Path parameters
The unique numeric identifier of the donation item to update.
Request body
Same fields as PUT /api/itemdonacion/{id}. All validation rules apply.Response
Returns the updated ItemDonacionResponseDTO with HTTP200 OK.
DELETE /api/itemdonacion/{id}
Permanently deletes a donation item by its ID. Required authority:ITEM_DONACION_ELIMINAR
Path parameters
The unique numeric identifier of the donation item to delete.
Response
Returns HTTP200 OK with the plain-text body "ItemDonacion eliminado".
Schemas
Item donacion request schema
Fields used when updating a donation item (viaPUT or PATCH).
Product expiry date. Required; must be a future date. Cannot be null.
Unit monetary value. Must be a positive number greater than zero.
Number of units. Must be at least
1.ID of the associated product entity. Required; cannot be null.
Item donacion response schema
Fields returned in all item read and update operations.Unique numeric identifier of the donation item.
Product expiry date (ISO 8601 timestamp).
Unit monetary value of the product.
Number of units in this item line.
Human-readable name of the associated product.
Legal name (razón social) of the donor company linked to the parent donation.
Creating items
Donation items are not created through this API directly. They are submitted as the
items array when calling POST /api/donaciones or PUT /api/donaciones/{id}. See the Donaciones API for the creation workflow and the full ItemDonacionRequestDTO structure.Error responses
| HTTP Status | Condition |
|---|---|
400 Bad Request | Validation failure — e.g. past fechaVencimiento, non-positive valorUnitario, cantidad less than 1, or null productoId. |
401 Unauthorized | Missing or invalid JWT. |
403 Forbidden | Valid JWT but the user lacks the required authority. |
404 Not Found | No item found for the supplied id. |