The Donantes API manages the companies and organisations that donate food to the bank. Each donor (donante) holds identifying and contact information: legal name (razón social), tax ID (CUIT), phone number, email, and address. Every endpoint requires a valid JWT in theDocumentation 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.
Authorization header and enforces a specific Spring Security authority, so callers must have the appropriate role before the request is processed.
Base URL: /api/donantes
Endpoints
GET /api/donantes
Returns the full list of registered donors. Required authority:EMPRESA_VER
Response
Returns an array of DonanteResponseDTO objects with HTTP200 OK.
GET /api/donantes/{id}
Returns a single donor by its numeric ID. Required authority:EMPRESA_VER
Path parameters
The unique numeric identifier of the donor.
Response
Returns a single DonanteResponseDTO object with HTTP200 OK. Throws 404 if the donor is not found.
POST /api/donantes
Creates a new donor record. Required authority:EMPRESA_CREAR
Request body
Legal business name of the donor company. Cannot be null.
Argentine tax identification number. Must be exactly 11 characters (digits only, no hyphens).
Contact phone number. Must be between 10 and 11 characters.
Contact email address. Must be a valid email format.
Physical address of the donor company. Cannot be null.
Response
Returns the created DonanteResponseDTO with HTTP201 Created.
PUT /api/donantes/{id}
Fully replaces an existing donor record. All fields must be provided. Required authority:EMPRESA_ACTUALIZAR
Path parameters
The unique numeric identifier of the donor to update.
Request body
Same fields as POST /api/donantes — all fields are required.Response
Returns the updated DonanteResponseDTO with HTTP200 OK.
DELETE /api/donantes/{id}
Permanently deletes a donor record by ID. Required authority:EMPRESA_ELIMINAR
Path parameters
The unique numeric identifier of the donor to delete.
Response
Returns HTTP200 OK with the plain-text body "Donante eliminado".
GET /api/donantes/{id}/historial
Returns the full audit history for a given donor — all past versions of the record as stored by the auditing mechanism. Required authority:AUDITORIA_DONACION_VER
Path parameters
The unique numeric identifier of the donor whose history is requested.
Response
Returns an array ofDonante entity snapshots representing the change history with HTTP 200 OK.
Schemas
Donante request schema
Fields sent when creating or updating a donor.Legal business name of the donor. Required; cannot be null.
Tax ID (CUIT). Must be exactly 11 characters.
Contact phone number. Must be 10–11 characters.
Contact email address. Must be a valid email format.
Physical address. Required; cannot be null.
Donante response schema
Fields returned in all donor read operations.Legal business name of the donor.
Tax ID (CUIT) of the donor.
Contact phone number.
Contact email address.
Physical address.
Error responses
| HTTP Status | Condition |
|---|---|
400 Bad Request | Validation failure on request body fields (e.g. CUIT length, null required fields). |
401 Unauthorized | Missing or invalid JWT. |
403 Forbidden | Valid JWT but the user lacks the required authority. |
404 Not Found | No donor found for the supplied id. |