The CPQ Reconfigure API
Summarize
Summary of The CPQ Reconfigure API
The CPQ Reconfigure API allows ServiceNow customers to reconfigure existing quote bundles in Salesforce through a custom headless API. This API is specifically designed for modifying quote details without needing to recreate quotes from scratch, enhancing efficiency in quote management.
Show less
Prerequisites
- Set the Runtime Client Token in the Admin Custom Settings page in Salesforce, ensuring it matches the ServiceNow CPQ URL without a trailing slash.
- Configure the Runtime Configuration URL to align with the administration URL.
- Add your ServiceNow CPQ domain as a remote site in Salesforce under Security settings.
Key Features
- Endpoint: /services/apexrest/LGK/cpq-quote-lines/reconfigure
- Methods: Supports application/json with the PATCH method for updating quote lines.
- Allows updating two fields: configurationId and configurableQuoteLineId.
- Returns a quote record (SBQQQc) with information on all quote lines, not just those modified.
Key Outcomes
By utilizing the CPQ Reconfigure API, customers can efficiently manage quote configurations, ensuring accurate updates and integrated pricing information. This leads to improved workflow efficiency and accuracy in quote management within Salesforce, allowing for better customer service and sales processes.
The CPQ Reconfigure API headlessly invokes CPQ services to reconfigure a quote bundle.
The CPQ Reconfigure API is a custom Salesforce API that invokes CPQ services headlessly. Unlike RFQ, this API is used to reconfigure an existing quote bundle.
Prerequisites
The Runtime Client Token must be set in the Admin Custom Settings page in Salesforce. The token must include an origin that matches the ServiceNow CPQ URL, which cannot include a trailing slash (/) character.
The Runtime Configuration URL must also be set in the Admin Custom Settings page. In most cases, this should match the administration URL on the same page.
In Salesforce Setup, go to Security, and then to Remote Site Settings. Add a new remote site with your ServiceNow CPQ domain as the URL.
API details
Endpoint: /services/apexrest/LGK/cpq-quote-lines/reconfigure
Methods: Receives and returns application/json.
PATCH: The method currently only supports two fields, configurationId and configurableQuoteLineId.
Response: A quote (SBQQ__Q__c) record.
Request example:
{
"configurationId":"86ec190e-cba8-4b1d-a2dc-ba47714a22b5",
"configurableQuoteLineId":"a137d00000977oWAAQ"
}
Response example:
{
"attributes": {
"type": "SBQQ__Quote__c",
"url": "/services/data/v56.0/sobjects/SBQQ__Quote__c/a0zR0000003f3GLIAY"
},
"Name": "Q-00090",
"Id": "a0zR0000003f3GLIAY",
"SBQQ__LineItemCount__c": 4,
"SBQQ__LineItems__r": {
"totalSize": 4,
"done": true,
"records": [
{
"attributes": {
"type": "SBQQ__QuoteLine__c",
"url": "/services/data/v56.0/sobjects/SBQQ__QuoteLine__c/a0vR0000005LPRxIAO"
},
"SBQQ__Quote__c": "a0zR0000003f3GLIAY",
"Id": "a0vR0000005LPRxIAO",
"Name": "QL-0000122",
"SBQQ__ProductName__c": "LGK Machine"
},
{
"attributes": {
"type": "SBQQ__QuoteLine__c",
"url": "/services/data/v56.0/sobjects/SBQQ__QuoteLine__c/a0vR0000005LPRyIAO"
},
"SBQQ__Quote__c": "a0zR0000003f3GLIAY",
"Id": "a0vR0000005LPRyIAO",
"Name": "QL-0000123",
"SBQQ__ProductName__c": "Analytics Software"
},
{
"attributes": {
"type": "SBQQ__QuoteLine__c",
"url": "/services/data/v56.0/sobjects/SBQQ__QuoteLine__c/a0vR0000005LPS2IAO"
},
"SBQQ__Quote__c": "a0zR0000003f3GLIAY",
"Id": "a0vR0000005LPS2IAO",
"Name": "QL-0000124",
"SBQQ__ProductName__c": "Extended Warranty"
},
{
"attributes": {
"type": "SBQQ__QuoteLine__c",
"url": "/services/data/v56.0/sobjects/SBQQ__QuoteLine__c/a0vR0000005LPS3IAO"
},
"SBQQ__Quote__c": "a0zR0000003f3GLIAY",
"Id": "a0vR0000005LPS3IAO",
"Name": "QL-0000125",
"SBQQ__ProductName__c": "Scanner"
}
]
},
"SBQQ__Type__c": "Quote"
}
Requests can be made directly through Apex. The argument is a Map<String,Object> with the same fields used in the REST API. For example:
Map<String, Object> requestBody = new Map<String, Object>{
'configurableQuoteLineId' => '01t8a000005hldvAAA',
'configurationId' => '79a3ffdd-7dd0-41f6-8700-4bd7506407c7'
};
String result = LGK.CpqReconfigureApiController.reconfigure(requestBody);
The response is a JSON formatted string representing the quote object, similar to the response in the REST APIs.
Custom field mapping
If a field on the Quote Line object in Salesforce has a name that matches, custom values can be written from the extended or pricing information in a ServiceNow CPQ product.