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 product endpoint retrieves a single product by its unique MongoDB identifier. This endpoint is public and requires no authentication. If the supplied id is not a valid MongoDB ObjectId format, the API returns a 400 error immediately without querying the database.
Endpoint
This endpoint is public. No Authorization header is required.
Path parameters
The MongoDB ObjectId of the product to retrieve (e.g. 64f1c2e9a1b2c3d4e5f12345). Must be a valid 24-character hexadecimal string.
Response
200 OK
A human-readable confirmation, e.g. "Product found".
The requested product. MongoDB ObjectId of the product.
URL-friendly unique identifier derived from the product name.
Display name of the product.
Category the product belongs to.
Full description of the product.
Base price in Swiss francs (CHF). The final price for a given size equals basePriceCHF plus the corresponding extra_chf value.
Whether the product is currently active and available.
URL of the product image.
Available sizes. Each element is one of "S", "M", or "L".
Additional price in CHF applied per size on top of basePriceCHF. Show extra_chf properties
Price surcharge for size S (default 0).
Price surcharge for size M (default 2).
Price surcharge for size L (default 3).
ISO 8601 timestamp of when the product was created.
ISO 8601 timestamp of the last update.
Error codes
Status Meaning 400Invalid ID format — the supplied id is not a valid MongoDB ObjectId. 404Product not found — no product exists with the given id. 500Internal server error — an unexpected error occurred.
Example
Request:
curl https://api.example.com/api/v1/products/64f1c2e9a1b2c3d4e5f12345
200 response:
{
"message" : "Product found" ,
"product" : {
"_id" : "64f1c2e9a1b2c3d4e5f12345" ,
"slug" : "matcha-latte" ,
"name" : "Matcha Latte" ,
"category" : "Hot drinks" ,
"description" : "Delicious matcha latte with a hint of sweetness." ,
"basePriceCHF" : 5.00 ,
"isActive" : true ,
"image" : "https://res.cloudinary.com/example/image/upload/products/matcha-latte.jpg" ,
"size" : [ "S" , "M" , "L" ],
"extra_chf" : { "S" : 0 , "M" : 2 , "L" : 3 },
"createdAt" : "2024-01-15T10:30:00.000Z" ,
"updatedAt" : "2024-03-22T14:05:00.000Z"
}
}
400 response (invalid ID):
{
"message" : "Invalid ID format"
}
404 response:
{
"message" : "Product not found"
}