Search Product with Guided Selection Action

Use guided product selection to search for products.

This action is available in API version 64.0 and later.

You can invoke this action via Apex and Flows only.

Special Access Rules 

The Search Product with Guided Selection action is available in Enterprise, Unlimited, and Developer Editions where Product Discovery is enabled.

Inputs 

InputTypeDescription
additionalContextDataApex-definedCollection of Apex runtime_industries_cpq.AdditionalContextData records that contain the nodes used in addition to context definition nodes for data hydration. This parameter can contain up to 10 nodes.
additionalFieldsApex-definedAn Apex runtime_industries_cpq.AdditionalFields record that contains the collection of additional fields to be included in the response. This parameter supports only the fields from the Product2 and ProductAttributeDefinition objects. The fields defined for the ProductAttributeDefinition object must also be available on the ProductClassificationAttr object.
catalogIdstringID of the catalog to find and retrieve products.
categoryIdstringID of the category or subcategory to find and retrieve products.
contextDefinitionstringAPI name of the context definition that’s used for context creation. If you don’t specify a value, the context selected on the Product Discovery Settings page is used.
contextMappingstringAPI name of the context mapping that’s used for data hydration. The value of this parameter is used only if it belongs to the specified context definition.
correlationIdstringUnique ID that’s used to reference a series of related actions.
currencyCodestringCurrency code that’s used to calculate and show prices. Only the products with the currency code matching the entered currency code are fetched.
executeConfigurationRulesbooleanIndicates whether configuration rules must run ( true ) or not ( false ). Available in API version 67.0 and later.
enablePricingbooleanIndicates whether pricing procedure must run ( true ) or not ( false ). The default value is true. To use this parameter, the Pricing Procedure setting must be enabled.
enableQualificationbooleanIndicates whether qualification procedure must run ( true ) or not ( false ). The default value is true. To use this parameter, the Qualification Procedure setting must be enabled.
filterInputRepresentationApex-definedAn Apex runtime_industries_cpq.FilterInputRepresentation record that contains the filter criteria. This parameter supports only the name property and the eq , in , or contains operators. If it contains multiple criteria, all the criteria are applied.
guidedSelectionResponseIdstringResponse identifier that stores user responses specified in the guided product selection window.
includeCatalogDetailsbooleanIndicates whether catalog details must be included in the response ( true ) or not ( false ).
orderBystringComma-delimited string of key-value pairs that specify how results are sorted. Each string must contain a field name and its sort order. For example, [“name:asc”,”custom_field:asc”].
priceBookIdstringID of the pricebook that the pricing information is retrieved from.
pricingProcedurestringAPI name of the pricing procedure to calculate product prices. If you don’t specify a value, the pricing procedure selected on the Product Discovery Settings page is used.
productClassificationIdstringID of the product classification that’s used to filter products.
productCursorstringUnique identifier that represents the position of the product from which the next set of results are retrieved.
qualificationProcedurestringAPI name of the qualification procedure to evaluate product eligibility. If you don’t specify a value, the qualification procedure selected on the Product Discovery Settings page is used.
recordLimitintegerMaximum number of results to be returned in the response. Specify a value from 1 through 100. Default value is 10.
relatedObjectFiltersApex-definedCollection of Apex runtime_industries_cpq.RelatedObjectFilterInputRepresentation records, each containing a related object and the filter criteria that’s applied on the object.
searchTermsApex-definedCollection of terms that are used to search products. See GuidedSelectionSearchTerm.
transactionContextIdstringContext ID of the quote or order. Available in API version 67.0 and later.
transactionIdstringID of the quote or order. Available in API version 67.0 and later.
userContextApex-definedAn Apex ConnectApi.UserContextInputRepresentation record containing user information to evaluate product eligibility and calculate pricing.

Outputs 

