Remove Item from Cart
Cart & Checkout
Remove Item from Cart
Remove an item from the shopping cart
POST
Remove Item from Cart
Overview
Removes a product from the user’s shopping cart. This endpoint uses the cart synchronization mechanism - to remove an item, simply exclude it from the items array.Authentication
This endpoint requires authentication. Ensure the user is authorized to modify the cart.Request Body
number
required
The unique identifier of the user whose cart you want to modify
array
required
Response
boolean
required
Indicates whether the request was successful
object
The complete updated cart object
number
Unique identifier for the cart
number
The ID of the user who owns this cart
string
Error message if the request fails
Example Request
Remove Single Item
If the cart currently has items with IDs “789” and “456”, and you want to remove item “456”:Remove Multiple Items
To remove multiple items, simply exclude them from the array:Clear Entire Cart
To remove all items from the cart, send an empty items array:Example Response
Success Response
Empty Cart Response
Error Response
Error Codes
Important Notes
Removal workflow:
- Fetch the current cart using GET
/api/cart/:userId - Filter out the item(s) you want to remove from the items array
- Send the remaining items back to the sync endpoint
Removal Strategies
Remove by exclusion: The recommended approach is to exclude items you want to remove from the items array Clear cart: Send an empty items array to remove all items at once Validation: Only valid, non-deleted products are kept in the cart. Invalid product IDs are automatically filtered out Side effects: TheabandonedEmailSent flag is reset to false when cart contents change