Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/MateoNavarroMN/Balsamoa-Backend/llms.txt

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

This endpoint queries the vista_catalogo_productos database view and returns every product in the catalog, ordered from newest to oldest by ID. Each object in the response array is a fully denormalized product record that includes the category name, the principal image URL, a summed stock total, a per-size stock breakdown, all hex color codes, the full image list with ordering, variant foreign-key ID arrays, and the complete variant matrix. No query parameters are required or supported.

Request

Method: GET
Path: /api/v1/admin/productos
Path parameters: none
Query parameters: none
Request body: none
curl -X GET http://localhost:3000/api/v1/admin/productos \
  -H "Accept: application/json"

Response

200 — Success

Returns a JSON array of product objects. An empty catalog returns an empty array [].
[
  {
    "id": 9,
    "nombre": "Hoodie Basic Gris Oscuro",
    "descripcion": "Buzo con capucha gris carbón.",
    "categoria_id": 1,
    "categoria": "Hoodie",
    "precio": "40000.00",
    "destacado": true,
    "activo": true,
    "fecha_creacion": "2024-11-10T18:45:00.000Z",
    "imagen_principal": "/recursos/imagenes/productos/Hoodie Basic Gris Oscuro.webp",
    "stock_total": 13,
    "stock_por_talle": [
      { "talle": "L",  "cantidad": 8 },
      { "talle": "XL", "cantidad": 5 }
    ],
    "colores_hex": ["#4A4A4A"],
    "imagenes": [
      { "url": "/recursos/imagenes/productos/Hoodie Basic Gris Oscuro.webp", "orden": 1 }
    ],
    "talle_ids": [3, 4],
    "color_ids": [7],
    "variantes": [
      { "talle_id": 3, "color_id": 7, "stock": 8,  "activo": true },
      { "talle_id": 4, "color_id": 7, "stock": 5,  "activo": true }
    ]
  },
  {
    "id": 1,
    "nombre": "Hoodie Basic Blanco",
    "descripcion": "Buzo con capucha blanco o hueso. Pequeño logo negro en el pecho.",
    "categoria_id": 1,
    "categoria": "Hoodie",
    "precio": "40000.00",
    "destacado": false,
    "activo": true,
    "fecha_creacion": "2024-11-01T10:00:00.000Z",
    "imagen_principal": "/recursos/imagenes/productos/Hoodie Basic Blanco.webp",
    "stock_total": 2,
    "stock_por_talle": [
      { "talle": "S", "cantidad": 2 }
    ],
    "colores_hex": ["#F5F5F5"],
    "imagenes": [
      { "url": "/recursos/imagenes/productos/Hoodie Basic Blanco.webp", "orden": 1 }
    ],
    "talle_ids": [1],
    "color_ids": [1],
    "variantes": [
      { "talle_id": 1, "color_id": 1, "stock": 2, "activo": true }
    ]
  }
]

Response Fields

id
integer
Unique numeric identifier for the product, assigned by the database.
nombre
string
Display name of the product.
descripcion
string | null
Optional free-text description. null if not set.
categoria_id
integer
Foreign key referencing the categorias table.
categoria
string
Human-readable category name joined from the categorias table (e.g. "Hoodie", "Remera").
precio
string
Product price in ARS as a decimal string with two places (e.g. "40000.00").
destacado
boolean
Whether the product is marked as featured and should appear in highlighted sections of the store.
activo
boolean
Whether the product is visible to public store endpoints. false means the product is soft-deleted.
fecha_creacion
string
ISO 8601 timestamp of when the product row was inserted.
imagen_principal
string | null
Public URL of the image with the lowest orden value. null if no images have been attached.
stock_total
integer
Sum of stock across all variants of this product.
stock_por_talle
array
Aggregated stock per size. Each element has a talle (size label) and a cantidad (total units across all colors for that size).
colores_hex
array
Flat array of unique hex color codes for all variants of this product (e.g. ["#F5F5F5", "#1A1A1A"]).
imagenes
array
All product images ordered by orden ascending. Each element contains a url string and an orden integer.
talle_ids
array
Sorted array of talle_id values that appear in at least one variant of this product.
color_ids
array
Sorted array of color_id values that appear in at least one variant of this product.
variantes
array
Full variant matrix. Each element contains talle_id, color_id, stock, and activo.

500 — Database Error

Returned when the query against vista_catalogo_productos fails.
{
  "mensaje": "Error al obtener productos",
  "detalle": "could not connect to server: Connection refused"
}

Build docs developers (and LLMs) love