Deep Clone Sales Transaction

Clone a quote or an order, including full object graph with related objects, selected lines, or selected groups.

This action is available in API version 67.0 and later.

Supported REST HTTP Methods 

URI:/services/data/v68.0/actions/standard/deepCloneSalesTransaction

Formats: JSON, XML

HTTP Methods: POST

Authentication:Authorization: Bearer TOKEN

Where TOKEN is a placeholder for your OAuth access token.

Inputs 

InputTypeDescription
optionsApex-definedSpecifies options to clone a ramp segment within a sales transaction. You can clone only the last ramp segment. Valid values are recordTypeId—ID of the record type related to the record to clone. Optional; or lineScope—Specifies the scope for cloning a ramp segment. This property determines which line items must be cloned and added to the cloned segment. You can specify these options: AllLines—Specifies whether all line items in a ramped group must be cloned, or RampedLinesOnly—Specifies whether only the ramped line items must be cloned. A segment identifier is created for the newly cloned line items, ensuring date continuity between the existing and cloned segment.
recordIdsList<String>Required. ID of the record to be cloned. You can specify a single record ID only.
salesTransactionIdStringRequired. ID of the sales transaction related to the record IDs to clone.

Outputs 

OutputTypeDescription
newRecordIdStringID of the cloned sales transaction.

Example 

POST

Here’s a sample request for the Deep Clone Sales Transaction action.

1{
2  "inputs": [
3    {
4      "recordIds": ["0QLxx0000004CBYGA2"],
5      "salesTransactionId": "0Q0xx0000004CE0CAM",
6      "options": {
7        "lineScope": "AllLines"
8      }
9    }
10  ]
11}

Here’s a sample response for the Deep Clone Sales Transaction action.

1{
2  "actionName": "deepCloneSalesTransaction",
3  "errors": null,
4  "isSuccess": true,
5  "outputValues": {
6    "newRecordId": "0Q0SG000000ACxf0AG"
7  }
8}