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 removes a product from the authenticated user’s cart by filtering out any entry whose productId matches the one supplied in the URL. The removal is all-or-nothing — the entire cart entry is deleted regardless of how many units are currently stored. If you need partial quantity reduction, update the cart by removing the item and re-adding it with the adjusted quantity.

Endpoint

DELETE /api/cart/items/:productId

Authentication

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

Request

Path parameters

productId
string
required
The CUID of the product to remove from the cart. Must match the productId value stored in the cart entry.

Example request

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

Response

200 — Success

Returns the full updated items array after the item has been removed. If the productId did not exist in the cart, the response is still 200 and the existing items array is returned unchanged.
{
  "success": true,
  "data": [],
  "error": null
}
This endpoint removes the cart entry entirely — there is no partial quantity reduction endpoint. To reduce quantity without removing the item, call this endpoint followed by Add Item with the desired new quantity.

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