The Update Store endpoint applies a partial update to an existing store. Only the fields you include in the request body are modified — all other fields remain unchanged. When 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.
name field is updated, the store’s slug is automatically regenerated to match the new name. If the new name or email conflicts with another store, the request is rejected with 409 Conflict.
Endpoint
Path Parameters
The MongoDB ObjectId of the store to update (24-character hex string).
Request Body
All body fields are optional. Include only the fields you want to change.New store display name. Must be 3–50 characters and unique. Updating this field also regenerates the
slug.New contact email. Must be a valid email format and unique. Stored in lowercase.
New phone number. Must be a valid mobile phone number in any international format. Pass an empty string to clear the field.
Replaces the entire address object. All four sub-fields are required when
address is provided.Replaces the GeoJSON location. Both sub-fields are required when
location is provided.Replaces the full weekly schedule. Must be an array of exactly 7 elements (Sunday → Saturday). Each element must be
[] or ["HH:MM", "HH:MM"].Set to
false to deactivate the store or true to reactivate it.Response — 200 OK
Confirmation message (
"Store updated").The complete updated store record, reflecting all applied changes.
Error Codes
| Status | Description |
|---|---|
400 | The supplied id is not a valid MongoDB ObjectId. |
401 | No valid JWT was provided in the Authorization header. |
403 | The authenticated user does not have admin privileges. |
404 | No store exists with the given id. |
409 | The updated name or email conflicts with an existing store. |
422 | A field value failed validation (e.g. bad coordinates, malformed opening_hours). |
500 | Unexpected server error. |