ZRPL
  • Welcome!
  • Quick Start
  • Reference
    • API Reference
      • Categories List
      • Category Details by ID
      • Create Simple Product
      • Config Product Creation
      • Product List
      • Update Existing Product
      • Product Details by SKU
      • Product Details by ID
      • Products in Category
      • Create Order
      • Order Details
      • Order History
      • Create Customer
      • Customer Token
      • Create Customer Cart
      • Add Item to Cart
      • View Cart
      • Update Cart
      • Delete Cart
      • Country Code
      • Set Shipping and Billing
      • Place Order
      • Customer Details
Powered by GitBook
On this page
  1. Reference
  2. API Reference

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. (1 indicates 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.

PreviousUpdate CartNextCountry Code

Last updated 4 months ago