OutputTypeDescription
apiStatusOutputRepresentationApex-definedAn Apex runtime_industries_cpq.ApiStatusRepresentation record that contains the status of the request, including the status code and message.
contextIdstringID of the context that’s created by using the specified context definition.
correlationIdstringUnique identifier attached to requests and messages, allowing reference to a specific transaction or event chain.
productCursorstringUnique identifier that represents the position of the product from which the next set of results are retrieved.
productListOutputRepresentationsApex-definedCollection of Apex ProductListOutputRepresentation records that contain details about the product shown by the Guided Product Selection.
recordOffsetintegerNumber of catalog records to skip in the request. The default is 0.
searchTermsApex-definedCollection of terms that are used to search products. See GuidedSelectionSearchTerm.
userContextApex-definedAn Apex ConnectApi.UserContextRepresentation record containing user information.

Example 

Here’s a sample input to call this invocable action from Apex code.

1Invocable.Action action = Invocable.Action.createStandardAction('searchPrdctWithGuidedSelection');
2
3action.setInvocationParameter('correlationId', '77f9dc6a-8ecc-44a3-8d89-4050179cc846');
4//action.setInvocationParameter('catalogId', '0ZSxx000000004sGAA');
5action.setInvocationParameter('guidedSelectionResponseId', '0U3xx0000004CPACA2');
6//action.setInvocationParameter('priceBookId', '01sxx0000005pyfAAA');
7//action.setInvocationParameter('categoryId', '0ZGxx000000004rGAA');
8action.setInvocationParameter('enableQualification', true);
9action.setInvocationParameter('enablePricing', true);
10//action.setInvocationParameter('contextDefinition', 'PDACDCtx');
11//action.setInvocationParameter('contextMapping', 'ProductDiscoveryMapping');
12//action.setInvocationParameter('qualificationProcedure', 'PDQualProceWithQuote');
13//action.setInvocationParameter('pricingProcedure', 'IconpricingProcedure');
14action.setInvocationParameter('includeCatalogDetails', true);
15action.setInvocationParameter('currencyCode', 'USD');
16action.setInvocationParameter('executeConfigurationRules', true);
17List<String> orderByInputs = new List<String>();
18orderByInputs.add('name:asc');
19orderByInputs.add('id:desc');
20action.setInvocationParameter('orderBy', orderByInputs);
21List<runtime_industries_cpq.GuidedSelectionSearchTerm> searchTerms = new List<runtime_industries_cpq.GuidedSelectionSearchTerm>();
22runtime_industries_cpq.GuidedSelectionSearchTerm searchTerm = new runtime_industries_cpq.GuidedSelectionSearchTerm();
23searchTerm.term = 'Laptop Basic Bundle';
24List<String> tags = new List<String>();
25tags.add('Laptop');
26tags.add('Desktop');
27searchTerm.tags = tags;
28searchTerms.add(searchTerm);
29
30runtime_industries_cpq.GuidedSelectionSearchTermList searchTermList = new runtime_industries_cpq.GuidedSelectionSearchTermList();
31searchTermList.searchTerms = searchTerms;
32action.setInvocationParameter('searchTerms', searchTermList);
33List<Invocable.Action.Result> results = action.invoke();
34System.debug('Guided Selection result = ' + results);

Here’s a sample response when you call this action.

