Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/luisllatas-dev/Proyecto_Pasteleria_DonMamino/llms.txt

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

The products API gives you full control over the Don Mamino product catalog. Products can represent customer-facing items (vendible) or internal ingredients and supplies (insumo). Each product belongs to a specific sede (location). GET endpoints are open to the public; write operations require a valid JWT Bearer token.

GET /api/productos

Retrieve a list of all products across all sedes. Auth required: No

Response fields

Returns an array of product objects.
id_producto
number
Unique identifier of the product.
nombre_producto
string
Name of the product.
descripcion
string
Full description of the product.
precio
number
Unit price of the product (decimal with two decimal places).
stock
number
Current available quantity in inventory.
imagen_url
string
URL pointing to the product’s image.
estado
string
Availability status. One of activo or inactivo.
tipo_producto
string
Product category. One of vendible (sold to customers) or insumo (internal ingredient/supply).
id_sede
number
ID of the sede this product belongs to.

Example

curl
curl --request GET \
  --url http://localhost:3000/api/productos

GET /api/productos/:id

Retrieve a single product by its ID. Auth required: No

Path parameters

id
number
required
The id_producto of the product to retrieve.

Response fields

Returns a single product object with the same fields as the list endpoint above.

Example

curl
curl --request GET \
  --url http://localhost:3000/api/productos/3

Error responses

StatusDescription
404No product found with the given ID. Response body: { "message": "Producto no encontrado" }
500Internal server error.

POST /api/productos

Create a new product. Auth required: Yes
This endpoint requires a valid JWT token. Include it in the Authorization header as Bearer <token>.

Request body

nombre_producto
string
required
Name of the product.
descripcion
string
required
Description of the product.
precio
number
required
Unit price. Must be a decimal value (e.g., 12.50).
stock
number
required
Initial inventory quantity. Defaults to 0 if omitted.
imagen_url
string
required
URL of the product image.
estado
string
Availability status. Accepted values: activo, inactivo. Defaults to activo.
tipo_producto
string
Product type. Accepted values: vendible, insumo. Defaults to vendible.
id_sede
number
required
ID of the sede this product belongs to.

Response fields

id
number
The auto-generated id_producto of the newly created product.
mensaje
string
Confirmation message. Returns "Producto creado exitosamente".

Example

curl
curl --request POST \
  --url http://localhost:3000/api/productos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "nombre_producto": "Torta de chocolate",
    "descripcion": "Torta húmeda con cobertura de ganache",
    "precio": 45.00,
    "stock": 10,
    "imagen_url": "https://cdn.donmamino.com/productos/torta-chocolate.jpg",
    "estado": "activo",
    "tipo_producto": "vendible",
    "id_sede": 1
  }'

PUT /api/productos/:id

Update an existing product by its ID. Auth required: Yes
This endpoint requires a valid JWT token. Include it in the Authorization header as Bearer <token>.

Path parameters

id
number
required
The id_producto of the product to update.

Request body

All fields are accepted. Provide the full updated product object — all columns are overwritten.
nombre_producto
string
required
Updated name of the product.
descripcion
string
required
Updated description.
precio
number
required
Updated unit price.
stock
number
required
Updated inventory quantity.
imagen_url
string
required
Updated image URL.
estado
string
required
Updated status. One of activo or inactivo.
tipo_producto
string
required
Updated product type. One of vendible or insumo.
id_sede
number
required
Updated sede assignment.

Response fields

mensaje
string
Confirmation message. Returns "Producto actualizado exitosamente".

Example

curl
curl --request PUT \
  --url http://localhost:3000/api/productos/3 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "nombre_producto": "Torta de vainilla",
    "descripcion": "Torta esponjosa con crema chantilly",
    "precio": 40.00,
    "stock": 8,
    "imagen_url": "https://cdn.donmamino.com/productos/torta-vainilla.jpg",
    "estado": "activo",
    "tipo_producto": "vendible",
    "id_sede": 1
  }'

Error responses

StatusDescription
404No product found with the given ID.
500Internal server error.

DELETE /api/productos/:id

Delete a product by its ID. This action is permanent. Auth required: Yes
This endpoint requires a valid JWT token. Include it in the Authorization header as Bearer <token>.

Path parameters

id
number
required
The id_producto of the product to delete.

Response fields

mensaje
string
Confirmation message. Returns "Producto eliminado exitosamente".

Example

curl
curl --request DELETE \
  --url http://localhost:3000/api/productos/3 \
  --header 'Authorization: Bearer <token>'

Error responses

StatusDescription
404No product found with the given ID. Response body: { "message": "Producto no encontrado" }
500Internal server error.

Build docs developers (and LLMs) love