# Clone Line Items in Cart

Clone the line items within the current cart.

```nolang
POST /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

```nolang
cloneItems
```

## REST Handler

```nolang
CpqCloneCartItemActionV2
```

## Apex Remote Service

```nolang
CpqAppHandler
```

## Apex Remote Input Map

```nolang
{
  "methodName": "cloneItems",
  "cartId": "801360000008eNU",
  "items":[ {"itemId":"01t36000000pfcKAAQ"}]
}
```

To skip assembling the cloned line-item payload, include `"noResponseNeeded": true` in the request body. See [Clone with noResponseNeeded=true](#clone-with-noresponseneededtrue).

## Package

Communication (vlocity_cmt)

## API Parameters and Response Format

For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary).

## Resource Information

| Response Format | JSON                                                                |
| --------------- | ------------------------------------------------------------------- |
| Resource URL    | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/clone` |

## Example Request

```nolang
POST
{
  "items": [
    {
      "itemId": "item_ID"
    }
  ]
}

```

## Example Result

```nolang
{
   "totalSize" => 1, "messages" => [{
      "severity" => "INFO",
      "messageId" => nil,
      "message" => "Clone Successful.",
      "code" => "153",
      "bundleId" => nil,
      "actions" => {}
   }], "actions" => {
      "itempricesupdated" => {
         "rest" => {
            "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/price"
         }, "remote" => {
            "params" => {
               "cartId" => "8016A000000bwDJQAY", "methodName" => "getCartLineItemPrices"
               }
            }, "client" => {
            "params" => {}
         }
      }
   }, "records" => [{
      "messages" => [],
      "actions" => {
         "addtocart" => {
            "rest" => {
               "params" => {
                  "items" => [{
                     "quantity" => 1,
                     "parentId" => "8026A000000cCaQQAU",
                     "itemId" => "01u6A00000135XeQAI"
                  }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
               }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items"
            }, "remote" => {
               "params" => {
                  "methodName" => "postCartsItems", "items" => [{
                     "quantity" => 1,
                     "parentId" => "8026A000000cCaQQAU",
                     "itemId" => "01u6A00000135XeQAI"
                  }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
               }
            }, "client" => {
            "params" => {}
         }
      }, "updateitems" => {
         "rest" => {
            "params" => {
               "items" => [{
                  "itemId" => "8026A000000cCaQQAU"
            }], "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
         }, "method" => "PUT", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items"
      }, "remote" => {
         "params" => {
            "methodName" => "putCartsItems", "items" => [{
               "itemId" => "8026A000000cCaQQAU"
            }], "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
         }
      }, "client" => {
         "params" => {}
      }
   }, "deleteitem" => {
      "rest" => {
         "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"
      }, "remote" => {
         "params" => {
            "methodName" => "deleteCartsItems", "id" => "8026A000000cCaQQAU", "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil
         }
      }, "client" => {
         "params" => {}
      }
      }, "cloneitem" => {
         "rest" => {
            "params" => {
               "items" => [{
                  "itemId" => "8026A000000cCaQQAU"
               }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
            }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/clone"
         }, "remote" => {
            "params" => {
               "methodName" => "cloneItems", "items" => [{
                  "itemId" => "8026A000000cCaQQAU"
               }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
            }
         }, "client" => {
            "params" => {}
         }
      }, "modifyattributes" => {
         "rest" => {
            "params" => {
               "items" => [{
                  "itemId" => "8026A000000cCaQQAU"
               }], "filters" => nil, "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
            }, "method" => "PUT", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/itemAttributes"
         }, "remote" => {
            "params" => {
               "methodName" => "putItemAttributes", "items" => [{
                  "itemId" => "8026A000000cCaQQAU"
               }], "filters" => nil, "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
            }
         }, "client" => {
               "params" => {}
         }
      }
   },
   "displaySequence" => -1,
   "Id" => {
      "value" => "8026A000000cCaQQAU", "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Order Product ID", "hidden" => false, "fieldName" => "Id", "editable" => false, "dataType" => "ID", "actions" => {}
   },
   "Pricebook2Id" => "01s6A0000037JCtQAM",
   "Product2Id" => "01t6A000000fd0AQAQ",
   "ProductCode" => "IRKPL",
   "UnitPrice" => {
      "value" => 0.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Unit Price", "hidden" => true, "fieldName" => "UnitPrice", "editable" => false, "dataType" => "CURRENCY", "actions" => {}
   },
   "Name" => "IRKPL",
   "vlocity_cmt__RecurringPrice__c" => 0.0,
   "IsActive" => true,
   "Product2" => {
      "attributes" => {
         "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd0AQAQ"
      }, "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
   },
   "productId" => "01t6A000000fd0AQAQ",
   "defaultQuantity" => 1.0,
   "minQuantity" => 0.0,
   "maxQuantity" => 99999.0,
   "groupMinQuantity" => 0,
   "groupMaxQuantity" => 99999,
   "sequenceNumber" => 1.0,
   "productChildItemDefinition" => {
      "attributes" => {
         "type" => "vlocity_cmt__ProductChildItem__c", "url" => "/services/data/v40.0/sobjects/vlocity_cmt__ProductChildItem__c/a2a6A000000wm6XQAQ"
      }, "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" => {
            "attributes" => {
               "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd0AQAQ"
            }, "Name" => "IRKPL", "Id" => "01t6A000000fd0AQAQ", "RecordTypeId" => "0126A000000gwBfQAI"
         }, "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"
      },
      "productHierarchyPath" => "01t6A000000fd0AQAQ",
      "name" => "IRKPL",
      "isVirtualItem" => false,
      "provisioningStatus" => "New",
      "hasChildren" => false,
      "itemType" => "lineItem",
      "PricebookEntryId" => {
         "value" => "01u6A00000135XeQAI", "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Price Book Entry ID", "hidden" => false, "fieldName" => "PricebookEntryId", "editable" => false, "dataType" => "REFERENCE", "actions" => {}
      },
      "Quantity" => {
         "value" => 1.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Quantity", "hidden" => false, "fieldName" => "Quantity", "editable" => true, "dataType" => "DOUBLE", "actions" => {}
      },
      "vlocity_cmt__OneTimeTotal__c" => {
         "value" => 10.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "One Time Total", "hidden" => false, "fieldName" => "vlocity_cmt__OneTimeTotal__c", "editable" => false, "dataType" => "CURRENCY", "actions" => {
            "adjustmentcodes" => {
               "rest" => {
                  "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"
                  }, "remote" => {
                     "params" => {
                        "methodName" => "getListsOfValues", "PricingVariableCode" => "OT_STD_PRC_TOTAL", "fields" => "vlocity_cmt__OneTimeTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY", "listkeys" => "AdjustmentCodes"
                     }
                  }, "client" => {
                     "records" => [], "params" => {}
                  }
               }, "applyadjustment" => {
                  "rest" => {
                     "params" => {
                        "adjustments" => [{
                           "PricingVariableCode" => "OT_STD_PRC_TOTAL",
                        "AdjustmentCode" => "",
                        "AdjustmentValue" => 0,
                        "AdjustmentMethod" => "Percent",
                        "DetailType" => "ADJUSTMENT",
                        "Field" => "vlocity_cmt__OneTimeTotal__c"
                     }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
                  }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing"
               }, "remote" => {
                  "params" => {
                     "methodName" => "applyAdjustment", "adjustments" => [{
                        "PricingVariableCode" => "OT_STD_PRC_TOTAL",
                        "AdjustmentCode" => "",
                        "AdjustmentValue" => 0,
                        "AdjustmentMethod" => "Percent",
                        "DetailType" => "ADJUSTMENT",
                        "Field" => "vlocity_cmt__OneTimeTotal__c"
                  }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
               }
            }, "client" => {
               "records" => [], "params" => {}
            }
         }, "pricedetail" => {
            "rest" => {
               "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing?cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__OneTimeTotal__c"
            }, "remote" => {
               "params" => {
               "methodName" => "getPriceDetail", "fields" => "vlocity_cmt__OneTimeTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
            }
         }, "client" => {
            "records" => [], "params" => {}
            }
         }
      }
   },
   "vlocity_cmt__RecurringTotal__c" => {
      "value" => 0.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Recurring Total", "hidden" => false, "fieldName" => "vlocity_cmt__RecurringTotal__c", "editable" => false, "dataType" => "CURRENCY", "actions" => {
         "adjustmentcodes" => {
            "rest" => {
               "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"
            }, "remote" => {
               "params" => {
                  "methodName" => "getListsOfValues", "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL", "fields" => "vlocity_cmt__RecurringTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY", "listkeys" => "AdjustmentCodes"
               }
            }, "client" => {
               "records" => [], "params" => {}
            }
         }, "applyadjustment" => {
            "rest" => {
               "params" => {
                  "adjustments" => [{
                     "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL",
                     "AdjustmentCode" => "",
                     "AdjustmentValue" => 0,
                     "AdjustmentMethod" => "Percent",
                     "DetailType" => "ADJUSTMENT",
                     "Field" => "vlocity_cmt__RecurringTotal__c"
                  }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
               }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing"
            }, "remote" => {
            "params" => {
               "methodName" => "applyAdjustment", "adjustments" => [{
                  "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL",
                  "AdjustmentCode" => "",
                  "AdjustmentValue" => 0,
                  "AdjustmentMethod" => "Percent",
                  "DetailType" => "ADJUSTMENT",
                  "Field" => "vlocity_cmt__RecurringTotal__c"
               }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
            }
         }, "client" => {
            "records" => [], "params" => {}
         }
      }, "pricedetail" => {
         "rest" => {
            "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing?cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__RecurringTotal__c"
         }, "remote" => {
            "params" => {
               "methodName" => "getPriceDetail", "fields" => "vlocity_cmt__RecurringTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY"
            }
         }, "client" => {
            "records" => [], "params" => {}
         }
      }
   }
},
```

:::note
This example result has been truncated.
:::

### Clone with noResponseNeeded=true

```nolang
POST /services/apexrest/vlocity_cmt/v2/cpq/carts/{cart_ID}/items/clone

{
  "methodName": "cloneItems",
  "cartId": "{cart_ID}",
  "items": [{ "itemId": "{item_ID}" }],
  "noResponseNeeded": true,
  "price": true,
  "validate": true
}
```

```nolang
{
  "totalSize": 0,
  "messages": [
    {
      "code": "153",
      "severity": "INFO",
      "message": "Clone Successful."
    }
  ],
  "actions": {
    "itempricesupdated": {
      "rest": {
        "params": {},
        "method": "GET",
        "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/price"
      },
      "remote": {
        "params": {
          "cartId": "8016A000000bwDJQAY",
          "methodName": "getCartLineItemPrices"
        }
      },
      "client": { "params": {} }
    }
  }
}
```
