Get Products Action

Get products from the specified catalog, category, or subcategory, including product qualification and pricing details.

If a catalog, category, or subcategory isn’t specified, then this action retrieves all the products from all catalogs. This action is available in API version 62.0 and later.

You can invoke this action via Apex and Flows only.

Special Access Rules 

The Get Products action is available in Enterprise, Unlimited, and Developer Editions where Product Discovery is enabled.

Inputs 

InputTypeDescription
additionalContextDataApex-definedAn array of Apex runtime_industries_cpq.AdditionalContextData records that contain the additional nodes that are used along with the context definition nodes for data hydration. The maximum number of supported nodes is 10.
additionalFieldsApex-definedAn Apex runtime_industries_cpq.AdditionalFields record that contains an array of additional standard or custom fields to include in the response. The supported objects are Product2 or ProductAttributeDefinition—If the fields defined for the ProductAttributeDefinition object aren’t available for the ProductClassificationAttr object, then the API request fails.
catalogIdstringCatalog ID that’s used to find and retrieve the products.
categoryIdstringID of the category or subcategory to get the products for.
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 from Setup 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 specified currency code are fetched.
cursorstringUnique identifier that represents the position of the product from which the next set of results are retrieved.
enablePricingbooleanIndicates whether the pricing procedure must run (true) or not (false). The default value is true. To use this parameter, you must enable the Pricing Procedure setting from Setup.
enableQualificationbooleanIndicates whether the qualification procedure must run (true) or not (false). The default value is true. To use this parameter, you must enable the Qualification Procedure setting from Setup.
executeConfigurationRulesbooleanIndicates whether configuration rules must run (true) or not (false). Available in API version 67.0 and later.
filterApex-definedA collection of Apex runtime_industries_cpq.FilterInputRepresentation records where each record contains a related object and the filter criteria that’s applied on the object. The filter parameter supports only the name property. The supported operators are eq, in, or contains. If this parameter contains multiple criteria, all the criteria are applied.
includeCatalogDetailsbooleanIndicates whether catalog details must be included in the response (true) or not (false).
limitintegerMaximum number of results to be returned in the response. Specify a value from 1 through 100. The default value is 10.
orderBystringComma-separated string of key-value pairs that specify how the 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 details are 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 from Setup is used.
productClassificationIdstringID of the product classification that’s used to filter the products.
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 from Setup is used.
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.
relatedObjectFiltersApex-definedA collection of Apex runtime_industries_cpq.RelatedObjectFilterInputRepresentation records, where each record contains a related object and the filter criteria that’s applied on the object.
userContextApex-definedAn Apex ConnectApi.UserContextInputRepresentation record that contains the user details to evaluate product eligibility and calculate prices.

Outputs 

OutputTypeDescription
apiStatusApex-definedAn Apex runtime_industries_cpq.ApiStatusRepresentation record that contains a status code and message.
contextIdstringID of the context that’s created by using the specified context definition.
correlationIdstringID to reference a series of related actions.
cursorstringUnique identifier that represents the position of the product from which the next set of results are retrieved.
resultsApex-definedAn Apex runtime_industries_cpq.ProductListRepresentation record that contains the retrieved products.
userContextApex-definedAn Apex ConnectApi.UserContextRepresentation record that includes the user details.

Example 

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

1Invocable.Action action = Invocable.Action.createStandardAction('getProducts');
2action.setInvocationParameter('executeConfigurationRules', true);
3action.setInvocationParameter('catalogId', '0ZSVW000000AhdB4AS');
4action.setInvocationParameter('transactionId', '0Q0VW0000018J6X0AU');
5List<String> orderBy = new List<String>();
6orderBy.add('name:asc');
7action.setInvocationParameter('orderBy', orderBy);
8List<Invocable.Action.Result> results = action.invoke();
9
10for (Invocable.Action.Result res : results) {
11    if (res.isSuccess()) {
12        Map<String, Object> outMap = res.getOutputParameters();
13        String jsonOutput = JSON.serialize(outMap);	
14        System.debug(jsonOutput);
15    }
16}

Here’s a sample response for this action.

