The Create Order endpoint allows an authenticated user to place a new pickup order at a specific store. The server validates the store, resolves each requested product, calculates per-item pricing — including any size-based surcharge — and stores aDocumentation 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.
total_price_chf on the resulting order document. The response includes a fully populated order object with store and user details.
This endpoint requires a valid user JWT passed in the
Authorization header. Orders are automatically associated with the authenticated user; no user_id field is accepted in the request body.HTTP method and path
Request parameters
Headers
Bearer token for the authenticated user. Format:
Bearer <token>.Body
MongoDB ObjectId of the store where the order will be picked up.
ISO 8601 datetime string for the scheduled pickup time. Example:
2026-01-10T12:30:00Z.Array of items to include in the order. Must contain at least one entry.
Response fields
201 Created
Human-readable confirmation. Value:
"Order successfully created".The newly created order, populated with store and user references.
Error codes
| Status | Meaning |
|---|---|
400 | Missing or invalid request data. Returned when store_id, pickup, or items are absent, or when an individual item is missing product_id, size, or quantity. |
401 | Missing or invalid JWT token. |
404 | The specified store or a referenced product was not found. |
422 | Mongoose validation error (e.g. invalid ObjectId format, size not in enum). |
500 | Unexpected server error. |