# Delete Applied Promo Items

Delete applied promotion items from cart.

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

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.
For additional information, ​see [UserSecurity Class](https://help.salesforce.com/s/articleView?id=ind.v_admin_usersecurity_class\_28364.htm\&type=5) and [CPQ and Digital Commerce Changes for Guest Users](https://help.salesforce.com/s/articleView?id=ind.v_admin_cpq_and_digital_commerce_changes_for_guest_users\_27958.htm\&type=5).

**NOTE:**

- This API runs eligibility check against all promotions added to the cart during the deletion of a selected promotion.
- When the applied promotion is Cancelled/Disconnected before the expiration date, ensure to parallely maintain the following fields.
  - `vlocity_cmt__CommitmentEndDate__c` for Order Applied Promotion with end-dated
  - `vlocity_cmt__EstimatedEndDate__c` for Order Pricing with end-dated

## Remote Method

```nolang
deletePromotionItems
```

## REST Handler

```nolang
APIPromotionsCartsCpqV2
```

## Apex Remote Service

```nolang
CpqAppHandler
```

## Apex Remote Input Map

```nolang
{
 "id": "a2Lf40000008nL5EAI",
 "cartId": "801f40000012NEIAA2",
 "methodName": "deleteAppliedPromoItems",
 "price": true,
 "validate": true
}

```

## 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 URL    | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions` |

## Example Request

```nolang
DELETE
/services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000012NEIAA2/promotions

Request Body:
{
 "id": "a2Lf40000008nL5EAI",
 "cartId": "801f40000012NEIAA2",
 "methodName": "deleteAppliedPromoItems",
 "price": true,
 "validate": true
}

```

## Example Response

```nolang
{
  "totalSize": 0,
  "messages": [
    {
      "severity": "INFO",
      "messageId": null,
      "message": "Successfully deleted.",
      "code": "152",
      "bundleId": null,
      "actions": {}
    }
  ],
  "actions": {
    "itemdeleted": {
      "rest": {
        "params": {},
        "method": null,
        "link": null
      },
      "remote": {
        "params": {}
      },
      "client": {
        "params": {
          "items": [
            {
              "message": "add TestProd-12 bundle has been deleted from the cart.",
              "Id": "a2Lf40000008nL5EAI"
            }
          ]
        }
      }
    }
  }
}
```

### Add with noResponseNeeded=true

```nolang
{
  "totalSize": 0,
  "messages": [
    {
      "code": "150",
      "severity": "INFO",
      "message": "Successfully added."
    }
  ],
  "actions": {
    "itempricesupdated": {
      "rest": {
        "params": {},
        "method": "GET",
        "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H4WlAAK/price?price=false&cartId=801xx000003H4WlAAK"
      },
      "remote": { "params": {} },
      "client": { "params": {} }
    }
  }
}
```
