The delete product endpoint permanently removes a product from the catalogue. This action cannot be undone. Only administrators may perform deletions. On success the server returnsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/floriansalvi/HEIG-VD_Ocha-api/llms.txt
Use this file to discover all available pages before exploring further.
204 No Content with an empty body. If the product does not exist a 404 is returned, and if the id is malformed a 400 is returned without querying the database.
Endpoint
Request headers
Bearer token for authentication, e.g.
Bearer <JWT>.Path parameters
The MongoDB ObjectId of the product to delete (e.g.
64f1c2e9a1b2c3d4e5f12345).Response
204 No Content The product was successfully deleted. The response body is empty.Error codes
| Status | Meaning |
|---|---|
400 | Invalid ID format — the supplied id is not a valid MongoDB ObjectId. |
401 | Unauthorized — no token or an invalid token was supplied. |
403 | Forbidden — the authenticated user does not have admin privileges. |
404 | Product not found — no product exists with the given id. |
500 | Internal server error — an unexpected error occurred. |
Example
Request:204 with no body.
404 response: