# Remove Items from Cart

Delete the specified items from the cart. When products are bundled, the API deletes the child items. Returns error in case of cardinality failures or any other failures.

```nolang
DELETE /v2/cpq/carts/{cart_ID}/items
```

:::note
By default, items deleted from a cart are not evaluated for Vlocity Rules. To enable evaluation of deleted items, set the 'ShouldConsiderDeletedItems' custom setting to true.
:::

Delete Items replaces the OmniCPQServiceWrapper `deleteItem` method.

This API supports the guest user enhancements that Salesforce introduced with the Winter ‘21 release. To encrypt and decrypt data for guest users, use the `UserSecurity` class with this API. See Guest User Technical Details.

For additional information, ​see UserSecurity Class and CPQ and Digital Commerce Changes for Guest Users.

## Remote Method

```nolang
deleteCartsItems
```

:::note
In releases prior to CME Spring '20, the deleteCartsItems method supports the deletion of one item at a time. If you must delete multiple items, make multiple deleteCartsItems calls.

With CME Spring '20 and later releases, the itemId parameter supports multiple comma-separated values when deleting root and child items via deleteCartsItems method calls if UOWMode is set to true.
:::

## REST Handler

```nolang
APIItemsCartsCpqV2
```

## Apex Remote Service

```nolang
CpqAppHandler
```

## Apex Remote Input Map

```nolang
{
  methodName:deleteCartsItems,
  cartId:801360000008eNU,
  id:01t36000000pfcKAAQ
}
id = orderLineItem.Id, quoteLineItem.Id, opportunityLineItem.Id
```

## Package

Communication (vlocity_cmt)

## API Parameters and Response Format

For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary).

## Resource Information

| Response Format | JSON                                                                   |
| --------------- | ---------------------------------------------------------------------- |
| Resource URI    | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{itemId}` |

## Example Request

```nolang
DELETE
/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/items/80241000000Ha4a
```

## Example Response

```nolang
{
   "totalSize": 0,
   "messages": [{
      "severity": "INFO",
      "messageId": null,
      "message": "Successfully deleted.",
      "code": "152",
      "actions": {}
   }],
   "actions": {
      "deletecart": {
         "rest": {
            "params": {},
            "method": null,
            "link": null
         },
         "remote": {
            "params": {}
         },
         "client": {
            "params": {
               "items": [{
                  "message": "Root 1 has been deleted from the cart. ",
                  "Id": "80241000000Ha4aAAC"
               }],
               "mode": "DELETE"
            }
         }
      }
   }
}
```
