The update product endpoint allows administrators to modify any combination of fields on an existing product. Only the fields present in the request body are changed — omitted fields retain their current values. If you need to rename a product, bear in mind that bothDocumentation 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.
name and slug must remain unique across the catalogue; a 409 is returned if either value conflicts with an existing product.
Endpoint
Request headers
Bearer token for authentication, e.g.
Bearer <JWT>.Must be
application/json.Path parameters
The MongoDB ObjectId of the product to update (e.g.
64f1c2e9a1b2c3d4e5f12345).Request body
All body fields are optional. Supply only the fields you want to change.New URL-friendly identifier. Must be unique across all products.
New display name. Must be unique across all products.
New category for the product.
New description text.
New base price in CHF. Must be
0 or greater.Set to
false to deactivate the product, or true to reactivate it.New image URL for the product.
Replacement size array. Each element must be one of
"S", "M", or "L".Replacement price surcharges. Replaces the entire
extra_chf object.Response
200 OKA human-readable confirmation, e.g.
"Product updated".The full updated product document reflecting all changes.
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. |
409 | Conflict — the new name or slug is already in use by another product. |
422 | Unprocessable entity — the request body failed schema validation. |
500 | Internal server error — an unexpected error occurred. |