1{
2  "recordOffset": 5,
3  "contextId": null,
4  "correlationId": "854c487d-183e-40b6-ba42-f079a6e695a3",
5  "apiStatusOutputRepresentation": {
6    "statusMessage": null,
7    "statusCode": "FetchedDetailsSuccessfully",
8    "messages": []
9  },
10  "searchTerms": [
11    {
12      "term": "Additional API",
13      "tags": []
14    }
15  ],
16  "productListOutputRepresentations": [
17    {
18      "unitOfMeasure": null,
19      "status": null,
20      "qualificationContext": {
21        "reason": null,
22        "isQualified": true
23      },
24      "productType": null,
25      "productSpecificationType": null,
26      "productSellingModelOptions": [
27        {
28          "productSellingModelId": "0jPVW0000001fh32AA",
29          "productSellingModel": {
30            "status": "Active",
31            "sellingModelType": "TermDefined",
32            "pricingTermUnit": "Annual",
33            "pricingTerm": 1,
34            "name": "Term Annual",
35            "id": "0jPVW0000001fh32AA"
36          },
37          "productId": "01tVW000003l7txYAA",
38          "id": "0iOVW00000049w22AA"
39        },
40        {
41          "productSellingModelId": "0jPVW0000001fh52AA",
42          "productSellingModel": {
43            "status": "Active",
44            "sellingModelType": "Evergreen",
45            "pricingTermUnit": "Months",
46            "pricingTerm": 1,
47            "name": "Evergreen Monthly",
48            "id": "0jPVW0000001fh52AA"
49          },
50          "productId": "01tVW000003l7txYAA",
51          "id": "0iOVW00000049w12AA"
52        },
53        {
54          "productSellingModelId": "0jPVW0000001fh62AA",
55          "productSellingModel": {
56            "status": "Active",
57            "sellingModelType": "TermDefined",
58            "pricingTermUnit": "Months",
59            "pricingTerm": 1,
60            "name": "Term Monthly",
61            "id": "0jPVW0000001fh62AA"
62          },
63          "productId": "01tVW000003l7txYAA",
64          "id": "0iOVW00000049w32AA"
65        }
66      ],
67      "productRelatedComponent": null,
68      "productQuantity": null,
69      "productPricingInformation": null,
70      "productInformation": null,
71      "productComponentGroups": [],
72      "productCode": "QB-API",
73      "productClassification": {
74        "id": "11BVW000004ljiZ2AQ"
75      },
76      "prices": [
77        {
78          "pricingModel": {
79            "unitOfMeasure": null,
80            "pricingModelType": "TermDefined",
81            "occurrence": 1,
82            "name": "Term Annual",
83            "id": "0jPVW0000001fh32AA",
84            "frequency": "Annual"
85          },
86          "priceBookId": "01sVW0000024PZlYAM",
87          "priceBookEntryId": "01uVW000000jzfGYAQ",
88          "price": 15000,
89          "isSelected": false,
90          "isDerived": false,
91          "isDefault": true,
92          "effectiveTo": null,
93          "effectiveFrom": null,
94          "currencyIsoCode": "USD"
95        },
96        {
97          "pricingModel": {
98            "unitOfMeasure": null,
99            "pricingModelType": "Evergreen",
100            "occurrence": 1,
101            "name": "Evergreen Monthly",
102            "id": "0jPVW0000001fh52AA",
103            "frequency": "Months"
104          },
105          "priceBookId": "01sVW0000024PZlYAM",
106          "priceBookEntryId": "01uVW000000jzg8YAA",
107          "price": 2000,
108          "isSelected": false,
109          "isDerived": false,
110          "isDefault": false,
111          "effectiveTo": null,
112          "effectiveFrom": null,
113          "currencyIsoCode": "USD"
114        },
115        {
116          "pricingModel": {
117            "unitOfMeasure": null,
118            "pricingModelType": "TermDefined",
119            "occurrence": 1,
120            "name": "Term Monthly",
121            "id": "0jPVW0000001fh62AA",
122            "frequency": "Months"
123          },
124          "priceBookId": "01sVW0000024PZlYAM",
125          "priceBookEntryId": "01uVW000000jzg9YAA",
126          "price": 1500,
127          "isSelected": false,
128          "isDerived": false,
129          "isDefault": false,
130          "effectiveTo": null,
131          "effectiveFrom": null,
132          "currencyIsoCode": "USD"
133        }
134      ],
135      "nodeType": "simpleProduct",
136      "name": "Additional API",
137      "isSoldOnlyWithOtherProds": false,
138      "isQuantityEditable": null,
139      "isDefaultComponent": null,
140      "isComponentRequired": null,
141      "isAssetizable": true,
142      "isActive": true,
143      "id": "01tVW000003l7txYAA",
144      "endOfLifeDate": null,
145      "displayUrl": "/resource/add_api",
146      "discontinuedDate": null,
147      "description": null,
148      "configureDuringSale": "Allowed",
149      "configurationRules": [
150        {
151          "type": "disable",
152          "details": [
153            {
154              "message": "This is disabled"
155            }
156          ]
157        }
158      ],
159      "childProducts": [],
160      "categories": [
161        {
162          "sortOrder": null,
163          "qualificationContext": {
164            "reason": null,
165            "isQualified": true
166          },
167          "parentCategoryId": null,
168          "name": "API",
169          "isNavigational": null,
170          "id": "0ZGVW000000IUEG4A4",
171          "hasSubCategories": null,
172          "description": null,
173          "childCategories": null,
174          "catalogId": "0ZSVW000000AhdB4AS"
175        }
176      ],
177      "catalogs": [],
178      "availabilityDate": null,
179      "attributeCategories": [],
180      "additionalFields": []
181    },
182    {
183      "unitOfMeasure": null,
184      "status": null,
185      "qualificationContext": {
186        "reason": null,
187        "isQualified": true
188      },
189      "productType": null,
190      "productSpecificationType": null,
191      "productSellingModelOptions": [
192        {
193          "productSellingModelId": "0jPVW0000001fh32AA",
194          "productSellingModel": {
195            "status": "Active",
196            "sellingModelType": "TermDefined",
197            "pricingTermUnit": "Annual",
198            "pricingTerm": 1,
199            "name": "Term Annual",
200            "id": "0jPVW0000001fh32AA"
201          },
202          "productId": "01tVW000003l7tyYAA",
203          "id": "0iOVW00000049w42AA"
204        }
205      ],
206      "productRelatedComponent": null,
207      "productQuantity": null,
208      "productPricingInformation": null,
209      "productInformation": null,
210      "productComponentGroups": [],
211      "productCode": "QB-API-FLEX",
212      "productClassification": {
213        "id": null
214      },
215      "prices": [
216        {
217          "pricingModel": {
218            "unitOfMeasure": null,
219            "pricingModelType": "TermDefined",
220            "occurrence": 1,
221            "name": "Term Annual",
222            "id": "0jPVW0000001fh32AA",
223            "frequency": "Annual"
224          },
225          "priceBookId": "01sVW0000024PZlYAM",
226          "priceBookEntryId": "01uVW000000jzfFYAQ",
227          "price": 450,
228          "isSelected": false,
229          "isDerived": false,
230          "isDefault": true,
231          "effectiveTo": null,
232          "effectiveFrom": null,
233          "currencyIsoCode": "USD"
234        }
235      ],
236      "nodeType": "simpleProduct",
237      "name": "Additional API Flex (100M)",
238      "isSoldOnlyWithOtherProds": false,
239      "isQuantityEditable": null,
240      "isDefaultComponent": null,
241      "isComponentRequired": null,
242      "isAssetizable": true,
243      "isActive": true,
244      "id": "01tVW000003l7tyYAA",
245      "endOfLifeDate": null,
246      "displayUrl": "/resource/api_flex",
247      "discontinuedDate": null,
248      "description": "API instances remain under management until they are deleted. Instances of API Manager are aggregated using a Max Concurrent model. The usage for a month is the highest number of APIs Managed in a single given hour during a month.",
249      "configureDuringSale": null,
250      "configurationRules": [],
251      "childProducts": [],
252      "categories": [
253        {
254          "sortOrder": null,
255          "qualificationContext": {
256            "reason": null,
257            "isQualified": true
258          },
259          "parentCategoryId": null,
260          "name": "API",
261          "isNavigational": null,
262          "id": "0ZGVW000000IUEG4A4",
263          "hasSubCategories": null,
264          "description": null,
265          "childCategories": null,
266          "catalogId": "0ZSVW000000AhdB4AS"
267        }
268      ],
269      "catalogs": [],
270      "availabilityDate": null,
271      "attributeCategories": [],
272      "additionalFields": []
273    },
274    {
275      "unitOfMeasure": null,
276      "status": null,
277      "qualificationContext": {
278        "reason": null,
279        "isQualified": true
280      },
281      "productType": null,
282      "productSpecificationType": null,
283      "productSellingModelOptions": [
284        {
285          "productSellingModelId": "0jPVW0000001fh32AA",
286          "productSellingModel": {
287            "status": "Active",
288            "sellingModelType": "TermDefined",
289            "pricingTermUnit": "Annual",
290            "pricingTerm": 1,
291            "name": "Term Annual",
292            "id": "0jPVW0000001fh32AA"
293          },
294          "productId": "01tVW000003l7tzYAA",
295          "id": "0iOVW00000049w52AA"
296        }
297      ],
298      "productRelatedComponent": null,
299      "productQuantity": null,
300      "productPricingInformation": null,
301      "productInformation": null,
302      "productComponentGroups": [],
303      "productCode": "QB-API-GOVT",
304      "productClassification": {
305        "id": null
306      },
307      "prices": [
308        {
309          "pricingModel": {
310            "unitOfMeasure": null,
311            "pricingModelType": "TermDefined",
312            "occurrence": 1,
313            "name": "Term Annual",
314            "id": "0jPVW0000001fh32AA",
315            "frequency": "Annual"
316          },
317          "priceBookId": "01sVW0000024PZlYAM",
318          "priceBookEntryId": "01uVW000000jzfHYAQ",
319          "price": 1450,
320          "isSelected": false,
321          "isDerived": false,
322          "isDefault": true,
323          "effectiveTo": null,
324          "effectiveFrom": null,
325          "currencyIsoCode": "USD"
326        }
327      ],
328      "nodeType": "simpleProduct",
329      "name": "Additional API Gov",
330      "isSoldOnlyWithOtherProds": false,
331      "isQuantityEditable": null,
332      "isDefaultComponent": null,
333      "isComponentRequired": null,
334      "isAssetizable": true,
335      "isActive": true,
336      "id": "01tVW000003l7tzYAA",
337      "endOfLifeDate": null,
338      "displayUrl": "/resource/api_govt",
339      "discontinuedDate": null,
340      "description": "API instances remain under management until they are deleted. Instances of API Manager are aggregated using a Max Concurrent model. The usage for a month is the highest number of APIs Managed in a single given hour during a month.",
341      "configureDuringSale": null,
342      "configurationRules": [],
343      "childProducts": [],
344      "categories": [
345        {
346          "sortOrder": null,
347          "qualificationContext": {
348            "reason": null,
349            "isQualified": true
350          },
351          "parentCategoryId": null,
352          "name": "API",
353          "isNavigational": null,
354          "id": "0ZGVW000000IUEG4A4",
355          "hasSubCategories": null,
356          "description": null,
357          "childCategories": null,
358          "catalogId": "0ZSVW000000AhdB4AS"
359        }
360      ],
361      "catalogs": [],
362      "availabilityDate": null,
363      "attributeCategories": [],
364      "additionalFields": []
365    },
366    {
367      "unitOfMeasure": null,
368      "status": null,
369      "qualificationContext": {
370        "reason": null,
371        "isQualified": true
372      },
373      "productType": null,
374      "productSpecificationType": null,
375      "productSellingModelOptions": [
376        {
377          "productSellingModelId": "0jPVW0000001fh32AA",
378          "productSellingModel": {
379            "status": "Active",
380            "sellingModelType": "TermDefined",
381            "pricingTermUnit": "Annual",
382            "pricingTerm": 1,
383            "name": "Term Annual",
384            "id": "0jPVW0000001fh32AA"
385          },
386          "productId": "01tVW000003l7u0YAA",
387          "id": "0iOVW00000049w92AA"
388        }
389      ],
390      "productRelatedComponent": null,
391      "productQuantity": null,
392      "productPricingInformation": null,
393      "productInformation": null,
394      "productComponentGroups": [],
395      "productCode": "QB-API-PREP",
396      "productClassification": {
397        "id": null
398      },
399      "prices": [
400        {
401          "pricingModel": {
402            "unitOfMeasure": null,
403            "pricingModelType": "TermDefined",
404            "occurrence": 1,
405            "name": "Term Annual",
406            "id": "0jPVW0000001fh32AA",
407            "frequency": "Annual"
408          },
409          "priceBookId": "01sVW0000024PZlYAM",
410          "priceBookEntryId": "01uVW000000jzfSYAQ",
411          "price": 3240,
412          "isSelected": false,
413          "isDerived": false,
414          "isDefault": true,
415          "effectiveTo": null,
416          "effectiveFrom": null,
417          "currencyIsoCode": "USD"
418        }
419      ],
420      "nodeType": "simpleProduct",
421      "name": "Additional API Pre-Prod",
422      "isSoldOnlyWithOtherProds": false,
423      "isQuantityEditable": null,
424      "isDefaultComponent": null,
425      "isComponentRequired": null,
426      "isAssetizable": true,
427      "isActive": true,
428      "id": "01tVW000003l7u0YAA",
429      "endOfLifeDate": null,
430      "displayUrl": "/resource/api_preprod",
431      "discontinuedDate": null,
432      "description": "API instances remain under management until they are deleted. Instances of API Manager are aggregated using a Max Concurrent model. The usage for a month is the highest number of APIs Managed in a single given hour during a month.",
433      "configureDuringSale": null,
434      "configurationRules": [],
435      "childProducts": [],
436      "categories": [
437        {
438          "sortOrder": null,
439          "qualificationContext": {
440            "reason": null,
441            "isQualified": true
442          },
443          "parentCategoryId": null,
444          "name": "API",
445          "isNavigational": null,
446          "id": "0ZGVW000000IUEG4A4",
447          "hasSubCategories": null,
448          "description": null,
449          "childCategories": null,
450          "catalogId": "0ZSVW000000AhdB4AS"
451        }
452      ],
453      "catalogs": [],
454      "availabilityDate": null,
455      "attributeCategories": [],
456      "additionalFields": []
457    },
458    {
459      "unitOfMeasure": null,
460      "status": null,
461      "qualificationContext": {
462        "reason": null,
463        "isQualified": true
464      },
465      "productType": null,
466      "productSpecificationType": null,
467      "productSellingModelOptions": [
468        {
469          "productSellingModelId": "0jPVW0000001fh32AA",
470          "productSellingModel": {
471            "status": "Active",
472            "sellingModelType": "TermDefined",
473            "pricingTermUnit": "Annual",
474            "pricingTerm": 1,
475            "name": "Term Annual",
476            "id": "0jPVW0000001fh32AA"
477          },
478          "productId": "01tVW000003l7u1YAA",
479          "id": "0iOVW00000049wA2AQ"
480        }
481      ],
482      "productRelatedComponent": null,
483      "productQuantity": null,
484      "productPricingInformation": null,
485      "productInformation": null,
486      "productComponentGroups": [],
487      "productCode": "QB-API-PROD",
488      "productClassification": {
489        "id": null
490      },
491      "prices": [
492        {
493          "pricingModel": {
494            "unitOfMeasure": null,
495            "pricingModelType": "TermDefined",
496            "occurrence": 1,
497            "name": "Term Annual",
498            "id": "0jPVW0000001fh32AA",
499            "frequency": "Annual"
500          },
501          "priceBookId": "01sVW0000024PZlYAM",
502          "priceBookEntryId": "01uVW000000jzfdYAA",
503          "price": 3240,
504          "isSelected": false,
505          "isDerived": false,
506          "isDefault": true,
507          "effectiveTo": null,
508          "effectiveFrom": null,
509          "currencyIsoCode": "USD"
510        }
511      ],
512      "nodeType": "simpleProduct",
513      "name": "Additional API Prod",
514      "isSoldOnlyWithOtherProds": false,
515      "isQuantityEditable": null,
516      "isDefaultComponent": null,
517      "isComponentRequired": null,
518      "isAssetizable": true,
519      "isActive": true,
520      "id": "01tVW000003l7u1YAA",
521      "endOfLifeDate": null,
522      "displayUrl": "/resource/api_prod",
523      "discontinuedDate": null,
524      "description": "API instances remain under management until they are deleted. Instances of API Manager are aggregated using a Max Concurrent model. The usage for a month is the highest number of APIs Managed in a single given hour during a month.",
525      "configureDuringSale": null,
526      "configurationRules": [],
527      "childProducts": [],
528      "categories": [
529        {
530          "sortOrder": null,
531          "qualificationContext": {
532            "reason": null,
533            "isQualified": true
534          },
535          "parentCategoryId": null,
536          "name": "API",
537          "isNavigational": null,
538          "id": "0ZGVW000000IUEG4A4",
539          "hasSubCategories": null,
540          "description": null,
541          "childCategories": null,
542          "catalogId": "0ZSVW000000AhdB4AS"
543        }
544      ],
545      "catalogs": [],
546      "availabilityDate": null,
547      "attributeCategories": [],
548      "additionalFields": []
549    }
550  ]
551}