Shopping Cart API
Manage shopping cart operations with session handling, item management, and checkout preparation.
/api/cart/{sessionId}
Get cart contents for session. Creates a new cart if sessionId is new or cart expired. Replace {sessionId} with an ID (e.g., sess_123).
Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).
/api/cart/{sessionId}/items
Add an item to the cart. Replace {sessionId} with a session ID.
Replace placeholders (e.g., {userId}) with actual values in the path above.
/api/cart/{sessionId}/items
List all items in the specified cart. Replace {sessionId} with a session ID.
Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).
/api/cart/{sessionId}/items
Update quantity of an item in the cart. Expects itemId and new quantity. Replace {sessionId} with a session ID.
Replace placeholders (e.g., {userId}) with actual values in the path above.
/api/cart/{sessionId}/items
Remove an item from the cart. Expects itemId. Replace {sessionId} with a session ID.
Replace placeholders (e.g., {userId}) with actual values in the path above.
/api/cart/{sessionId}
Update cart metadata, e.g., apply a coupon code. Replace {sessionId} with a session ID.
Replace placeholders (e.g., {userId}) with actual values in the path above.
/api/cart/{sessionId}
Clear all items from the cart (cart session persists but is empty). Replace {sessionId} with a session ID.
Replace placeholders (e.g., {userId}) with actual values in the path above.