Apply Template

Applies an existing Sales Configuration Template to a target Quote or Order by cloning the template cart’s line items.

Resource Information 

  • Resource URL: /services/apexrest/<namespace>/v1/cpq/templates/{templateId}/apply/{cartId}
  • HTTP Method: POST
  • Content-Type: application/json
  • Response Format: JSON

URL Parameters 

ParameterTypeRequiredDescription
templateIdStringYesThe SalesConfigTemplate__c record ID.
cartIdStringYesThe target Quote or Order ID to receive the template items.

Request Body 

ParameterTypeRequiredDescription
asyncModeBooleanNoSet to true to run the clone operation asynchronously. Default: false.
pricingBooleanNoSet to true to execute pricing after applying the template. Default: false.
validationBooleanNoSet to true to execute validation after applying the template. Default: false.

Example REST Request 

POST /services/apexrest/vlocity_cmt/v1/cpq/templates/a1Bxx0000004XyzDEF/apply/0Q0xx0000009AbcGHI

1{
2  "asyncMode": false,
3  "pricing": true,
4  "validation": true
5}

Example REST Response 

Success Response (200): Sync Mode

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

Success Response (200): Async Mode

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