1{
2  "facets": [],
3  "apiStatus": {
4    "statusMessage": null,
5    "statusCode": "FetchedDetailsSuccessfully",
6    "messages": []
7  },
8  "results": [
9    {
10      "unitOfMeasure": null,
11      "status": null,
12      "qualificationContext": {
13        "reason": null,
14        "isQualified": true
15      },
16      "productType": null,
17      "productSpecificationType": null,
18      "productSellingModelOptions": [
19        {
20          "productSellingModelId": "0jPVW0000001fh32AA",
21          "productSellingModel": {
22            "status": "Active",
23            "sellingModelType": "TermDefined",
24            "pricingTermUnit": "Annual",
25            "pricingTerm": 1,
26            "name": "Term Annual",
27            "id": "0jPVW0000001fh32AA"
28          },
29          "productId": "01tVW000003l7txYAA",
30          "id": "0iOVW00000049w22AA"
31        },
32        {
33          "productSellingModelId": "0jPVW0000001fh52AA",
34          "productSellingModel": {
35            "status": "Active",
36            "sellingModelType": "Evergreen",
37            "pricingTermUnit": "Months",
38            "pricingTerm": 1,
39            "name": "Evergreen Monthly",
40            "id": "0jPVW0000001fh52AA"
41          },
42          "productId": "01tVW000003l7txYAA",
43          "id": "0iOVW00000049w12AA"
44        },
45        {
46          "productSellingModelId": "0jPVW0000001fh62AA",
47          "productSellingModel": {
48            "status": "Active",
49            "sellingModelType": "TermDefined",
50            "pricingTermUnit": "Months",
51            "pricingTerm": 1,
52            "name": "Term Monthly",
53            "id": "0jPVW0000001fh62AA"
54          },
55          "productId": "01tVW000003l7txYAA",
56          "id": "0iOVW00000049w32AA"
57        }
58      ],
59      "productRelatedComponent": null,
60      "productQuantity": null,
61      "productPricingInformation": null,
62      "productInformation": null,
63      "productComponentGroups": [],
64      "productCode": "QB-API",
65      "productClassification": {
66        "id": "11BVW000004ljiZ2AQ"
67      },
68      "prices": [
69        {
70          "pricingModel": {
71            "unitOfMeasure": null,
72            "pricingModelType": "TermDefined",
73            "occurrence": 1,
74            "name": "Term Annual",
75            "id": "0jPVW0000001fh32AA",
76            "frequency": "Annual"
77          },
78          "priceBookId": "01sVW0000024PZlYAM",
79          "priceBookEntryId": "01uVW000000jzfGYAQ",
80          "price": 15000,
81          "isSelected": false,
82          "isDerived": false,
83          "isDefault": true,
84          "effectiveTo": null,
85          "effectiveFrom": null,
86          "currencyIsoCode": "USD"
87        },
88        {
89          "pricingModel": {
90            "unitOfMeasure": null,
91            "pricingModelType": "Evergreen",
92            "occurrence": 1,
93            "name": "Evergreen Monthly",
94            "id": "0jPVW0000001fh52AA",
95            "frequency": "Months"
96          },
97          "priceBookId": "01sVW0000024PZlYAM",
98          "priceBookEntryId": "01uVW000000jzg8YAA",
99          "price": 2000,
100          "isSelected": false,
101          "isDerived": false,
102          "isDefault": false,
103          "effectiveTo": null,
104          "effectiveFrom": null,
105          "currencyIsoCode": "USD"
106        },
107        {
108          "pricingModel": {
109            "unitOfMeasure": null,
110            "pricingModelType": "TermDefined",
111            "occurrence": 1,
112            "name": "Term Monthly",
113            "id": "0jPVW0000001fh62AA",
114            "frequency": "Months"
115          },
116          "priceBookId": "01sVW0000024PZlYAM",
117          "priceBookEntryId": "01uVW000000jzg9YAA",
118          "price": 1500,
119          "isSelected": false,
120          "isDerived": false,
121          "isDefault": false,
122          "effectiveTo": null,
123          "effectiveFrom": null,
124          "currencyIsoCode": "USD"
125        }
126      ],
127      "nodeType": "simpleProduct",
128      "name": "Additional API",
129      "isSoldOnlyWithOtherProds": false,
130      "isQuantityEditable": null,
131      "isDefaultComponent": null,
132      "isComponentRequired": null,
133      "isAssetizable": true,
134      "isActive": true,
135      "id": "01tVW000003l7txYAA",
136      "endOfLifeDate": null,
137      "displayUrl": "/resource/add_api",
138      "discontinuedDate": null,
139      "description": null,
140      "configureDuringSale": "Allowed",
141      "configurationRules": [
142        {
143          "type": "disable",
144          "details": [
145            {
146              "message": "This is disabled"
147            }
148          ]
149        }
150      ],
151      "childProducts": [],
152      "categories": [
153        {
154          "sortOrder": null,
155          "qualificationContext": {
156            "reason": null,
157            "isQualified": true
158          },
159          "parentCategoryId": null,
160          "name": "API",
161          "isNavigational": null,
162          "id": "0ZGVW000000IUEG4A4",
163          "hasSubCategories": null,
164          "description": null,
165          "childCategories": null,
166          "catalogId": "0ZSVW000000AhdB4AS"
167        }
168      ],
169      "catalogs": [],
170      "availabilityDate": null,
171      "attributeCategories": [],
172      "additionalFields": []
173    },
174    {
175      "unitOfMeasure": null,
176      "status": null,
177      "qualificationContext": {
178        "reason": null,
179        "isQualified": true
180      },
181      "productType": null,
182      "productSpecificationType": null,
183      "productSellingModelOptions": [
184        {
185          "productSellingModelId": "0jPVW0000001fh32AA",
186          "productSellingModel": {
187            "status": "Active",
188            "sellingModelType": "TermDefined",
189            "pricingTermUnit": "Annual",
190            "pricingTerm": 1,
191            "name": "Term Annual",
192            "id": "0jPVW0000001fh32AA"
193          },
194          "productId": "01tVW000003l7tyYAA",
195          "id": "0iOVW00000049w42AA"
196        }
197      ],
198      "productRelatedComponent": null,
199      "productQuantity": null,
200      "productPricingInformation": null,
201      "productInformation": null,
202      "productComponentGroups": [],
203      "productCode": "QB-API-FLEX",
204      "productClassification": {
205        "id": null
206      },
207      "prices": [
208        {
209          "pricingModel": {
210            "unitOfMeasure": null,
211            "pricingModelType": "TermDefined",
212            "occurrence": 1,
213            "name": "Term Annual",
214            "id": "0jPVW0000001fh32AA",
215            "frequency": "Annual"
216          },
217          "priceBookId": "01sVW0000024PZlYAM",
218          "priceBookEntryId": "01uVW000000jzfFYAQ",
219          "price": 450,
220          "isSelected": false,
221          "isDerived": false,
222          "isDefault": true,
223          "effectiveTo": null,
224          "effectiveFrom": null,
225          "currencyIsoCode": "USD"
226        }
227      ],
228      "nodeType": "simpleProduct",
229      "name": "Additional API Flex (100M)",
230      "isSoldOnlyWithOtherProds": false,
231      "isQuantityEditable": null,
232      "isDefaultComponent": null,
233      "isComponentRequired": null,
234      "isAssetizable": true,
235      "isActive": true,
236      "id": "01tVW000003l7tyYAA",
237      "endOfLifeDate": null,
238      "displayUrl": "/resource/api_flex",
239      "discontinuedDate": null,
240      "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.",
241      "configureDuringSale": null,
242      "configurationRules": [],
243      "childProducts": [],
244      "categories": [
245        {
246          "sortOrder": null,
247          "qualificationContext": {
248            "reason": null,
249            "isQualified": true
250          },
251          "parentCategoryId": null,
252          "name": "API",
253          "isNavigational": null,
254          "id": "0ZGVW000000IUEG4A4",
255          "hasSubCategories": null,
256          "description": null,
257          "childCategories": null,
258          "catalogId": "0ZSVW000000AhdB4AS"
259        }
260      ],
261      "catalogs": [],
262      "availabilityDate": null,
263      "attributeCategories": [],
264      "additionalFields": []
265    },
266    {
267      "unitOfMeasure": null,
268      "status": null,
269      "qualificationContext": {
270        "reason": null,
271        "isQualified": true
272      },
273      "productType": null,
274      "productSpecificationType": null,
275      "productSellingModelOptions": [
276        {
277          "productSellingModelId": "0jPVW0000001fh32AA",
278          "productSellingModel": {
279            "status": "Active",
280            "sellingModelType": "TermDefined",
281            "pricingTermUnit": "Annual",
282            "pricingTerm": 1,
283            "name": "Term Annual",
284            "id": "0jPVW0000001fh32AA"
285          },
286          "productId": "01tVW000003l7tzYAA",
287          "id": "0iOVW00000049w52AA"
288        }
289      ],
290      "productRelatedComponent": null,
291      "productQuantity": null,
292      "productPricingInformation": null,
293      "productInformation": null,
294      "productComponentGroups": [],
295      "productCode": "QB-API-GOVT",
296      "productClassification": {
297        "id": null
298      },
299      "prices": [
300        {
301          "pricingModel": {
302            "unitOfMeasure": null,
303            "pricingModelType": "TermDefined",
304            "occurrence": 1,
305            "name": "Term Annual",
306            "id": "0jPVW0000001fh32AA",
307            "frequency": "Annual"
308          },
309          "priceBookId": "01sVW0000024PZlYAM",
310          "priceBookEntryId": "01uVW000000jzfHYAQ",
311          "price": 1450,
312          "isSelected": false,
313          "isDerived": false,
314          "isDefault": true,
315          "effectiveTo": null,
316          "effectiveFrom": null,
317          "currencyIsoCode": "USD"
318        }
319      ],
320      "nodeType": "simpleProduct",
321      "name": "Additional API Gov",
322      "isSoldOnlyWithOtherProds": false,
323      "isQuantityEditable": null,
324      "isDefaultComponent": null,
325      "isComponentRequired": null,
326      "isAssetizable": true,
327      "isActive": true,
328      "id": "01tVW000003l7tzYAA",
329      "endOfLifeDate": null,
330      "displayUrl": "/resource/api_govt",
331      "discontinuedDate": null,
332      "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.",
333      "configureDuringSale": null,
334      "configurationRules": [],
335      "childProducts": [],
336      "categories": [
337        {
338          "sortOrder": null,
339          "qualificationContext": {
340            "reason": null,
341            "isQualified": true
342          },
343          "parentCategoryId": null,
344          "name": "API",
345          "isNavigational": null,
346          "id": "0ZGVW000000IUEG4A4",
347          "hasSubCategories": null,
348          "description": null,
349          "childCategories": null,
350          "catalogId": "0ZSVW000000AhdB4AS"
351        }
352      ],
353      "catalogs": [],
354      "availabilityDate": null,
355      "attributeCategories": [],
356      "additionalFields": []
357    },
358    {
359      "unitOfMeasure": null,
360      "status": null,
361      "qualificationContext": {
362        "reason": null,
363        "isQualified": true
364      },
365      "productType": null,
366      "productSpecificationType": null,
367      "productSellingModelOptions": [
368        {
369          "productSellingModelId": "0jPVW0000001fh32AA",
370          "productSellingModel": {
371            "status": "Active",
372            "sellingModelType": "TermDefined",
373            "pricingTermUnit": "Annual",
374            "pricingTerm": 1,
375            "name": "Term Annual",
376            "id": "0jPVW0000001fh32AA"
377          },
378          "productId": "01tVW000003l7u0YAA",
379          "id": "0iOVW00000049w92AA"
380        }
381      ],
382      "productRelatedComponent": null,
383      "productQuantity": null,
384      "productPricingInformation": null,
385      "productInformation": null,
386      "productComponentGroups": [],
387      "productCode": "QB-API-PREP",
388      "productClassification": {
389        "id": null
390      },
391      "prices": [
392        {
393          "pricingModel": {
394            "unitOfMeasure": null,
395            "pricingModelType": "TermDefined",
396            "occurrence": 1,
397            "name": "Term Annual",
398            "id": "0jPVW0000001fh32AA",
399            "frequency": "Annual"
400          },
401          "priceBookId": "01sVW0000024PZlYAM",
402          "priceBookEntryId": "01uVW000000jzfSYAQ",
403          "price": 3240,
404          "isSelected": false,
405          "isDerived": false,
406          "isDefault": true,
407          "effectiveTo": null,
408          "effectiveFrom": null,
409          "currencyIsoCode": "USD"
410        }
411      ],
412      "nodeType": "simpleProduct",
413      "name": "Additional API Pre-Prod",
414      "isSoldOnlyWithOtherProds": false,
415      "isQuantityEditable": null,
416      "isDefaultComponent": null,
417      "isComponentRequired": null,
418      "isAssetizable": true,
419      "isActive": true,
420      "id": "01tVW000003l7u0YAA",
421      "endOfLifeDate": null,
422      "displayUrl": "/resource/api_preprod",
423      "discontinuedDate": null,
424      "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.",
425      "configureDuringSale": null,
426      "configurationRules": [],
427      "childProducts": [],
428      "categories": [
429        {
430          "sortOrder": null,
431          "qualificationContext": {
432            "reason": null,
433            "isQualified": true
434          },
435          "parentCategoryId": null,
436          "name": "API",
437          "isNavigational": null,
438          "id": "0ZGVW000000IUEG4A4",
439          "hasSubCategories": null,
440          "description": null,
441          "childCategories": null,
442          "catalogId": "0ZSVW000000AhdB4AS"
443        }
444      ],
445      "catalogs": [],
446      "availabilityDate": null,
447      "attributeCategories": [],
448      "additionalFields": []
449    },
450    {
451      "unitOfMeasure": null,
452      "status": null,
453      "qualificationContext": {
454        "reason": null,
455        "isQualified": true
456      },
457      "productType": null,
458      "productSpecificationType": null,
459      "productSellingModelOptions": [
460        {
461          "productSellingModelId": "0jPVW0000001fh32AA",
462          "productSellingModel": {
463            "status": "Active",
464            "sellingModelType": "TermDefined",
465            "pricingTermUnit": "Annual",
466            "pricingTerm": 1,
467            "name": "Term Annual",
468            "id": "0jPVW0000001fh32AA"
469          },
470          "productId": "01tVW000003l7u1YAA",
471          "id": "0iOVW00000049wA2AQ"
472        }
473      ],
474      "productRelatedComponent": null,
475      "productQuantity": null,
476      "productPricingInformation": null,
477      "productInformation": null,
478      "productComponentGroups": [],
479      "productCode": "QB-API-PROD",
480      "productClassification": {
481        "id": null
482      },
483      "prices": [
484        {
485          "pricingModel": {
486            "unitOfMeasure": null,
487            "pricingModelType": "TermDefined",
488            "occurrence": 1,
489            "name": "Term Annual",
490            "id": "0jPVW0000001fh32AA",
491            "frequency": "Annual"
492          },
493          "priceBookId": "01sVW0000024PZlYAM",
494          "priceBookEntryId": "01uVW000000jzfdYAA",
495          "price": 3240,
496          "isSelected": false,
497          "isDerived": false,
498          "isDefault": true,
499          "effectiveTo": null,
500          "effectiveFrom": null,
501          "currencyIsoCode": "USD"
502        }
503      ],
504      "nodeType": "simpleProduct",
505      "name": "Additional API Prod",
506      "isSoldOnlyWithOtherProds": false,
507      "isQuantityEditable": null,
508      "isDefaultComponent": null,
509      "isComponentRequired": null,
510      "isAssetizable": true,
511      "isActive": true,
512      "id": "01tVW000003l7u1YAA",
513      "endOfLifeDate": null,
514      "displayUrl": "/resource/api_prod",
515      "discontinuedDate": null,
516      "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.",
517      "configureDuringSale": null,
518      "configurationRules": [],
519      "childProducts": [],
520      "categories": [
521        {
522          "sortOrder": null,
523          "qualificationContext": {
524            "reason": null,
525            "isQualified": true
526          },
527          "parentCategoryId": null,
528          "name": "API",
529          "isNavigational": null,
530          "id": "0ZGVW000000IUEG4A4",
531          "hasSubCategories": null,
532          "description": null,
533          "childCategories": null,
534          "catalogId": "0ZSVW000000AhdB4AS"
535        }
536      ],
537      "catalogs": [],
538      "availabilityDate": null,
539      "attributeCategories": [],
540      "additionalFields": []
541    },
542    {
543      "unitOfMeasure": null,
544      "status": null,
545      "qualificationContext": {
546        "reason": null,
547        "isQualified": true
548      },
549      "productType": null,
550      "productSpecificationType": null,
551      "productSellingModelOptions": [
552        {
553          "productSellingModelId": "0jPVW0000001fh32AA",
554          "productSellingModel": {
555            "status": "Active",
556            "sellingModelType": "TermDefined",
557            "pricingTermUnit": "Annual",
558            "pricingTerm": 1,
559            "name": "Term Annual",
560            "id": "0jPVW0000001fh32AA"
561          },
562          "productId": "01tVW000003l7u3YAA",
563          "id": "0iOVW00000049wF2AQ"
564        },
565        {
566          "productSellingModelId": "0jPVW0000001fh52AA",
567          "productSellingModel": {
568            "status": "Active",
569            "sellingModelType": "Evergreen",
570            "pricingTermUnit": "Months",
571            "pricingTerm": 1,
572            "name": "Evergreen Monthly",
573            "id": "0jPVW0000001fh52AA"
574          },
575          "productId": "01tVW000003l7u3YAA",
576          "id": "0iOVW00000049wE2AQ"
577        },
578        {
579          "productSellingModelId": "0jPVW0000001fh62AA",
580          "productSellingModel": {
581            "status": "Active",
582            "sellingModelType": "TermDefined",
583            "pricingTermUnit": "Months",
584            "pricingTerm": 1,
585            "name": "Term Monthly",
586            "id": "0jPVW0000001fh62AA"
587          },
588          "productId": "01tVW000003l7u3YAA",
589          "id": "0iOVW00000049wG2AQ"
590        }
591      ],
592      "productRelatedComponent": null,
593      "productQuantity": null,
594      "productPricingInformation": null,
595      "productInformation": null,
596      "productComponentGroups": [],
597      "productCode": "QB-AUT-CRED",
598      "productClassification": {
599        "id": null
600      },
601      "prices": [
602        {
603          "pricingModel": {
604            "unitOfMeasure": null,
605            "pricingModelType": "TermDefined",
606            "occurrence": 1,
607            "name": "Term Annual",
608            "id": "0jPVW0000001fh32AA",
609            "frequency": "Annual"
610          },
611          "priceBookId": "01sVW0000024PZlYAM",
612          "priceBookEntryId": "01uVW000000jzfUYAQ",
613          "price": 25,
614          "isSelected": false,
615          "isDerived": false,
616          "isDefault": true,
617          "effectiveTo": null,
618          "effectiveFrom": null,
619          "currencyIsoCode": "USD"
620        },
621        {
622          "pricingModel": {
623            "unitOfMeasure": null,
624            "pricingModelType": "Evergreen",
625            "occurrence": 1,
626            "name": "Evergreen Monthly",
627            "id": "0jPVW0000001fh52AA",
628            "frequency": "Months"
629          },
630          "priceBookId": "01sVW0000024PZlYAM",
631          "priceBookEntryId": "01uVW000000jzgAYAQ",
632          "price": 2.5,
633          "isSelected": false,
634          "isDerived": false,
635          "isDefault": false,
636          "effectiveTo": null,
637          "effectiveFrom": null,
638          "currencyIsoCode": "USD"
639        },
640        {
641          "pricingModel": {
642            "unitOfMeasure": null,
643            "pricingModelType": "TermDefined",
644            "occurrence": 1,
645            "name": "Term Monthly",
646            "id": "0jPVW0000001fh62AA",
647            "frequency": "Months"
648          },
649          "priceBookId": "01sVW0000024PZlYAM",
650          "priceBookEntryId": "01uVW000000jzgBYAQ",
651          "price": 2,
652          "isSelected": false,
653          "isDerived": false,
654          "isDefault": false,
655          "effectiveTo": null,
656          "effectiveFrom": null,
657          "currencyIsoCode": "USD"
658        }
659      ],
660      "nodeType": "simpleProduct",
661      "name": "Additional Automation QB Credits",
662      "isSoldOnlyWithOtherProds": false,
663      "isQuantityEditable": null,
664      "isDefaultComponent": null,
665      "isComponentRequired": null,
666      "isAssetizable": true,
667      "isActive": true,
668      "id": "01tVW000003l7u3YAA",
669      "endOfLifeDate": null,
670      "displayUrl": "/resource/add_auto_credit",
671      "discontinuedDate": null,
672      "description": "Your QuantumBit Automation subscription plan includes a quota of Automation QB Credits that you can use with QB RPA, QB Orchestrator, or a combination of both products. As you use processes to create automations, your total credit quota is depleted. 1 QB Automation Credit = 2 RPA Bot Minutes, 1 QB Automation Credit = 100 RPA API Calls, 1 QB Automation Credit = 50 Orchestrator Tasks",
673      "configureDuringSale": null,
674      "configurationRules": [],
675      "childProducts": [],
676      "categories": [
677        {
678          "sortOrder": null,
679          "qualificationContext": {
680            "reason": null,
681            "isQualified": true
682          },
683          "parentCategoryId": null,
684          "name": "API",
685          "isNavigational": null,
686          "id": "0ZGVW000000IUEG4A4",
687          "hasSubCategories": null,
688          "description": null,
689          "childCategories": null,
690          "catalogId": "0ZSVW000000AhdB4AS"
691        }
692      ],
693      "catalogs": [],
694      "availabilityDate": null,
695      "attributeCategories": [],
696      "additionalFields": []
697    },
698    {
699      "unitOfMeasure": null,
700      "status": null,
701      "qualificationContext": {
702        "reason": null,
703        "isQualified": true
704      },
705      "productType": null,
706      "productSpecificationType": null,
707      "productSellingModelOptions": [
708        {
709          "productSellingModelId": "0jPVW0000001fh32AA",
710          "productSellingModel": {
711            "status": "Active",
712            "sellingModelType": "TermDefined",
713            "pricingTermUnit": "Annual",
714            "pricingTerm": 1,
715            "name": "Term Annual",
716            "id": "0jPVW0000001fh32AA"
717          },
718          "productId": "01tVW000003l7uPYAQ",
719          "id": "0iOVW00000049wR2AQ"
720        }
721      ],
722      "productRelatedComponent": null,
723      "productQuantity": null,
724      "productPricingInformation": null,
725      "productInformation": null,
726      "productComponentGroups": [],
727      "productCode": "QB-DAT-GRPH",
728      "productClassification": {
729        "id": null
730      },
731      "prices": [
732        {
733          "pricingModel": {
734            "unitOfMeasure": null,
735            "pricingModelType": "TermDefined",
736            "occurrence": 1,
737            "name": "Term Annual",
738            "id": "0jPVW0000001fh32AA",
739            "frequency": "Annual"
740          },
741          "priceBookId": "01sVW0000024PZlYAM",
742          "priceBookEntryId": "01uVW000000jzffYAA",
743          "price": 25000,
744          "isSelected": false,
745          "isDerived": false,
746          "isDefault": true,
747          "effectiveTo": null,
748          "effectiveFrom": null,
749          "currencyIsoCode": "USD"
750        }
751      ],
752      "nodeType": "simpleProduct",
753      "name": "Additional QB DataGraph (500M)",
754      "isSoldOnlyWithOtherProds": false,
755      "isQuantityEditable": null,
756      "isDefaultComponent": null,
757      "isComponentRequired": null,
758      "isAssetizable": true,
759      "isActive": true,
760      "id": "01tVW000003l7uPYAQ",
761      "endOfLifeDate": null,
762      "displayUrl": "/resource/add_data_graph",
763      "discontinuedDate": null,
764      "description": "With QuantumBit DataGraph, you can reuse multiple APIs in a single request. Enterprise architects can easily unify APIs into one data service — all without writing more code. Developers can consume multiple APIs from the data service in a single GraphQL request.",
765      "configureDuringSale": null,
766      "configurationRules": [],
767      "childProducts": [],
768      "categories": [
769        {
770          "sortOrder": null,
771          "qualificationContext": {
772            "reason": null,
773            "isQualified": true
774          },
775          "parentCategoryId": null,
776          "name": "API",
777          "isNavigational": null,
778          "id": "0ZGVW000000IUEG4A4",
779          "hasSubCategories": null,
780          "description": null,
781          "childCategories": null,
782          "catalogId": "0ZSVW000000AhdB4AS"
783        }
784      ],
785      "catalogs": [],
786      "availabilityDate": null,
787      "attributeCategories": [],
788      "additionalFields": []
789    },
790    {
791      "unitOfMeasure": null,
792      "status": null,
793      "qualificationContext": {
794        "reason": null,
795        "isQualified": true
796      },
797      "productType": null,
798      "productSpecificationType": null,
799      "productSellingModelOptions": [
800        {
801          "productSellingModelId": "0jPVW0000001fh32AA",
802          "productSellingModel": {
803            "status": "Active",
804            "sellingModelType": "TermDefined",
805            "pricingTermUnit": "Annual",
806            "pricingTerm": 1,
807            "name": "Term Annual",
808            "id": "0jPVW0000001fh32AA"
809          },
810          "productId": "01tVW000003l7u2YAA",
811          "id": "0iOVW00000049wC2AQ"
812        },
813        {
814          "productSellingModelId": "0jPVW0000001fh52AA",
815          "productSellingModel": {
816            "status": "Active",
817            "sellingModelType": "Evergreen",
818            "pricingTermUnit": "Months",
819            "pricingTerm": 1,
820            "name": "Evergreen Monthly",
821            "id": "0jPVW0000001fh52AA"
822          },
823          "productId": "01tVW000003l7u2YAA",
824          "id": "0iOVW00000049wB2AQ"
825        },
826        {
827          "productSellingModelId": "0jPVW0000001fh62AA",
828          "productSellingModel": {
829            "status": "Active",
830            "sellingModelType": "TermDefined",
831            "pricingTermUnit": "Months",
832            "pricingTerm": 1,
833            "name": "Term Monthly",
834            "id": "0jPVW0000001fh62AA"
835          },
836          "productId": "01tVW000003l7u2YAA",
837          "id": "0iOVW00000049wD2AQ"
838        }
839      ],
840      "productRelatedComponent": null,
841      "productQuantity": null,
842      "productPricingInformation": null,
843      "productInformation": null,
844      "productComponentGroups": [],
845      "productCode": "QB-API-REQT",
846      "productClassification": {
847        "id": null
848      },
849      "prices": [
850        {
851          "pricingModel": {
852            "unitOfMeasure": null,
853            "pricingModelType": "TermDefined",
854            "occurrence": 1,
855            "name": "Term Annual",
856            "id": "0jPVW0000001fh32AA",
857            "frequency": "Annual"
858          },
859          "priceBookId": "01sVW0000024PZlYAM",
860          "priceBookEntryId": "01uVW000000jzfOYAQ",
861          "price": 45,
862          "isSelected": false,
863          "isDerived": false,
864          "isDefault": true,
865          "effectiveTo": null,
866          "effectiveFrom": null,
867          "currencyIsoCode": "USD"
868        },
869        {
870          "pricingModel": {
871            "unitOfMeasure": null,
872            "pricingModelType": "Evergreen",
873            "occurrence": 1,
874            "name": "Evergreen Monthly",
875            "id": "0jPVW0000001fh52AA",
876            "frequency": "Months"
877          },
878          "priceBookId": "01sVW0000024PZlYAM",
879          "priceBookEntryId": "01uVW000000jzgJYAQ",
880          "price": 5,
881          "isSelected": false,
882          "isDerived": false,
883          "isDefault": false,
884          "effectiveTo": null,
885          "effectiveFrom": null,
886          "currencyIsoCode": "USD"
887        },
888        {
889          "pricingModel": {
890            "unitOfMeasure": null,
891            "pricingModelType": "TermDefined",
892            "occurrence": 1,
893            "name": "Term Monthly",
894            "id": "0jPVW0000001fh62AA",
895            "frequency": "Months"
896          },
897          "priceBookId": "01sVW0000024PZlYAM",
898          "priceBookEntryId": "01uVW000000jzgKYAQ",
899          "price": 5,
900          "isSelected": false,
901          "isDerived": false,
902          "isDefault": false,
903          "effectiveTo": null,
904          "effectiveFrom": null,
905          "currencyIsoCode": "USD"
906        }
907      ],
908      "nodeType": "simpleProduct",
909      "name": "API Access Requests (AEH)",
910      "isSoldOnlyWithOtherProds": false,
911      "isQuantityEditable": null,
912      "isDefaultComponent": null,
913      "isComponentRequired": null,
914      "isAssetizable": true,
915      "isActive": true,
916      "id": "01tVW000003l7u2YAA",
917      "endOfLifeDate": null,
918      "displayUrl": "/resource/api_access",
919      "discontinuedDate": null,
920      "description": "QuantumBit API Experience Hub enables you to create vibrant ecosystems and grow engagement for your API products",
921      "configureDuringSale": null,
922      "configurationRules": [],
923      "childProducts": [],
924      "categories": [
925        {
926          "sortOrder": null,
927          "qualificationContext": {
928            "reason": null,
929            "isQualified": true
930          },
931          "parentCategoryId": null,
932          "name": "API",
933          "isNavigational": null,
934          "id": "0ZGVW000000IUEG4A4",
935          "hasSubCategories": null,
936          "description": null,
937          "childCategories": null,
938          "catalogId": "0ZSVW000000AhdB4AS"
939        }
940      ],
941      "catalogs": [],
942      "availabilityDate": null,
943      "attributeCategories": [],
944      "additionalFields": []
945    },
946    {
947      "unitOfMeasure": null,
948      "status": null,
949      "qualificationContext": {
950        "reason": null,
951        "isQualified": true
952      },
953      "productType": null,
954      "productSpecificationType": null,
955      "productSellingModelOptions": [
956        {
957          "productSellingModelId": "0jPVW0000001fh32AA",
958          "productSellingModel": {
959            "status": "Active",
960            "sellingModelType": "TermDefined",
961            "pricingTermUnit": "Annual",
962            "pricingTerm": 1,
963            "name": "Term Annual",
964            "id": "0jPVW0000001fh32AA"
965          },
966          "productId": "01tVW000003l7uhYAA",
967          "id": "0iOVW00000049x22AA"
968        }
969      ],
970      "productRelatedComponent": null,
971      "productQuantity": null,
972      "productPricingInformation": null,
973      "productInformation": null,
974      "productComponentGroups": [],
975      "productCode": "QB-SUPP-1005",
976      "productClassification": {
977        "id": null
978      },
979      "prices": [
980        {
981          "pricingModel": {
982            "unitOfMeasure": null,
983            "pricingModelType": "TermDefined",
984            "occurrence": 1,
985            "name": "Term Annual",
986            "id": "0jPVW0000001fh32AA",
987            "frequency": "Annual"
988          },
989          "priceBookId": "01sVW0000024PZlYAM",
990          "priceBookEntryId": "01uVW000000jzfRYAQ",
991          "price": 30000,
992          "isSelected": false,
993          "isDerived": false,
994          "isDefault": true,
995          "effectiveTo": null,
996          "effectiveFrom": null,
997          "currencyIsoCode": "USD"
998        }
999      ],
1000      "nodeType": "simpleProduct",
1001      "name": "Gold Hardware Maintenance",
1002      "isSoldOnlyWithOtherProds": false,
1003      "isQuantityEditable": null,
1004      "isDefaultComponent": null,
1005      "isComponentRequired": null,
1006      "isAssetizable": true,
1007      "isActive": true,
1008      "id": "01tVW000003l7uhYAA",
1009      "endOfLifeDate": null,
1010      "displayUrl": "/resource/gold_maint",
1011      "discontinuedDate": null,
1012      "description": "System maintenance, administration, and configuration performed by a certified technician. Also includes 24x7 phone service and monthly on-site check-ups. 20% of hardware.",
1013      "configureDuringSale": null,
1014      "configurationRules": [],
1015      "childProducts": [],
1016      "categories": [
1017        {
1018          "sortOrder": null,
1019          "qualificationContext": {
1020            "reason": null,
1021            "isQualified": true
1022          },
1023          "parentCategoryId": null,
1024          "name": "Maintenance",
1025          "isNavigational": null,
1026          "id": "0ZGVW000000IUEJ4A4",
1027          "hasSubCategories": null,
1028          "description": null,
1029          "childCategories": null,
1030          "catalogId": "0ZSVW000000AhdB4AS"
1031        }
1032      ],
1033      "catalogs": [],
1034      "availabilityDate": null,
1035      "attributeCategories": [],
1036      "additionalFields": []
1037    },
1038    {
1039      "unitOfMeasure": null,
1040      "status": null,
1041      "qualificationContext": {
1042        "reason": null,
1043        "isQualified": true
1044      },
1045      "productType": "Base",
1046      "productSpecificationType": null,
1047      "productSellingModelOptions": [
1048        {
1049          "productSellingModelId": "0jPVW0000001fh32AA",
1050          "productSellingModel": {
1051            "status": "Active",
1052            "sellingModelType": "TermDefined",
1053            "pricingTermUnit": "Annual",
1054            "pricingTerm": 1,
1055            "name": "Term Annual",
1056            "id": "0jPVW0000001fh32AA"
1057          },
1058          "productId": "01tVW000003olLNYAY",
1059          "id": "0iOVW0000005X1l2AE"
1060        },
1061        {
1062          "productSellingModelId": "0jPVW0000001fh42AA",
1063          "productSellingModel": {
1064            "status": "Active",
1065            "sellingModelType": "OneTime",
1066            "pricingTermUnit": null,
1067            "pricingTerm": null,
1068            "name": "One-Time",
1069            "id": "0jPVW0000001fh42AA"
1070          },
1071          "productId": "01tVW000003olLNYAY",
1072          "id": "0iOVW0000005X092AE"
1073        }
1074      ],
1075      "productRelatedComponent": null,
1076      "productQuantity": null,
1077      "productPricingInformation": null,
1078      "productInformation": null,
1079      "productComponentGroups": [],
1080      "productCode": "LaptopDell",
1081      "productClassification": {
1082        "id": null
1083      },
1084      "prices": [
1085        {
1086          "pricingModel": {
1087            "unitOfMeasure": null,
1088            "pricingModelType": "TermDefined",
1089            "occurrence": 1,
1090            "name": "Term Annual",
1091            "id": "0jPVW0000001fh32AA",
1092            "frequency": "Annual"
1093          },
1094          "priceBookId": "01sVW0000024PZlYAM",
1095          "priceBookEntryId": "01uVW000000lsJfYAI",
1096          "price": 600,
1097          "isSelected": false,
1098          "isDerived": false,
1099          "isDefault": true,
1100          "effectiveTo": null,
1101          "effectiveFrom": null,
1102          "currencyIsoCode": "USD"
1103        },
1104        {
1105          "pricingModel": {
1106            "unitOfMeasure": null,
1107            "pricingModelType": "OneTime",
1108            "occurrence": null,
1109            "name": "One-Time",
1110            "id": "0jPVW0000001fh42AA",
1111            "frequency": null
1112          },
1113          "priceBookId": "01sVW0000024PZlYAM",
1114          "priceBookEntryId": "01uVW000000lsPxYAI",
1115          "price": 100,
1116          "isSelected": false,
1117          "isDerived": false,
1118          "isDefault": false,
1119          "effectiveTo": null,
1120          "effectiveFrom": null,
1121          "currencyIsoCode": "USD"
1122        }
1123      ],
1124      "nodeType": "variationParentProduct",
1125      "name": "Laptop Dell",
1126      "isSoldOnlyWithOtherProds": false,
1127      "isQuantityEditable": null,
1128      "isDefaultComponent": null,
1129      "isComponentRequired": null,
1130      "isAssetizable": true,
1131      "isActive": true,
1132      "id": "01tVW000003olLNYAY",
1133      "endOfLifeDate": null,
1134      "displayUrl": null,
1135      "discontinuedDate": null,
1136      "description": null,
1137      "configureDuringSale": null,
1138      "configurationRules": [],
1139      "childProducts": [],
1140      "categories": [
1141        {
1142          "sortOrder": null,
1143          "qualificationContext": {
1144            "reason": null,
1145            "isQualified": true
1146          },
1147          "parentCategoryId": null,
1148          "name": "Variants",
1149          "isNavigational": null,
1150          "id": "0ZGVW000000ItXV4A0",
1151          "hasSubCategories": null,
1152          "description": null,
1153          "childCategories": null,
1154          "catalogId": "0ZSVW000000AhdB4AS"
1155        }
1156      ],
1157      "catalogs": [],
1158      "availabilityDate": null,
1159      "attributeCategories": [],
1160      "additionalFields": []
1161    }
1162  ],
1163  "contextId": "0000000r25tp21g0025177753245202837fde5e54eed45178ef77c9e453083fd",
1164  "correlationId": "ee883b85-2c99-48fb-88e6-95cb35e8751e",
1165  "cursor": "MTAwMDAwMDAxMw=="
1166}

