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 Delete Order endpoint permanently removes an order document and all of its associated OrderItem records in a single atomic operation. Because the response carries no body, the success condition is indicated solely by the 204 No Content status code. This action cannot be undone.
This endpoint requires a valid user JWT passed in the Authorization header.

HTTP method and path

DELETE /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 delete.

Response

204 No Content

The order and all related order items were successfully deleted. The response body is empty.

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 DELETE \
  --url https://api.example.com/api/v1/orders/64f1c2e9a1b2c3d4e5f99999 \
  --header 'Authorization: Bearer <user_token>'
A successful response returns HTTP 204 with no body.

Build docs developers (and LLMs) love