Delete Applied Promo Items

Overview 

The Delete Applied Promotion API is a one-stop call that cleanly removes a promotion, and anything it added to the cart, in a single, safe step.

Why it matters

  • All-in-one cleanup – The moment the promotion is deleted, the API can also delete any free or discounted products the promo injected.
  • Automatic price correction – It immediately re-calculates totals, taxes, and recurring fees so the cart shows the real price after the promo is removed.
  • Rule protection – It re-runs the same product-compatibility and bundle rules that run at checkout, catching problems (like bundle-quantity minimums).
  • Atomic safety – Everything happens in one transaction. If any step fails, nothing is saved, so the cart is never left in a half-updated state.

What you send and what you get back

  • You pass the cart Id, the promotion Id (or a comma-separated list), and a few simple flags—price and validate—that say whether you want the system to re-price and re-validate right away.
  • The response tells you:
    1. Whether the delete succeeded
    2. Any follow-up actions (like “prices updated”)
    3. A structured list of info/warning/error messages
1DELETE /v2/cpq/carts/{cart_Id}/promotions?id={PROMOTION_ID}

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.

Rest Handler 

1APIPromotionsCartsCpqV2

Rest Method 

1deletePromotionItems

Remote Service 

1CpqAppHandler

Remote Method 

1deleteAppliedPromoItems

Apex Remote Input Map 

1Map<String, Object> inputMap = new Map<String, Object>{
2    'cartId' => '{CART_ID}',
3    'id' => '{PROMOTION_ID}',
4    'validate' => true,
5    'price' => true
6};
7Map<String, Object> outputMap = new Map<String, Object>();
8Map<String, Object> optionsMap = new Map<String, Object>();
9CpqAppHandler handler = new CpqAppHandler();
10handler.invokeMethod('deleteAppliedPromoItems', inputMap, outputMap, optionsMap);

Package 

Communication (vlocity_cmt)

API Parameters and Response Format 

For API parameter names and descriptions, see Cart-Based API Swagger Reference.

Resource Information 

Response FormatJSON
Resource URL/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions

Example Request 

1DELETE
2/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0D1AAK/promotions?id=a35xx000000rOLhAAM&price=true&validate=true

Example Response 

1{
2  "totalSize": 0,
3  "messages": [
4    {
5      "code": "152",
6      "severity": "INFO",
7      "message": "Successfully deleted."
8    }
9  ],
10  "actions": {
11    "itempricesupdated": {
12      "rest": {
13        "params": {
14
15        },
16        "method": null,
17        "link": null
18      },
19      "remote": {
20        "params": {
21          "cartId": "801xx000003H0JTAA0",
22          "price": false,
23          "methodName": "getCartLineItemPrices"
24        }
25      },
26      "client": {
27        "params": {
28
29        }
30      }
31    },
32    "itemdeleted": {
33      "rest": {
34        "params": {
35
36        },
37        "method": null,
38        "link": null
39      },
40      "remote": {
41        "params": {
42          "items": [
43            {
44              "message": "Test_Promo has been deleted from the cart.",
45              "Id": "a35xx000000rOLhAAM"
46            }
47          ]
48        }
49      },
50      "client": {
51        "params": {
52          "items": [
53            {
54              "message": "Test_Promo has been deleted from the cart.",
55              "Id": "a35xx000000rOLhAAM"
56            }
57          ]
58        }
59      }
60    }
61  }
62}