The create endpoint registers a new product in the catalog. It accepts aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/ecommerce-delivery/llms.txt
Use this file to discover all available pages before exploring further.
multipart/form-data body so that product images can be uploaded alongside the structured fields. Color and size selections are validated against a fixed set of known values; unrecognized labels are stored as-is. The authenticated user’s ID is automatically associated with the product on creation.
POST /api/product/create
This endpoint requires a valid authentication token. Include your token in the
Authorization header as Bearer <token>.Content-Type:
multipart/form-data
Request fields
The display name of the product.
A full description of the product.
Base price of the product (before any discount).
Minimum stock quantity. Defaults to
0 if omitted.Available color options. Accepts either a JSON array of Comma-separated format:
{ label, value } objects or a comma-separated string of color labels.Known color labels include: Blanco, Negro, Gris oscuro, Gris claro, Azul celeste, Azul marino, Azul rey, Beige, Cafe claro, Cafe oscuro, Verde militar, Verde bosque, Verde menta, Rojo, Vino, Rosa pastel, Fucsia, Amarillo mostaza, Amarillo crema, Naranja, Lila, Morado, Turquesa, Amarillo.JSON array format:Available garment sizes. Accepts either a JSON array of Comma-separated format:
{ label, value } objects or a comma-separated string of size labels.Known size labels: XS (1), S (2), M (3), L (4), XL (5), XXL/2XL (6), XXXL/3XL (7).JSON array format:The fit/style category of the garment. Must be one of the following exact values:
| Value | Description |
|---|---|
Overside | Oversized fit |
CropTop | Crop top cut |
Regular Fit | Standard regular fit |
Semi-Overside | Semi-oversized fit |
Hoodie | Hooded sweatshirt |
One or more product image files. Upload using the
productImg field key as a multi-file upload. Images are stored on disk and their paths are saved to the product record.Responses
Human-readable status message.
"Producto creado correctamente" on success.true on success, false on failure.The full product document as saved in the database.
Error responses
| Status | msj | Cause |
|---|---|---|
403 | "Completa todos los campos para crear un producto" | One or more required fields are missing. |
403 | "Error de guardado" | The product document failed to save. |
500 | (error object) | Unexpected server error. |
Example
POST /api/product/points
Toggle a like (or unlike) on a product for the currently authenticated user. Each user can only register one like per product; calling this endpoint withaccion=1 while already having liked the product has no effect. Calling with accion=2 removes the like if one exists.
Auth: Token requiredContent-Type:
application/json
Request fields
The MongoDB ObjectId of the product to react to.
The reaction action:
1— Add a like (ignored if user has already liked the product).2— Remove a like (ignored if user has not liked the product).
Responses
"me gusta" on success.true on success.Error responses
| Status | msj | Cause |
|---|---|---|
500 | "Sin parametro de producto" | productId was not provided. |
404 | "Producto no encontrado" | No product found for the given ID. |
404 | "No se encontro el producto seleccionado" | Product could not be updated. |