Save Template

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 

ParameterTypeRequiredDescription
cartIdStringYesThe ID of the source Quote, Order, or Opportunity to save as a template.
templateNameStringYesThe name for the new template.
descriptionStringNoA description of the template.
categoryStringNoThe category for the template (defaults to “General” if not provided).
asyncModeBooleanNoSet to true to run the clone operation asynchronously. Default value is false.
pricingBooleanNoSet to true to execute pricing on the cloned cart. Default value is false.
validationBooleanNoSet to true to execute validation on the cloned cart. Default value is false.

Example REST Request 

1{
2  "cartId": "0Q0xx0000004CabCAE",
3  "templateName": "Enterprise Fiber Bundle",
4  "description": "Standard fiber bundle with router and installation for enterprise customers",
5  "category": "Enterprise",
6  "asyncMode": false,
7  "pricing": false,
8  "validation": false
9}

Example REST Response 

Success Response (200):

1{
2  "success": true,
3  "errorCode": "INVOKE-200",
4  "error": "OK",
5  "result": {
6    "messages": [],
7    "records": [
8      {
9        "templateId": "a1Bxx0000004XyzDEF"
10      }
11    ]
12  }
13}

Success Response - Async Mode (200):

1{
2  "success": true,
3  "errorCode": "INVOKE-200",
4  "error": "OK",
5  "result": {
6    "messages": [],
7    "records": [
8      {
9        "templateId": "a1Bxx0000004XyzDEF",
10        "jobId": "7071T00000ABCDEFGH"
11      }
12    ]
13  }
14}