Delete a product from the catalog (admin only)
curl --request DELETE \
--url https://api.example.com/products/:idDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/GioTaipe/E-commerce/llms.txt
Use this file to discover all available pages before exploring further.
DELETE /products/:id
Authorization: Bearer <your_token>
204 No Content
curl -X DELETE https://api.example.com/products/1 \
-H "Authorization: Bearer <your_admin_token>"
204 No Content indicates successful deletion.
{
"error": "Product not found"
}
404 Not Found
{
"error": "Unauthorized"
}
401 Unauthorized
{
"error": "Admin access required"
}
403 Forbidden
{
"error": "Cannot delete product with existing orders"
}
409 Conflict
onDelete: Restrict constraint on OrderItem relations, products that are referenced in existing orders cannot be deletedonDelete: Cascade, so deleting a product will automatically remove it from all cartscurl --request DELETE \
--url https://api.example.com/products/:id