The update endpoint allows administrators to modify any field of an existing product. All fields are optional — only the values provided in the request body will overwrite the stored data. If new images are uploaded they replace the existing set; if no image files are sent the current images are preserved. When 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.
discount percentage is supplied, a priceDiscount is automatically calculated and stored alongside the raw percentage value.
POST /api/product/update/:productId
Auth: Token + TokenAdmin requiredContent-Type:
multipart/form-data
Path parameters
The MongoDB ObjectId of the product to update.
Request fields
New display name for the product.
Updated product description.
Updated base price. Required when
discount is also provided, as priceDiscount is derived from this value.Updated minimum stock quantity. Defaults to
0 if omitted.Updated color options. Accepts a JSON array of
{ label, value } objects or a comma-separated string of known color labels. If omitted, the stored colors are replaced with an empty array.Known color labels: 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.Updated size options. Accepts a JSON array of
{ label, value } objects or a comma-separated string of known size labels. If omitted, the stored sizes are replaced with an empty array.Known size labels: XS, S, M, L, XL, XXL/2XL, XXXL/3XL.Updated shirt type. Must be one of:
Overside, CropTop, Regular Fit, Semi-Overside, Hoodie.Discount as a percentage value supplied as a string (e.g. The computed
"20" for 20%). When this field is present and price is a finite number, the server computes:priceDiscount is stored on the product. The raw discount string is also persisted.The
discount field on the Product schema stores the raw percentage string sent here. priceDiscount holds the calculated numeric result as a string.Replacement product images. Upload one or more files under the
productImg field key. If no files are uploaded, the existing images are kept unchanged.Responses
"Producto actualizado correctamente" on success.true on success.The full updated product document fetched after the update is applied.
Error responses
| Status | msj | Cause |
|---|---|---|
403 | "Sin parametro de producto" | productId path parameter is missing. |
404 | "Producto no encontrado" | No product exists for the given productId. |
400 | (validation error message) | One or more resolved color or size values is invalid. |
500 | (error object) | Unexpected server error. |