Skip to main content

Documentation 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.

The Products API manages the master catalog of food items that can be donated, tracked, and distributed through the Banco Alimentos system. Each product has a name, a food category, and a unit of measure. All endpoints require a valid JWT token and the appropriate permission authority.

Base URL

/api/productos

Endpoints

List all products

Authorization
string
required
Bearer token with the PRODUCTO_VER authority.
GET /api/productos
Returns a JSON array of all products in the catalog. Response — 200 OK
[
  {
    "id": 1,
    "nombre": "Arroz largo fino",
    "categoria": "CEREALES_Y_DERIVADOS",
    "unidadMedida": "KILOGRAMO"
  }
]

Get product by ID

Authorization
string
required
Bearer token with the PRODUCTO_VER authority.
id
Long
required
Internal numeric identifier of the product.
GET /api/productos/{id}
Response — 200 OK
{
  "id": 1,
  "nombre": "Arroz largo fino",
  "categoria": "CEREALES_Y_DERIVADOS",
  "unidadMedida": "KILOGRAMO"
}

Filter products by category

Authorization
string
required
Bearer token with the PRODUCTO_VER authority.
categoria
Categoria
required
One of the Categoria enum values (see table below).
GET /api/productos/filtrar/categoria?categoria={categoria}
Returns a filtered list of products matching the supplied category. Response — 200 OK
[
  {
    "id": 5,
    "nombre": "Leche entera",
    "categoria": "LACTEOS",
    "unidadMedida": "LITRO"
  }
]

Create product

Authorization
string
required
Bearer token with the PRODUCTO_CREAR authority.
POST /api/productos
Request body
nombre
string
required
Product name. Must not be blank and must not exceed 55 characters.
categoria
Categoria
required
Food category. Must be a valid Categoria enum value (see table below).
unidadMedida
UnidadMedida
required
Unit of measure. Must be a valid UnidadMedida enum value (see table below).
Response — 201 Created
{
  "id": 12,
  "nombre": "Leche entera",
  "categoria": "LACTEOS",
  "unidadMedida": "LITRO"
}

Full update

Authorization
string
required
Bearer token with the PRODUCTO_ACTUALIZAR authority.
id
Long
required
Internal numeric identifier of the product to update.
PUT /api/productos/{id}
Request body uses the same ProductoRequestDTO fields as Create product. Response — 200 OK — returns the updated ProductoResponseDTO.

Partial update

Authorization
string
required
Bearer token with the PRODUCTO_ACTUALIZAR authority.
id
Long
required
Internal numeric identifier of the product.
PATCH /api/productos/{id}
Request body accepts the same ProductoRequestDTO fields as the full update. Response — 200 OK — returns the updated ProductoResponseDTO.

Delete product

Authorization
string
required
Bearer token with the PRODUCTO_ELIMINAR authority.
id
Long
required
Internal numeric identifier of the product to delete.
DELETE /api/productos/{id}
Response — 200 OK
Producto eliminado

Data models

ProductoRequestDTO

FieldTypeRequiredConstraints
nombrestringNot blank; max 55 characters
categoriaCategoriaMust be a valid enum value
unidadMedidaUnidadMedidaMust be a valid enum value

ProductoResponseDTO

id
Long
Internal numeric identifier assigned by the system.
nombre
string
Display name of the product.
categoria
Categoria
Food category of the product.
unidadMedida
UnidadMedida
Unit of measure used for this product.

Enum: Categoria

ValueDescription
CEREALES_Y_DERIVADOSCereals and grain-derived products
LEGUMBRESLegumes (lentils, chickpeas, beans, etc.)
CONSERVASCanned and preserved foods
LACTEOSDairy products
CARNES_Y_PROTEINASMeat and other protein sources
FRUTAS_Y_VERDURASFruits and vegetables
ACEITES_Y_GRASASOils and fats
AZUCARES_Y_DULCESSugars and sweets
INFUSIONES_Y_BEBIDASInfusions and beverages
CONDIMENTOS_Y_SALSASCondiments and sauces
PANIFICADOSBakery and bread products
ALIMENTOS_INFANTILESInfant and toddler foods
ALIMENTOS_ESPECIALESSpecial dietary foods
PRODUCTOS_DE_HIGIENEHygiene products
PRODUCTOS_DE_LIMPIEZACleaning products
OTROSOther / uncategorized items

Enum: UnidadMedida

ValueDescription
UNIDADIndividual unit
KILOGRAMOKilogram
GRAMOGram
LITROLitre
MILILITROMillilitre
PAQUETEPackage
CAJABox
BOLSABag
LATACan / tin
BOTELLABottle

Build docs developers (and LLMs) love