🛒 Ecommerce
Delete product
The API allows an authenticated user with the role of ADMIN to delete a product from the system.
It expects the productId to be passed as a path variable.
By utilizing this API, administrators can easily remove products from the inventory or catalog.
delete/ecommerce/products/{productId}
Response
Delete product
Example response
{
"data": {
"deletedProduct": {
"_id": "647b9f19f7ff0d570926fc90",
"category": "6478e1c2b3b51f6d24e0aa5b",
"createdAt": "2023-06-03T20:14:17.757Z",
"description": "Product 2 description a long descriptio2",
"mainImage": "http://localhost:8080/images/3158bbdac41c02430fb7a7361349762e",
"name": "Product 2",
"owner": "647b8582f3c8e42f3200d26a",
"price": 4000,
"stock": 20,
"subImages": [
"http://localhost:8080/images/9ee446c55af4e936efa9c4dc3e70cd80"
],
"updatedAt": "2023-06-03T20:14:17.757Z"
}
},
"message": "Product deleted successfully",
"statusCode": 200,
"success": true
}