Skip to main content

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.

The Get Order endpoint fetches a single order record by its unique identifier. The response includes a fully populated order object: the store_id and user_id fields are resolved to their respective documents, giving you store details and the user’s email and display_name alongside the order data.
This endpoint requires a valid user JWT. Users can access their own orders. Pass the token in the Authorization header.

HTTP method and path

GET /api/v1/orders/:id

Request parameters

Headers

Authorization
string
required
Bearer token for the authenticated user. Format: Bearer <token>.

Path

id
string
required
MongoDB ObjectId of the order to retrieve.

Response fields

200 OK

message
string
Human-readable confirmation. Value: "Order found".
order
object
The requested order document.

Error codes

StatusMeaning
400The provided id is not a valid MongoDB ObjectId.
401Missing or invalid JWT token.
404No order exists with the given id.
500Unexpected server error.

Example

curl --request GET \
  --url https://api.example.com/api/v1/orders/64f1c2e9a1b2c3d4e5f99999 \
  --header 'Authorization: Bearer <user_token>'
{
  "message": "Order found",
  "order": {
    "_id": "64f1c2e9a1b2c3d4e5f99999",
    "user_id": {
      "_id": "64f1c2e9a1b2c3d4e5f00001",
      "email": "[email protected]",
      "display_name": "Alice"
    },
    "store_id": {
      "_id": "64f1c2e9a1b2c3d4e5f12345",
      "name": "Ocha Lausanne"
    },
    "status": "en préparation",
    "pickup": "2026-01-10T12:30:00.000Z",
    "total_price_chf": 11.80,
    "createdAt": "2026-01-09T08:00:00.000Z",
    "updatedAt": "2026-01-09T08:00:00.000Z"
  }
}

Build docs developers (and LLMs) love