Cart
Add to Cart
Add a product to the authenticated user’s shopping cart
POST
Authentication
This endpoint requires authentication. Include a valid JWT token in the Authorization header.Request Body
The ID of the product to add to the cart
The quantity of the product to add. Must be at least 1.
Response
Returns the created or updated cart item.Unique identifier for the cart item
ID of the cart this item belongs to
ID of the product that was added
Total quantity of the product in the cart
Behavior
- If the product is already in the cart, the quantity will be incremented by the specified amount
- If the cart doesn’t exist yet, it will be created automatically
- The operation uses an atomic upsert to prevent race conditions