Configuration Validator API
The Configuration Validator API runs selection, validation, and alert product rules and configurator-scoped price rules against the input configuration model and returns an updated configuration model.
| Required Editions |
|---|
| Available in: Salesforce CPQ Spring ’17 and later |
- Formats
JSON, Apex
- HTTP Method
PATCH
- Authentication
Authorization: Bearer token
REQUEST
| Name | Type | Description | |
|---|---|---|---|
| uid | String | Required | ID of the Product2 record |
| quote | QuoteModel | Required | Corresponds directly to SBQQ__Quote__c. |
| configuration | ConfigurationModel | Required | The product's configuration data. |
| event | String | Required | Event type of product and price rules to run. Options are "Load", "Save", "Edit", and "Always". |
| upgradedAssetId | String | Optional | Asset ID when upgrading a bundle. |
RESPONSE
| Type | Description | ||
|---|---|---|---|
| ConfigurationModel | The product's configuration data. This is the same Configuration Model that was passed in the request, but the data will be changed based on Product Actions from Product and Price Rules that ran. See CPQ Models. |
The example request body configValidatorContext.json file for running product and price rules. This example context value is a JSON-formatted string of the quote model, configuration model, and event type.
Example response body returning product configuration data. The actual response is a JSON formatted string.
Before saving the ConfigValidator example class, make sure that the CPQ Modelsclasses are added as individual Apex classes in your org.
To demonstrate usage of the ConfigValidator class, run the following code in anonymous Apex.