Remove Cart Item
Remove Cart Item
There are two ways to remove an item from a cart:
- DELETE the cart's lineitem: deletes all the items in a lineitem
- PUT to the cart's lineitem: change the number of items in the lineitem
DELETE the lineitem
Deleting a cart's lineitem deletes the lineitem, thereby removing all the items in the lineitem. Once the lineitem is deleted, Cortex returns status 204 and a link to the lineitem that was deleted.
- GET the cart
- GET the cart's lineitems
- Call DELETE the lineitem
PUT (Update) the cart
This URI updates the number of items in a lineitem. For example, if you have 4 Rockstar T-Shirts in a lineitem, you can use this method to remove 3 of the t-shirts, which leaves 1 T-shirt in the cart. The request body sets the number of items in the lineitem. For example, if you have 4 items and you specify {"quantity":1}, then you will have one item in the lineitem. Another example is if you have 4 items and you specify {"quantity":10}, then you will have ten items in the lineitem.
- GET the cart
- GET the cart's lineitems
- GET - a cart's lineitem
- PUT to the lineitem to update it (shown below)