Delete Applied Promo Items

Delete applied promotion items from cart.

1DELETE /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 and CPQ and Digital Commerce Changes for Guest Users.

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 

1deletePromotionItems

REST Handler 

1APIPromotionsCartsCpqV2

Apex Remote Service 

1CpqAppHandler

Apex Remote Input Map 

1{
2 "id": "a2Lf40000008nL5EAI",
3 "cartId": "801f40000012NEIAA2",
4 "methodName": "deleteAppliedPromoItems",
5 "price": true,
6 "validate": true
7}

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/801f40000012NEIAA2/promotions
3
4Request Body:
5{
6 "id": "a2Lf40000008nL5EAI",
7 "cartId": "801f40000012NEIAA2",
8 "methodName": "deleteAppliedPromoItems",
9 "price": true,
10 "validate": true
11}

Example Response 

1{
2  "totalSize": 0,
3  "messages": [
4    {
5      "severity": "INFO",
6      "messageId": null,
7      "message": "Successfully deleted.",
8      "code": "152",
9      "bundleId": null,
10      "actions": {}
11    }
12  ],
13  "actions": {
14    "itemdeleted": {
15      "rest": {
16        "params": {},
17        "method": null,
18        "link": null
19      },
20      "remote": {
21        "params": {}
22      },
23      "client": {
24        "params": {
25          "items": [
26            {
27              "message": "add TestProd-12 bundle has been deleted from the cart.",
28              "Id": "a2Lf40000008nL5EAI"
29            }
30          ]
31        }
32      }
33    }
34  }
35}

Add with noResponseNeeded=true 

1{
2  "totalSize": 0,
3  "messages": [
4    {
5      "code": "150",
6      "severity": "INFO",
7      "message": "Successfully added."
8    }
9  ],
10  "actions": {
11    "itempricesupdated": {
12      "rest": {
13        "params": {},
14        "method": "GET",
15        "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H4WlAAK/price?price=false&cartId=801xx000003H4WlAAK"
16      },
17      "remote": { "params": {} },
18      "client": { "params": {} }
19    }
20  }
21}