Manages user shopping carts, allowing products to be added, removed, and viewed.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/v1/cart/{userId} | Get user's cart | Yes |
| POST | /api/v1/cart/{cartId}/add | Add product to cart | Yes |
| DELETE | /api/v1/cart/{cartId}/remove/{productId} | Remove product from cart | Yes |
- Retrieve the cart for a user.
- Add products to the cart specifying quantity.
- Remove products from the cart.
POST /api/v1/cart/1/add?quantity=2
Authorization: Bearer <token>
Content-Type: application/json
{
"id": 10,
"name": "Product Name",
"price": 19.99
}DELETE /api/v1/cart/1/remove/10
Authorization: Bearer <token>