Is there any REST API to clear cart all product
One API is there to delete cart product using product ID
http://example.com/V1/carts/mine/items/:itemId
But my quote/cart i have added many product then I want clear my whole cart product is there any way to do this?
Thanks
2
Answers
An easy way of doing this is to delete the entire quote from the database. It will solve your issue.
Delete from quote where customer_id = <customer_id>;
By Magento default, we don’t have API for remove all quote items, so we have to extend to create an custom API with required access privilege and get the quote repository by request cartId and loop through all of the items and delete it.