Get Product Recommendations Action
Retrieve a list of recommended products for a quote or order by using the Constraint Rule Engine.
This action is available in API version 67.0 and later.
The Get Product Details action is available in Enterprise, Unlimited, and Developer Editions where Product Discovery is enabled.
You can invoke this action via Apex and Flows only.
| Input | Type | Description |
|---|---|---|
additionalContextData | Apex-defined | An array of Apex runtime_industries_cpq.AdditionalContextData records that contain the additional nodes used along with the context definition nodes for data hydration. The maximum number of supported nodes is 10. |
additionalFields | Apex-defined | An Apex runtime_industries_cpq.AdditionalFields record that contains an array of additional standard or custom fields from the Product2 object to include in the response. |
catalogId | string | ID of the catalog from which to retrieve recommended products. |
contextDefinition | string | API name of the context definition used for context creation. If you don’t specify a value, the context definition selected on the Product Discovery Settings page from Setup is used. |
contextMapping | string | API name of the context mapping used for data hydration. The value of this parameter is used only if it belongs to the specified context definition. If you don’t specify a value, the default context mapping of the context definition is used. |
currencyCode | string | Currency code used for pricing calculations and product filtering. |
enablePricing | boolean | Indicates whether the pricing procedure must run (true) or not (false). For orgs where pricing is enabled, you can override to false to skip Salesforce Pricing execution. For orgs where pricing is disabled, you can’t override to true. |
enableQualification | boolean | Indicates whether the qualification procedure must run (true) or not (false). For orgs where qualification is enabled, you can override to false to skip BRE qualification rules. For orgs where qualification is disabled, you can’t override to true. |
filterCriteria | Apex-defined | A collection of Apex runtime_industries_cpq.FilterInputRepresentation records used to filter products. The filterCriteria parameter supports only the name property. The supported operators are eq, in, or contains. If this parameter contains multiple criteria, all criteria are applied using the and operator. |
nextCursor | string | A unique identifier that represents the position of the product from which the next set of results are retrieved. |
pageSize | integer | Maximum number of recommended products to return in the response. |
priceBookId | string | ID of the pricebook from which to retrieve pricing details. |
pricingProcedure | string | API name of the pricing procedure used to calculate product prices. If you don’t specify a value, the pricing procedure selected on the Product Discovery Settings page from Setup is used. |
qualificationProcedure | string | API name of the qualification procedure used to evaluate product eligibility. If you don’t specify a value, the qualification procedure selected on the Product Discovery Settings page from Setup is used. |
transactionContextId | string | Context ID of the transaction. |
transactionId | string | ID of the transaction. |
usePromotions | boolean | Indicates whether to fetch promotions for recommended products (true) or not (false). Applies only when promotions are enabled for the org. |
userContext | Apex-defined | An Apex ConnectApi.UserContextInputRepresentation record that contains the user details used to evaluate product eligibility and calculate prices. |
| Output | Type | Description |
|---|---|---|
errorMessages | Apex-defined | A list of Apex runtime_industries_cpq.ProductRecommendationErrorsOutputRepresentation records that contain error codes and messages returned by the action. |
isSuccessful | boolean | Indicates whether the action call succeeded (true) or not (false). |
nextCursor | string | Unique identifier that represents the position of the next product in the dataset. Use this value as an input to retrieve the next page of results. |
recommendedProducts | Apex-defined | A list of Apex runtime_industries_cpq.RecommendedProductsOutputRepresentation records that contain the recommended products returned by the Constraint Rule Engine. |
transactionContextId | string | Context ID of the transaction. |
Here’s a sample input to call this invocable action from Apex code.
Here’s a sample response for the Get Product Recommendations action.