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
| Parameter | Type | Required | Description |
|---|---|---|---|
| templateId | String | Yes | The SalesConfigTemplate__c record ID. |
| cartId | String | Yes | The target Quote or Order ID to receive the template items. |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| asyncMode | Boolean | No | Set to true to run the clone operation asynchronously. Default: false. |
| pricing | Boolean | No | Set to true to execute pricing after applying the template. Default: false. |
| validation | Boolean | No | Set 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
{
"asyncMode": false,
"pricing": true,
"validation": true
}
Example REST Response
Success Response (200): Sync Mode
{
"success": true,
"errorCode": "INVOKE-200",
"error": "OK",
"result": {
"messages": [],
"records": [
{
"cartId": "0Q0xx0000009AbcGHI",
}
]
}
}
Success Response (200): Async Mode
{
"success": true,
"errorCode": "INVOKE-200",
"error": "OK",
"result": {
"messages": [],
"records": [
{
"cartId": "0Q0xx0000009AbcGHI",
"jobId":"7071T00000ABCDEFGH"
}
]
}
}