Usage of an Apex-Defined Data Type in a Flow 

To use an Apex-defined input parameter in a Flow, follow these guidelines.

Create an Apex Class

Create an Apex class defining the input and output parameters. In the flow, include the Apex-defined input parameters for which you want to add the details. In this example, we have created a class named ProductServiceAction that takes an object’s API name and record ID as input, and returns the additional context data.

1public class ProductServiceAction {
2    // Define input parameters
3    public class FlowInput{
4        @InvocableVariable(required=false)
5        public String objectApiName;
6        
7        @InvocableVariable(required=false)
8        public String recordId;
9    }
10    
11    // Define output parameters
12    public class FlowOutput{
13        @invocableVariable
14        public runtime_industries_cpq.AdditionalContextData additionalContextDataFinalOutput = new runtime_industries_cpq.AdditionalContextData();
15        
16        @invocableVariable
17        public runtime_industries_cpq.RelatedObjectFilterInputRepresentation relatedObjectFilter = new runtime_industries_cpq.RelatedObjectFilterInputRepresentation();
18        
19        @invocableVariable
20        public ConnectApi.UserContextInputRepresentation userContext = new ConnectApi.UserContextInputRepresentation();
21        
22        }
23    
24    // This method is invoked from a Flow
25    @InvocableMethod(label='Process Input' description='Creates the Array of ContextDataInput for additional Context Data')
26    public static List<FlowOutput> processContextData(List<FlowInput> inputs){
27        String apiName;
28        String recId;
29        FlowOutput output = new FlowOutput();
30        
31    // Capture input from the flow
32        for(FlowInput input: inputs){
33            apiName = input.objectApiName;
34            recId = input.recordId;
35            }
36    // Populate the ContextDataInput list to store additional context data    
37        List<runtime_industries_cpq.ContextDataInput> listContextData = new List<runtime_industries_cpq.ContextDataInput>();
38        runtime_industries_cpq.ContextDataInput cd1 = new runtime_industries_cpq.ContextDataInput();
39        cd1.nodeName = apiName;
40        cd1.nodeData = new Map<String, Object>();
41        cd1.nodeData.put('id',recId);
42        listContextData.add(cd1);
43       
44        output.additionalContextDataFinalOutput.additionalContextData = listContextData;
45        List<FlowOutput> flowOutputs = new List<FlowOutput>();
46        flowOutputs.add(output);
47        
48        List<runtime_industries_cpq.RelatedObjectFilter> relatedObjectFilterList = new List<runtime_industries_cpq.RelatedObjectFilter>();
49       
50        runtime_industries_cpq.RelatedObjectFilter relatedObjectFilter = new runtime_industries_cpq.RelatedObjectFilter();
51
52        relatedObjectFilter.objectName = 'ProductSpecificationRecType';
53        List<runtime_industries_cpq.FilterCriteriaInputRepresentation> criteriaList = new  List<runtime_industries_cpq.FilterCriteriaInputRepresentation>();
54        runtime_industries_cpq.FilterCriteriaInputRepresentation criteria = new runtime_industries_cpq.FilterCriteriaInputRepresentation();
55        criteria.property = 'IsCommercial';
56        criteria.operator = 'eq';
57        criteria.value = 'true';
58        criteriaList.add(criteria);
59        relatedObjectFilter.criteria = criteriaList;
60
61       relatedObjectFilterList.add(relatedObjectFilter);
62
63        output.relatedObjectFilter.relatedObjectFilter  = relatedObjectFilterList;
64         
65		output.userContext.accountId = '001Hs00003r17HNIAY';
66        
67        return flowOutputs;
68        
69    }
70
71}

Create a Flow with the Necessary Variables and Components: Create a flow that enables users to add a search term to find products. Add the ProductService action that you’ve created above by using Apex. When a flow is invoked from a record, the flow sends the record’s objectApiName and recordId to the Apex class, which then generates the flow output. The flow passes the objectApiName and recordId of the record that the flow is invoked from to the Apex class to generate the flow output. See Example of How to Create a Flow for Product Discovery.

Configure the Action: Configure the action (for example, Get Products action) to add values for the Apex-defined input parameters. Use the output of the created Apex class as the input of the Apex-defined parameter in the Get Products action, which users can use to get products.