Skip to main content
DELETE
/
cart
/
clear
DELETE /cart/clear
204 No Content

Authentication

This endpoint requires authentication. Include a valid JWT token in the Authorization header.
Authorization: Bearer <token>
DELETE /cart/clear

Response

Returns a 204 No Content status on success with an empty response body.
204 No Content

Behavior

  • Removes all items from the user’s cart
  • The cart itself remains and is not deleted
  • After clearing, the cart will exist as an empty cart
  • This operation is useful for starting fresh or after completing a checkout process
  • Use the DELETE /cart/item/:id endpoint if you want to remove specific items

Error Responses

Cart Not Found (404)

{
  "message": "Carrito no encontrado"
}
This error occurs when the user doesn’t have a cart yet.

Unauthorized (401)

{
  "message": "Usuario no autenticado"
}

Build docs developers (and LLMs) love