Update Cart Item
Cart & Checkout
Update Cart Item
Update the quantity of an item in the shopping cart
POST
Update Cart Item
Overview
Updates the quantity of an existing product in the user’s shopping cart. This endpoint uses the cart synchronization mechanism to modify item quantities.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
Cart Item Structure
Each cart item contains:- id: Product identifier (string format)
- quantity: Number of units (positive integer)
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
Update Single Item Quantity
Update Multiple Items
Example Response
Success Response
Error Response
Error Codes
Important Notes
To effectively increase or decrease quantity:
- First, fetch the current cart using GET
/api/cart/:userId - Modify the quantity of the desired item(s)
- Send all items back with the updated quantities
Quantity Updates
- Quantities must be positive integers (greater than 0)
- To remove an item, omit it from the items array (see Remove Item documentation)
- Setting quantity to 0 will not remove the item; you must exclude it from the array
- The
abandonedEmailSentflag is reset tofalsewhen quantities are updated - Invalid product IDs are automatically filtered out during sync