Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/astrxnomo/shop-microservers/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint wipes the authenticated user’s cart by deleting the Redis key that holds their cart data. The operation is immediate and irreversible — once the key is deleted, the cart is empty and the TTL is reset on the next write. The orders service calls this endpoint automatically after a successful checkout, so under normal usage you should not need to invoke it manually.

Endpoint

DELETE /api/cart/

Authentication

This endpoint requires a valid JWT passed as a Bearer token in the Authorization header.
Authorization: Bearer <token>

Request

No request body

This endpoint accepts no path parameters, query parameters, or request body.

Example request

curl -X DELETE http://localhost/api/cart/ \
  -H "Authorization: Bearer eyJhbGci..."

Response

200 — Success

Returns a confirmation object indicating the cart was successfully cleared.
{
  "success": true,
  "data": { "cleared": true },
  "error": null
}
data.cleared
boolean
required
Always true on a successful clear. Confirms that the Redis DEL command was executed for the user’s cart key.
This endpoint is called automatically by the orders service after a successful checkout. You typically do not need to call it directly. Calling it manually will empty the cart without creating an order.
A subsequent GET /api/cart/ after clearing will return "items": [] and "total": 0, since the Redis key no longer exists and the service treats a missing key as an empty cart.

401 — Unauthorized

Returned when the Authorization header is missing or the JWT is invalid or expired.
{
  "success": false,
  "data": null,
  "error": "Unauthorized"
}

Build docs developers (and LLMs) love