Add Products API
Receive a CPQ quote, product collection, and quote group key in a request, and return a Quote model with all provided products added as quote lines.
| Required Editions |
|---|
| Available in: Salesforce CPQ Summer ’16 and later |
- Formats
JSON, Apex
- HTTP Method
PATCH
- Authentication
Authorization: Bearer token
REQUEST
- Parameter 1
Name: quote
Type: QuoteModel
Required: Yes
Description: A representation of SBQQ__Quote__c data
- Parameter 2
Name: products
Type: ProductModel[]
Required: Yes
Description: An array of representations of product data
- Parameter 3
Name: groupKey
Type: Integer
Required: Required only for grouped quotes
Description: An index of the existing quote line group where you’re adding products (0 indexed by default)
- Parameter 4
Name: ignoreCalculate
Type: Boolean
Required: Yes
Description: Always use true for this value
RESPONSE
- Type
QuoteModel
- Description
The representation of SBQQ__Quote__c data
This request body adderContext.json file reads a product. The context value is a JSON formatted string.
An example response body after adding a product. The actual response is a JSON formatted string.
Before saving the ProductAdder example class, make sure that the CPQ model classes are added as individual Apex classes in your org.
For an example of the ProductAdder, run the following code in anonymous Apex.