Read Product API
The Read Product API takes the request’s product ID, pricebook ID, and currency code and returns a Product model. The Product model loads the product from your catalog when the user requests it.
| Required Editions |
|---|
| Available in: Salesforce CPQ Summer ’16 and later |
- Formats
JSON, Apex
- HTTP Method
PATCH
- Authentication
Authorization: Bearer token
Users must have read access to the product2 object.
- Parameter 1
Name: productId
Type: ID
Required: Yes
Description: The ID of the product record to load
- Parameter 2
Name: pricebookId
Type: ID
Required: Yes
Description: The ID of the pricebook that contains the product record to load
- Parameter 3
Name: currencyCode
Type: String
Required: Required only for multi-currency orgs
Description: The ISO code of a Salesforce currency where the product’s price is loaded
- Type
ProductModel
- Description
The representation of product data
This request body loaderContext.json file reads a product. The context value is a JSON formatted string.
An example response body after reading a product. The actual response is a JSON formatted string.
Before saving the ProductReader example class, make sure that the CPQ model classes are added as individual Apex classes in your org.
For an example of the ProductReader class, run the following code in anonymous Apex.