Delete Cart
This API is used to delete an item from the shopping cart
DELETE {{Base_url}}/rest/V1/carts/mine/items/97337
{
"items": [
{
"item_id": 97337,
"sku": "IFPZMB-RD0",
"qty": 1
}
]
}curl --location --request DELETE '{{Base_url}}/rest/V1/carts/mine/items/97337' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjIxMDAyNywidXR5cGlkIjozLCJpYXQiOjE3Mzc0NjcwMDQsImV4cCI6MTczNzQ3MDYwNH0.7ns-z-L5XysjFdCRy9X8RroLGQA-kixwDthq6C1ii-Q' \
--header 'Cookie: PHPSESSID=2639naaq26nbe7st472kk4ms4i' \
--data '{
"items": [
{
"item_id": 97337,
"sku": "IFPZMB-RD0",
"qty": 1
}
]
}
'items: Array of items to be deleted from the cart.item_id: Unique identifier of the item in the cart to be removed. (97337).sku: Stock Keeping Unit (SKU) of the item, a unique identifier for the product ("IFPZMB-RD0").qty: Quantity of the item to be removed. (1indicates one unit of the item).
The payload tells the API to delete the item with item_id: 97337, sku: "IFPZMB-RD0", and quantity 1 from the user's cart.
true{
"message": "The %1 Cart doesn't contain the %2 item.",
"parameters": [
615776,
97333
]
}The response true indicates that the requested action was successfully completed.
In this case, it means that the item with the item_id: 97337 and sku: "IFPZMB-RD0" was successfully removed from the user's cart. The true value is a confirmation from the API that the operation was successful.
Last updated