The Update Order Status endpoint allows administrators to advance an order through its defined lifecycle. The order model enforces a fixed set of valid statuses and uses theDocumentation 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.
setStatus method to validate and persist the transition. Only the status field is writable through this endpoint.
HTTP method and path
Order status lifecycle
Orders progress through three statuses in sequence:en préparation— the default status assigned when an order is created; the store is preparing the order.prête— the order is ready for the customer to collect.récupérée— the customer has picked up the order.
400 error.
Request parameters
Headers
Bearer token for an admin user. Format:
Bearer <token>.Path
MongoDB ObjectId of the order to update.
Body
New status for the order. Must be one of:
"en préparation", "prête", "récupérée".Response fields
200 OK
Human-readable confirmation. Value:
"Order status updated".The updated order document.
Error codes
| Status | Meaning |
|---|---|
400 | status field is missing, the value is not one of the three allowed strings, or the id is not a valid ObjectId. |
401 | Missing or invalid JWT token. |
403 | Authenticated user does not have admin privileges. |
404 | No order exists with the given id. |
409 | Data conflict preventing the update. |
422 | Mongoose validation error. |
500 | Unexpected server error. |