Expand Items

Retrieves the next level of children of product in a bundle (in cart). The intent of this API is to improve performance when refreshing big product bundles in carts by returning child items when parent items are clicked.

1GET /v2/cpq/carts/{cart_ID}/items/{item_ID}/expand

Remote Method 

1getExpandedItems

Handlers 

1REST Endpoint: APIExpandItemCartsCpqv2.cls
2Implementation: CpqExpandCartItemActionV2.cls

Apex remote service 

1CpqAppHandler

Apex remote input map 

1{
2  methodName: getExpandedItems
3  productHierarchyPath:"01t36000004hM92AAE<01t36000004hM8xAAE"
4  itemId: 80236000009E2InAAK
5  cartId: 80136000000OXQvAAO
6}

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}/items/{item_ID}/expand

Example Request 

1GET 			/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000iwCx/items/80236000009E2InAAK/expand?productHierarchyPath=01t36000004hM92AAE<01t36000004hM8xAAE

Example Result 

1{
2  "totalSize": 1,
3  "messages": [],
4  "records": [{
5    "messages": [],
6    "actions": {
7      "expanditems": {
8        "rest": {
9          "params": {},
10          "method": "GET",
11          "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/items/80236000009E2InAAK/expand?cartId=80136000000OXQvAAO&itemId=80236000009E2InAAK&productHierarchyPath=01t36000004hM92AAE<01t36000004hM8xAAE"
12        },
13        "remote": {
14          "params": {
15            "methodName": "getExpandedItems",
16            "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE",
17            "itemId": "80236000009E2InAAK",
18            "cartId": "80136000000OXQvAAO"
19          }
20        },
21        "client": {
22          "params": {}
23        }
24      }
25    },
26    "displaySequence": -1,
27    "Id": {
28      "label": "Price Book Entry ID",
29      "value": "01u36000009qFdRAAU"
30    },
31    "Pricebook2Id": {
32      "label": "Price Book ID",
33      "value": "01s36000006iLkuAAE"
34    },
35    "Product2Id": {
36      "label": "Product ID",
37      "value": "01t36000004hM8xAAE"
38    },
39    "ProductCode": {
40      "label": "Product Code",
41      "value": "es-aug-vhcild1"
42    },
43    "UnitPrice": {
44      "label": "List Price",
45      "value": null
46    },
47    "Name": {
48      "label": "Product Name",
49      "value": "es-aug-vhcild1"
50    },
51    "vlocity_cmt__RecurringPrice__c": {
52      "label": "Recurring Price",
53      "value": null
54    },
55    "IsActive": {
56      "label": "Active",
57      "value": true
58    },
59    "Product2": {
60      "attributes": {
61        "type": "Product2",
62        "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE"
63      },
64      "Description": "es-aug-vhcild1",
65      "Name": "es-aug-vhcild1",
66      "vlocity_cmt__IsConfigurable__c": false,
67      "vlocity_cmt__Type__c": "None",
68      "vlocity_cmt__SubType__c": "None",
69      "Id": "01t36000004hM8xAAE",
70      "vlocity_cmt__JSONAttribute__c": null
71    },
72    "productId": "01t36000004hM8xAAE",
73    "defaultQuantity": 1.0,
74    "minQuantity": 0.0,
75    "maxQuantity": 99999.0,
76    "groupMinQuantity": 0,
77    "groupMaxQuantity": 99999,
78    "sequenceNumber": 1.00,
79    "productChildItemId": "a1x36000002sB2zAAE",
80    "productChildItemDefinition": {
81      "attributes": {
82        "type": "vlocity_cmt__ProductChildItem__c",
83        "url": "/services/data/v41.0/sobjects/vlocity_cmt__ProductChildItem__c/a1x36000002sB2zAAE"
84      },
85      "vlocity_cmt__IsVirtualItem__c": true,
86      "vlocity_cmt__ChildLineNumber__c": "1",
87      "Name": "a1x36000002sB2z",
88      "vlocity_cmt__SeqNumber__c": 1.00,
89      "Id": "a1x36000002sB2zAAE",
90      "vlocity_cmt__ChildProductId__r": {
91        "attributes": {
92          "type": "Product2",
93          "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE"
94        },
95        "Name": "es-aug-vhcild1",
96        "Id": "01t36000004hM8xAAE"
97      },
98      "vlocity_cmt__Quantity__c": 1,
99      "vlocity_cmt__ParentProductId__c": "01t36000004hM92AAE",
100      "vlocity_cmt__MinimumChildItemQuantity__c": 0,
101      "vlocity_cmt__MaxQuantity__c": 99999,
102      "vlocity_cmt__MaximumChildItemQuantity__c": 99999,
103      "vlocity_cmt__IsRootProductChildItem__c": false,
104      "vlocity_cmt__MinQuantity__c": 0,
105      "vlocity_cmt__CollapseHierarchy__c": false,
106      "vlocity_cmt__ParentProductId__r": {
107        "attributes": {
108          "type": "Product2",
109          "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM92AAE"
110        },
111        "Name": "es-aug-bundle",
112        "Id": "01t36000004hM92AAE"
113      },
114      "vlocity_cmt__ChildProductId__c": "01t36000004hM8xAAE",
115      "vlocity_cmt__IsOverride__c": false
116    },
117    "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE",
118    "isVirtualItem": true,
119    "attributeValues": {},
120    "hasChildren": true,
121    "itemType": "productGroup",
122    "parentLineItemId": "80236000009E2InAAK",
123    "productCategories": {
124      "totalSize": 0,
125      "messages": []
126    },
127    "childProducts": {
128      "totalSize": 0,
129      "messages": [],
130      "records": [{
131        "messages": [],
132        "actions": {
133          "addtocart": {
134            "rest": {
135              "params": {
136                "items": [{
137                  "parentId": "80236000009E2InAAK",
138                  "parentHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE",
139                  "itemId": "01u36000009qFeFAAU"
140                }],
141                "cartId": "80136000000OXQvAAO",
142                "price": true,
143                "validate": true,
144                "includeAttachment": false,
145                "pagesize": 20,
146                "lastRecordId": null,
147                "query": null
148              },
149              "method": "POST",
150              "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/items"
151            },
152            "remote": {
153              "params": {
154                "methodName": "postCartsItems",
155                "items": [{
156                  "parentId": "80236000009E2InAAK",
157                  "parentHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE",
158                  "itemId": "01u36000009qFeFAAU"
159                }],
160                "cartId": "80136000000OXQvAAO",
161                "price": true,
162                "validate": true,
163                "includeAttachment": false,
164                "pagesize": 20,
165                "lastRecordId": null,
166                "query": null
167              }
168            },
169            "client": {
170              "params": {}
171            }
172          },
173          "getproductbyid": {
174            "rest": {
175              "params": {},
176              "method": "GET",
177              "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/products?cartId=80136000000OXQvAAO&id=01u36000009qFeFAAU"
178            },
179            "remote": {
180              "params": {
181                "methodName": "getCartsProductsById",
182                "id": "01u36000009qFeFAAU",
183                "cartId": "80136000000OXQvAAO"
184              }
185            },
186            "client": {
187              "params": {
188                "cartId": "80136000000OXQvAAO",
189                "id": "01u36000009qFeFAAU",
190                "methodName": "getCartsProductsById"
191              }
192            }
193          }
194        },
195        "displaySequence": -1,
196        "Id": {
197          "label": "Price Book Entry ID",
198          "value": "01u36000009qFeFAAU"
199        },
200        "Pricebook2Id": {
201          "label": "Price Book ID",
202          "value": "01s36000006iLkuAAE"
203        },
204        "Product2Id": {
205          "label": "Product ID",
206          "value": "01t36000004hM97AAE"
207        },
208        "ProductCode": {
209          "label": "Product Code",
210          "value": "es-aug-addon1"
211        },
212        "UnitPrice": {
213          "label": "List Price",
214          "value": null
215        },
216        "Name": {
217          "label": "Product Name",
218          "value": "es-aug-addon1"
219        },
220        "vlocity_cmt__RecurringPrice__c": {
221          "label": "Recurring Price",
222          "value": null
223        },
224        "IsActive": {
225          "label": "Active",
226          "value": true
227        },
228        "Product2": {
229          "attributes": {
230            "type": "Product2",
231            "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM97AAE"
232          },
233          "Description": "es-aug-addon1",
234          "Name": "es-aug-addon1",
235          "vlocity_cmt__IsConfigurable__c": false,
236          "vlocity_cmt__Type__c": "None",
237          "vlocity_cmt__SubType__c": "None",
238          "Id": "01t36000004hM97AAE",
239          "vlocity_cmt__JSONAttribute__c": null
240        },
241        "productId": "01t36000004hM97AAE",
242        "defaultQuantity": 0.0,
243        "minQuantity": 0.0,
244        "maxQuantity": 5.0,
245        "groupMinQuantity": 0,
246        "groupMaxQuantity": 99999,
247        "sequenceNumber": 1.00,
248        "productChildItemId": "a1x36000002sB39AAE",
249        "productChildItemDefinition": {
250          "attributes": {
251            "type": "vlocity_cmt__ProductChildItem__c",
252            "url": "/services/data/v41.0/sobjects/vlocity_cmt__ProductChildItem__c/a1x36000002sB39AAE"
253          },
254          "vlocity_cmt__IsVirtualItem__c": false,
255          "vlocity_cmt__ChildLineNumber__c": "1",
256          "Name": "a1x36000002sB39",
257          "vlocity_cmt__SeqNumber__c": 1.00,
258          "Id": "a1x36000002sB39AAE",
259          "vlocity_cmt__ChildProductId__r": {
260            "attributes": {
261              "type": "Product2",
262              "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM97AAE"
263            },
264            "Name": "es-aug-addon1",
265            "Id": "01t36000004hM97AAE"
266          },
267          "vlocity_cmt__Quantity__c": 0,
268          "vlocity_cmt__ParentProductId__c": "01t36000004hM8xAAE",
269          "vlocity_cmt__MinimumChildItemQuantity__c": 0,
270          "vlocity_cmt__MaxQuantity__c": 5,
271          "vlocity_cmt__MaximumChildItemQuantity__c": 99999,
272          "vlocity_cmt__IsRootProductChildItem__c": false,
273          "vlocity_cmt__MinQuantity__c": 0,
274          "vlocity_cmt__CollapseHierarchy__c": false,
275          "vlocity_cmt__ParentProductId__r": {
276            "attributes": {
277              "type": "Product2",
278              "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE"
279            },
280            "Name": "es-aug-vhcild1",
281            "Id": "01t36000004hM8xAAE"
282          },
283          "vlocity_cmt__ChildProductId__c": "01t36000004hM97AAE",
284          "vlocity_cmt__IsOverride__c": false
285        },
286        "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE<01t36000004hM97AAE",
287        "isVirtualItem": false,
288        "attributeValues": {},
289        "hasChildren": false,
290        "itemType": "childProduct",
291        "productCategories": {
292          "totalSize": 0,
293          "messages": []
294        }
295      }]
296    }
297  }]
298}