Skip to main content

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

productId
string
required
The MongoDB ObjectId of the product to delete.

Responses

msj
string
"Producto eliminado correctamente" on success.
status
boolean
true on success.

Error responses

StatusmsjCause
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

productId
string
required
The MongoDB ObjectId of the product to retrieve.

Responses

msj
string
"Cargando producto..." on success.
status
boolean
true on success.
data
object
The full product document.

Error responses

StatusCause
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"
  }
}

Build docs developers (and LLMs) love