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 retrieves a single product record from the vista_catalogo_productos view filtered by its numeric primary key. It returns the same fully denormalized schema as the list endpoint, making it suitable for populating product edit forms in the admin panel. Unlike the public store equivalent, this endpoint returns the product regardless of its activo status, so deactivated products are always accessible here.

Request

Method: GET
Path: /api/v1/admin/productos/:id
Request body: none

Path Parameter

id
integer
required
The numeric ID of the product to retrieve. Must be a positive integer that matches an existing row in the productos table.
curl -X GET http://localhost:3000/api/v1/admin/productos/3 \
  -H "Accept: application/json"

Response

200 — Success

Returns the product object directly (not wrapped in an array). The schema is identical to a single element from the List Products response.
{
  "id": 3,
  "nombre": "Hoodie Basic Verde",
  "descripcion": "Buzo con capucha verde oliva o militar.",
  "categoria_id": 1,
  "categoria": "Hoodie",
  "precio": "40000.00",
  "destacado": true,
  "activo": true,
  "fecha_creacion": "2024-11-01T10:00:00.000Z",
  "imagen_principal": "/recursos/imagenes/productos/Hoodie Basic Verde.webp",
  "stock_total": 45,
  "stock_por_talle": [
    { "talle": "S", "cantidad": 15 },
    { "talle": "M", "cantidad": 15 },
    { "talle": "L", "cantidad": 15 }
  ],
  "colores_hex": ["#4A5D23"],
  "imagenes": [
    { "url": "/recursos/imagenes/productos/Hoodie Basic Verde.webp", "orden": 1 }
  ],
  "talle_ids": [1, 2, 3],
  "color_ids": [3],
  "variantes": [
    { "talle_id": 1, "color_id": 3, "stock": 15, "activo": true },
    { "talle_id": 2, "color_id": 3, "stock": 15, "activo": true },
    { "talle_id": 3, "color_id": 3, "stock": 15, "activo": true }
  ]
}
id
integer
Unique numeric identifier for the product.
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.
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.
activo
boolean
Whether the product is publicly visible in the store. Deactivated products (false) are still returned by this admin endpoint.
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 talle (label) and cantidad (total units across all colors).
colores_hex
array
Flat array of unique hex color codes for all variants (e.g. ["#4A5D23"]).
imagenes
array
All product images ordered by orden ascending. Each element contains url and orden.
talle_ids
array
Sorted array of talle_id integers that appear in this product’s variants.
color_ids
array
Sorted array of color_id integers that appear in this product’s variants.
variantes
array
Full variant matrix with talle_id, color_id, stock, and activo per combination.

400 — Product Not Found

Returned when no row with the given id exists in the vista_catalogo_productos view.
{
  "mensaje": "Producto no encontrado"
}

Build docs developers (and LLMs) love