Clone Line Items in Cart

Clone the line items within the current cart.

1POST /v2/cpq/carts/{cart_ID}/items/clone

NOTE:

Starting in the Winter’27 release, this API supports noResponseNeeded. Set noResponseNeeded to true in the request body when the client does not need the cloned line-item payload. The API completes the clone and returns a lightweight success response instead of the full records node. This avoids resource-limit failures on large or multi-level clone operations. No additional configuration is required. When noResponseNeeded is omitted or false, the API continues to return the full clone response.

Remote Method 

1cloneItems

REST Handler 

1CpqCloneCartItemActionV2

Apex Remote Service 

1CpqAppHandler

Apex Remote Input Map 

1{
2  "methodName": "cloneItems",
3  "cartId": "801360000008eNU",
4  "items":[ {"itemId":"01t36000000pfcKAAQ"}]
5}

To skip assembling the cloned line-item payload, include "noResponseNeeded": true in the request body. See Clone with noResponseNeeded=true.

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/clone

Example Request 

1POST
2{
3  "items": [
4    {
5      "itemId": "item_ID"
6    }
7  ]
8}

Example Result 

1{
2   "totalSize" => 1, "messages" => [{
3      "severity" => "INFO",
4      "messageId" => nil,
5      "message" => "Clone Successful.",
6      "code" => "153",
7      "bundleId" => nil,
8      "actions" => {}
9   }], "actions" => {
10      "itempricesupdated" => {
11         "rest" => {
12            "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/price"
13         }, "remote" => {
14            "params" => {
15               "cartId" => "8016A000000bwDJQAY", "methodName" => "getCartLineItemPrices"
16               }
17            }, "client" => {
18            "params" => {}
19         }
20      }
21   }, "records" => [{
22      "messages" => [],
23      "actions" => {
24         "addtocart" => {
25            "rest" => {
26               "params" => {
27                  "items" => [{
28                     "quantity" => 1,
29                     "parentId" => "8026A000000cCaQQAU",
30                     "itemId" => "01u6A00000135XeQAI"
31                  }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
32               }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items"
33            }, "remote" => {
34               "params" => {
35                  "methodName" => "postCartsItems", "items" => [{
36                     "quantity" => 1,
37                     "parentId" => "8026A000000cCaQQAU",
38                     "itemId" => "01u6A00000135XeQAI"
39                  }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
40               }
41            }, "client" => {
42            "params" => {}
43         }
44      }, "updateitems" => {
45         "rest" => {
46            "params" => {
47               "items" => [{
48                  "itemId" => "8026A000000cCaQQAU"
49            }], "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
50         }, "method" => "PUT", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items"
51      }, "remote" => {
52         "params" => {
53            "methodName" => "putCartsItems", "items" => [{
54               "itemId" => "8026A000000cCaQQAU"
55            }], "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
56         }
57      }, "client" => {
58         "params" => {}
59      }
60   }, "deleteitem" => {
61      "rest" => {
62         "params" => {}, "method" => "DELETE", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU?pagesize=20&includeAttachment=false&validate=true&price=true&cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU"
63      }, "remote" => {
64         "params" => {
65            "methodName" => "deleteCartsItems", "id" => "8026A000000cCaQQAU", "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
66         }
67      }, "client" => {
68         "params" => {}
69      }
70      }, "cloneitem" => {
71         "rest" => {
72            "params" => {
73               "items" => [{
74                  "itemId" => "8026A000000cCaQQAU"
75               }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
76            }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/clone"
77         }, "remote" => {
78            "params" => {
79               "methodName" => "cloneItems", "items" => [{
80                  "itemId" => "8026A000000cCaQQAU"
81               }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
82            }
83         }, "client" => {
84            "params" => {}
85         }
86      }, "modifyattributes" => {
87         "rest" => {
88            "params" => {
89               "items" => [{
90                  "itemId" => "8026A000000cCaQQAU"
91               }], "filters" => nil, "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
92            }, "method" => "PUT", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/itemAttributes"
93         }, "remote" => {
94            "params" => {
95               "methodName" => "putItemAttributes", "items" => [{
96                  "itemId" => "8026A000000cCaQQAU"
97               }], "filters" => nil, "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
98            }
99         }, "client" => {
100               "params" => {}
101         }
102      }
103   },
104   "displaySequence" => -1,
105   "Id" => {
106      "value" => "8026A000000cCaQQAU", "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Order Product ID", "hidden" => false, "fieldName" => "Id", "editable" => false, "dataType" => "ID", "actions" => {}
107   },
108   "Pricebook2Id" => "01s6A0000037JCtQAM",
109   "Product2Id" => "01t6A000000fd0AQAQ",
110   "ProductCode" => "IRKPL",
111   "UnitPrice" => {
112      "value" => 0.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Unit Price", "hidden" => true, "fieldName" => "UnitPrice", "editable" => false, "dataType" => "CURRENCY", "actions" => {}
113   },
114   "Name" => "IRKPL",
115   "vlocity_cmt__RecurringPrice__c" => 0.0,
116   "IsActive" => true,
117   "Product2" => {
118      "attributes" => {
119         "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd0AQAQ"
120      }, "Name" => "IRKPL", "vlocity_cmt__IsConfigurable__c" => false, "vlocity_cmt__Type__c" => "None", "vlocity_cmt__SubType__c" => "None", "RecordTypeId" => "0126A000000gwBfQAI", "Id" => "01t6A000000fd0AQAQ", "vlocity_cmt__JSONAttribute__c" => nil
121   },
122   "productId" => "01t6A000000fd0AQAQ",
123   "defaultQuantity" => 1.0,
124   "minQuantity" => 0.0,
125   "maxQuantity" => 99999.0,
126   "groupMinQuantity" => 0,
127   "groupMaxQuantity" => 99999,
128   "sequenceNumber" => 1.0,
129   "productChildItemDefinition" => {
130      "attributes" => {
131         "type" => "vlocity_cmt__ProductChildItem__c", "url" => "/services/data/v40.0/sobjects/vlocity_cmt__ProductChildItem__c/a2a6A000000wm6XQAQ"
132      }, "vlocity_cmt__MinQuantity__c" => 0, "vlocity_cmt__SeqNumber__c" => 1.0, "Name" => "Root PCI", "Id" => "a2a6A000000wm6XQAQ", "vlocity_cmt__Quantity__c" => 1, "vlocity_cmt__MaximumChildItemQuantity__c" => 99999, "vlocity_cmt__MaxQuantity__c" => 99999, "vlocity_cmt__ParentProductId__r" => {
133            "attributes" => {
134               "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd0AQAQ"
135            }, "Name" => "IRKPL", "Id" => "01t6A000000fd0AQAQ", "RecordTypeId" => "0126A000000gwBfQAI"
136         }, "vlocity_cmt__MinimumChildItemQuantity__c" => 0, "vlocity_cmt__CollapseHierarchy__c" => false, "vlocity_cmt__IsOverride__c" => false, "vlocity_cmt__IsVirtualItem__c" => false, "vlocity_cmt__ChildLineNumber__c" => "1", "vlocity_cmt__IsRootProductChildItem__c" => true, "vlocity_cmt__ParentProductId__c" => "01t6A000000fd0AQAQ"
137      },
138      "productHierarchyPath" => "01t6A000000fd0AQAQ",
139      "name" => "IRKPL",
140      "isVirtualItem" => false,
141      "provisioningStatus" => "New",
142      "hasChildren" => false,
143      "itemType" => "lineItem",
144      "PricebookEntryId" => {
145         "value" => "01u6A00000135XeQAI", "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Price Book Entry ID", "hidden" => false, "fieldName" => "PricebookEntryId", "editable" => false, "dataType" => "REFERENCE", "actions" => {}
146      },
147      "Quantity" => {
148         "value" => 1.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Quantity", "hidden" => false, "fieldName" => "Quantity", "editable" => true, "dataType" => "DOUBLE", "actions" => {}
149      },
150      "vlocity_cmt__OneTimeTotal__c" => {
151         "value" => 10.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "One Time Total", "hidden" => false, "fieldName" => "vlocity_cmt__OneTimeTotal__c", "editable" => false, "dataType" => "CURRENCY", "actions" => {
152            "adjustmentcodes" => {
153               "rest" => {
154                  "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL"
155                  }, "remote" => {
156                     "params" => {
157                        "methodName" => "getListsOfValues", "PricingVariableCode" => "OT_STD_PRC_TOTAL", "fields" => "vlocity_cmt__OneTimeTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY", "listkeys" => "AdjustmentCodes"
158                     }
159                  }, "client" => {
160                     "records" => [], "params" => {}
161                  }
162               }, "applyadjustment" => {
163                  "rest" => {
164                     "params" => {
165                        "adjustments" => [{
166                           "PricingVariableCode" => "OT_STD_PRC_TOTAL",
167                        "AdjustmentCode" => "",
168                        "AdjustmentValue" => 0,
169                        "AdjustmentMethod" => "Percent",
170                        "DetailType" => "ADJUSTMENT",
171                        "Field" => "vlocity_cmt__OneTimeTotal__c"
172                     }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
173                  }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing"
174               }, "remote" => {
175                  "params" => {
176                     "methodName" => "applyAdjustment", "adjustments" => [{
177                        "PricingVariableCode" => "OT_STD_PRC_TOTAL",
178                        "AdjustmentCode" => "",
179                        "AdjustmentValue" => 0,
180                        "AdjustmentMethod" => "Percent",
181                        "DetailType" => "ADJUSTMENT",
182                        "Field" => "vlocity_cmt__OneTimeTotal__c"
183                  }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
184               }
185            }, "client" => {
186               "records" => [], "params" => {}
187            }
188         }, "pricedetail" => {
189            "rest" => {
190               "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing?cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__OneTimeTotal__c"
191            }, "remote" => {
192               "params" => {
193               "methodName" => "getPriceDetail", "fields" => "vlocity_cmt__OneTimeTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
194            }
195         }, "client" => {
196            "records" => [], "params" => {}
197            }
198         }
199      }
200   },
201   "vlocity_cmt__RecurringTotal__c" => {
202      "value" => 0.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Recurring Total", "hidden" => false, "fieldName" => "vlocity_cmt__RecurringTotal__c", "editable" => false, "dataType" => "CURRENCY", "actions" => {
203         "adjustmentcodes" => {
204            "rest" => {
205               "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__RecurringTotal__c&PricingVariableCode=REC_MNTH_STD_PRC_TOTAL"
206            }, "remote" => {
207               "params" => {
208                  "methodName" => "getListsOfValues", "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL", "fields" => "vlocity_cmt__RecurringTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY", "listkeys" => "AdjustmentCodes"
209               }
210            }, "client" => {
211               "records" => [], "params" => {}
212            }
213         }, "applyadjustment" => {
214            "rest" => {
215               "params" => {
216                  "adjustments" => [{
217                     "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL",
218                     "AdjustmentCode" => "",
219                     "AdjustmentValue" => 0,
220                     "AdjustmentMethod" => "Percent",
221                     "DetailType" => "ADJUSTMENT",
222                     "Field" => "vlocity_cmt__RecurringTotal__c"
223                  }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
224               }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing"
225            }, "remote" => {
226            "params" => {
227               "methodName" => "applyAdjustment", "adjustments" => [{
228                  "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL",
229                  "AdjustmentCode" => "",
230                  "AdjustmentValue" => 0,
231                  "AdjustmentMethod" => "Percent",
232                  "DetailType" => "ADJUSTMENT",
233                  "Field" => "vlocity_cmt__RecurringTotal__c"
234               }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
235            }
236         }, "client" => {
237            "records" => [], "params" => {}
238         }
239      }, "pricedetail" => {
240         "rest" => {
241            "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing?cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__RecurringTotal__c"
242         }, "remote" => {
243            "params" => {
244               "methodName" => "getPriceDetail", "fields" => "vlocity_cmt__RecurringTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
245            }
246         }, "client" => {
247            "records" => [], "params" => {}
248         }
249      }
250   }
251},

This example result has been truncated.

Note

Clone with noResponseNeeded=true 

1POST /services/apexrest/vlocity_cmt/v2/cpq/carts/{cart_ID}/items/clone
2
3{
4  "methodName": "cloneItems",
5  "cartId": "{cart_ID}",
6  "items": [{ "itemId": "{item_ID}" }],
7  "noResponseNeeded": true,
8  "price": true,
9  "validate": true
10}
1{
2  "totalSize": 0,
3  "messages": [
4    {
5      "code": "153",
6      "severity": "INFO",
7      "message": "Clone Successful."
8    }
9  ],
10  "actions": {
11    "itempricesupdated": {
12      "rest": {
13        "params": {},
14        "method": "GET",
15        "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/price"
16      },
17      "remote": {
18        "params": {
19          "cartId": "8016A000000bwDJQAY",
20          "methodName": "getCartLineItemPrices"
21        }
22      },
23      "client": { "params": {} }
24    }
25  }
26}