Delete Adjustment

Delete an applied price adjustment for a line item in the cart, such as a discount, mark up, or override.

The PricingElementServiceImplementation supports this API.

1POST /v2/cpq/carts/{cart_ID}/items/{ID}/pricing/{adjustment_ID}

Prior to the Fall ‘20 release, the deleteAjustment API included a call to getCartsItems. However, from the Fall ‘20 release, this API no longer calls getCartsItems. If you call this API directly in custom code, ensure that you add a call to getCartLineItemPrices in your code, after calling the deleteAdjustment API. The response from this API has been updated to include the itempricesupdated action to make a call to the next API.

Note

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 

1deleteAdjustment

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/{cartId}/items/{id}/pricing/{adjustmentId}

Example Request 

1POST
2/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000iJIZAA2/items/80246000000iuDbAAI/pricing/a2H46000000hj2ZEAQ
3{
4   "adjustments": [
5      {
6         "AdjustmentValue": -10,
7         "AdjustmentMethod": "Absolute",
8         "DetailType": "ADJUSTMENT",
9         "Field": "nv_cmt_dev__OneTimeCharge__c"
10      }
11   ]
12}

Example result 

This example has been truncated.

Note

1{
2   "totalSize": 1,
3   "messages": [],
4   "records": [
5      {
6         "messages": [],
7         "actions": {
8            "addtocart": {
9               "rest": {
10                  "params": {
11                     "items": [
12                        {
13                           "quantity": 1,
14                           "parentId": "80246000000hhNzAAI",
15                           "itemId": "01u46000001Z8aCAAS"
16                        }
17                     ],
18                     "cartId": "80146000000h5jmAAA",
19                     "price": true,
20                     "validate": true,
21                     "includeAttachment": false,
22                     "pagesize": 20,
23                     "lastRecordId": null,
24                     "query": null
25                  },
26                  "method": "POST",
27                  "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items"
28               },
29               "remote": {
30                  "params": {
31                     "methodName": "postCartsItems",
32                     "items": [
33                        {
34                           "quantity": 1,
35                           "parentId": "80246000000hhNzAAI",
36                           "itemId": "01u46000001Z8aCAAS"
37                        }
38                     ],
39                     "cartId": "80146000000h5jmAAA",
40                     "price": true,
41                     "validate": true,
42                     "includeAttachment": false,
43                     "pagesize": 20,
44                     "lastRecordId": null,
45                     "query": null
46                  }
47               },
48               "client": {
49                  "params": {}
50               }
51            },
52            "updateitems": {
53               "rest": {
54                  "params": {
55                     "items": [
56                     {
57                        "itemId": "80246000000hhNzAAI"
58                     }
59                  ],
60                  "filters": null,
61                  "fields": null,
62                  "cartId": "80146000000h5jmAAA",
63                  "price": true,
64                  "validate": true,
65                  "includeAttachment": false,
66                  "pagesize": 20,
67                  "lastRecordId": null,
68                  "query": null
69               },
70               "method": "PUT",
71               "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items"
72            },
73            "remote": {
74               "params": {
75                  "methodName": "putCartsItems",
76                  "items": [
77                     {
78                        "itemId": "80246000000hhNzAAI"
79                     }
80                  ],
81                  "filters": null,
82                  "fields": null,
83                  "cartId": "80146000000h5jmAAA",
84                  "price": true,
85                  "validate": true,
86                  "includeAttachment": false,
87                  "pagesize": 20,
88                  "lastRecordId": null,
89                  "query": null
90               }
91            },
92            "client": {
93               "params": {}
94            }
95         },
96         "deleteitem": {
97            "rest": {
98               "params": {},
99               "method": "DELETE",
100               "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI?pagesize=20&includeAttachment=false&validate=true&price=true&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI"
101            },
102            "remote": {
103               "params": {
104               "methodName": "deleteCartsItems",
105               "id": "80246000000hhNzAAI",
106               "filters": null,
107               "fields": null,
108               "cartId": "80146000000h5jmAAA",
109               "price": true,
110               "validate": true,
111               "includeAttachment": false,
112               "pagesize": 20,
113               "lastRecordId": null,
114               "query": null
115            }
116         },
117         "client": {
118            "params": {}
119         }
120      },
121      "cloneitem": {
122         "rest": {
123            "params": {
124               "items": [
125                  {
126                     "itemId": "80246000000hhNzAAI"
127                  }
128               ],
129               "id": "80246000000hhNzAAI",
130               "cartId": "80146000000h5jmAAA"
131            },
132            "method": "POST",
133            "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/clone"
134         },
135         "remote": {
136            "params": {
137               "methodName": "cloneItems",
138               "items": [
139                  {
140                     "itemId": "80246000000hhNzAAI"
141                  }
142               ],
143               "id": "80246000000hhNzAAI",
144               "cartId": "80146000000h5jmAAA"
145            }
146         },
147         "client": {
148            "params": {}
149         }
150      },
151      "modifyattributes": {
152         "rest": {
153            "params": {
154               "items": [
155                  {
156                     "itemId": "80246000000hhNzAAI"
157                  }
158               ],
159               "filters": null,
160               "id": "80246000000hhNzAAI",
161            "cartId": "80146000000h5jmAAA"
162         },
163         "method": "PUT",
164         "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/itemAttributes"
165      },
166      "remote": {
167         "params": {
168            "methodName": "putItemAttributes",
169            "items": [
170               {
171                  "itemId": "80246000000hhNzAAI"
172               }
173            ],
174            "filters": null,
175            "id": "80246000000hhNzAAI",
176            "cartId": "80146000000h5jmAAA"
177         }
178      },
179      "client": {
180         "params": {}
181      }
182   },
183   "getpromodetails": {
184      "rest": {
185         "params": {},
186         "method": "GET",
187         "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails"
188      },
189      "remote": {
190         "params": {
191         "methodName": "getPromotionDetails",
192         "subaction": "promodetails",
193         "promotionIds": "a2F46000000kmtNEAQ",
194         "id": "80246000000hhNzAAI",
195         "cartId": "80146000000h5jmAAA"
196      }
197   },
198   "client": {
199      "params": {}
200   }
201   }
202},
203"displaySequence": -1,
204"Id": {
205   "value": "80246000000hhNzAAI",
206   "previousValue": null,
207   "originalValue": null,
208   "messages": [],
209   "label": "Order Product ID",
210   "hidden": false,
211   "fieldName": "Id",
212   "editable": false,
213   "dataType": "ID",
214   "actions": {}
215},
216   "Pricebook2Id": "01s46000003EDDHAA4",
217   "Product2Id": "01t46000000Lo2mAAC",
218   "ProductCode": "BUNDLE_A",
219   "UnitPrice": {
220   "value": 0,
221   "previousValue": null,
222   "originalValue": null,
223   "messages": [],
224   "label": "Unit Price",
225   "hidden": true,
226   "fieldName": "UnitPrice",
227   "editable": false,
228   "dataType": "CURRENCY",
229   "actions": {}
230},
231   "Name": "Bundle A",
232   "vlocity_cmt__RecurringPrice__c": 0,
233   "IsActive": true,
234   "Product2": {
235   "attributes": {
236   "type": "Product2",
237   "url": "/services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC"
238},
239   "Id": "01t46000000Lo2mAAC",
240   "Description": "Bundle A",
241   "Name": "Bundle A",
242   "vlocity_cmt__IsConfigurable__c": false,
243   "vlocity_cmt__Type__c": "None",
244   "vlocity_cmt__SubType__c": "None",
245"RecordTypeId": "01246000000hFtZAAU",
246   "vlocity_cmt__JSONAttribute__c": null
247},