The Get Order Statistics endpoint aggregates all orders in the database and groups the results by user, returning the total number of orders placed and the total amount spent in Swiss francs for each user. The data is computed server-side using a MongoDB aggregation pipeline that groups, looks up the associated user document, and projects a clean summary object.Documentation 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.
HTTP method and path
Request parameters
Headers
Bearer token for an admin user. Format:
Bearer <admin_token>.Response fields
200 OK
Array of per-user aggregation results. One entry per user who has placed at least one order.
Error codes
| Status | Meaning |
|---|---|
401 | Missing or invalid JWT token. |
403 | Authenticated user does not have admin privileges. |
500 | Unexpected server error or aggregation pipeline error. |