Creates a new Sales Configuration Template by cloning an existing Quote or Order.
Resource Information
- Resource URL:
/services/apexrest/<namespace>/v1/cpq/templates - HTTP Method: POST
- Content-Type: application/json
- Response Format: JSON
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| cartId | String | Yes | The ID of the source Quote, Order, or Opportunity to save as a template. |
| templateName | String | Yes | The name for the new template. |
| description | String | No | A description of the template. |
| category | String | No | The category for the template (defaults to "General" if not provided). |
| asyncMode | Boolean | No | Set to true to run the clone operation asynchronously. Default value is false. |
| pricing | Boolean | No | Set to true to execute pricing on the cloned cart. Default value is false. |
| validation | Boolean | No | Set to true to execute validation on the cloned cart. Default value is false. |
Example REST Request
{
"cartId": "0Q0xx0000004CabCAE",
"templateName": "Enterprise Fiber Bundle",
"description": "Standard fiber bundle with router and installation for enterprise customers",
"category": "Enterprise",
"asyncMode": false,
"pricing": false,
"validation": false
}
Example REST Response
Success Response (200):
{
"success": true,
"errorCode": "INVOKE-200",
"error": "OK",
"result": {
"messages": [],
"records": [
{
"templateId": "a1Bxx0000004XyzDEF"
}
]
}
}
Success Response - Async Mode (200):
{
"success": true,
"errorCode": "INVOKE-200",
"error": "OK",
"result": {
"messages": [],
"records": [
{
"templateId": "a1Bxx0000004XyzDEF",
"jobId": "7071T00000ABCDEFGH"
}
]
}
}