Documentation 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.
The delete endpoint removes a product document from the database. The operation is immediate and irreversible — no soft-delete or archiving is performed. This endpoint is restricted to administrators and requires both a standard user token and an admin token.
Deletion is permanent . There is no undo or recycle bin. Ensure the correct productId is used before calling this endpoint. Associated product images stored on disk are not automatically removed by this operation.
POST /api/product/delete/:productId
Auth: Token + TokenAdmin required
Path parameters
The MongoDB ObjectId of the product to delete.
Responses
"Producto eliminado correctamente" on success.
Error responses
Status msjCause 403"Sin parametro de producto"productId path parameter was not provided.500(error object) Unexpected server error.
Example
curl -X POST https://your-domain.com/api/product/delete/664a1f2e8b3c4d001e2f3a4b \
-H "Authorization: Bearer <token>"
Success response (200):
{
"msj" : "Producto eliminado correctamente" ,
"status" : true
}
POST /api/product/list-id/:productId
Retrieve a single product document by its ID. Returns the full product record including images, colors, sizes, and like counts.
Auth: Token required
Path parameters
The MongoDB ObjectId of the product to retrieve.
Responses
"Cargando producto..." on success.
The full product document. MongoDB ObjectId of the product.
ID of the user who created the product.
Discount label or percentage string.
Calculated discounted price, or empty string if no discount.
Array of { label, value } color objects.
Array of { label, value } size objects.
Shirt fit type (e.g. "Regular Fit").
Array of stored image paths.
Like counters. Array of user IDs who have liked the product.
ISO 8601 creation timestamp.
ISO 8601 last-updated timestamp.
Error responses
Status Cause 500Unexpected server error or invalid ObjectId format.
Example
curl -X POST https://your-domain.com/api/product/list-id/664a1f2e8b3c4d001e2f3a4b \
-H "Authorization: Bearer <token>"
Success response (200):
{
"msj" : "Cargando producto..." ,
"status" : true ,
"data" : {
"_id" : "664a1f2e8b3c4d001e2f3a4b" ,
"userId" : "663f0e1d7a2b3c000d1e2f3a" ,
"title" : "Classic Logo Tee" ,
"description" : "Comfortable everyday crew-neck t-shirt." ,
"price" : 29.99 ,
"minCant" : 50 ,
"discount" : "Sin descuento" ,
"priceDiscount" : "" ,
"colorsSize" : [
{ "label" : "Blanco" , "value" : "1" },
{ "label" : "Negro" , "value" : "2" }
],
"sizes" : [
{ "label" : "S" , "value" : "2" },
{ "label" : "M" , "value" : "3" },
{ "label" : "L" , "value" : "4" }
],
"typeShirt" : "Regular Fit" ,
"productImg" : [ "storage/product/12image1.jpg" ],
"points" : {
"cant" : 5 ,
"users" : [ "663f0e1d7a2b3c000d1e2f3b" , "663f0e1d7a2b3c000d1e2f3c" ]
},
"createdAt" : "2024-05-20T14:32:00.000Z" ,
"updatedAt" : "2024-05-21T09:15:00.000Z"
}
}