Global Search (POST)

Retrieves a list of products based on a search query or search term. This API is a composite API for Product Discovery.

Resource 

1/connect/cpq/products/search

Resource Example 

1https://{yourInstance}.salesforce.com/services/data/v68.0/connect/cpq/products/search

Available Version 

60.0

HTTP Methods 

POST

Request Body for POST 

JSON Example

This example shows a sample request to search products by using a query.

1{
2  "query": {
3    "textQuery": {
4      "searchPhrase": "firstproduct"
5    }
6  },
7  "catalogId": "0ZSxx0000000001GAA",
8  "categoryId": "0ZGT100000000qlOAA",
9  "correlationId": "9cbb9650-48c5-11ed-96d1-0afcf185843b",
10  "limit": 10,
11  "cursor": "MTAwMDAwMDAwNg==",
12  "orderBy": [
13    "name:asc",
14    "id:desc"
15  ],
16  "userContext": {
17    "accountId": "001xx0000000001AAA",
18    "contactId": "003xx00000000D7AAI"
19  },
20  "additionalFields": {
21    "Product2": {
22      "fields": [
23        "CustomField1__c",
24        "CustomField2__c",
25        "StandardField1"
26      ]
27    }
28  }
29}

This example shows a sample request to search products by using the searchTerm property.

1{
2  "searchTerm": "Laptop",
3  "catalogId": "0ZSDU0000002Og64AE",
4  "categoryId": "0ZGDU0000002P0A4AU",
5  "correlationId": "d9d8f898-19f5-464a-ba2b-6a070783f6c4",
6  "limit": 10,
7  "cursor": "MTAwMDAwMDAwNw==",
8  "orderBy": [
9    "name:asc",
10    "id:desc"
11  ],
12  "userContext": {
13    "accountId": "001DU000001o2V0YAI"
14  }
15}

If a parent category ID is specified in the request body, then the API returns all products associated to all child categories.

This example shows a sample request to search products with eligible promotions. To fetch eligible promotions, specify a value for the query or searchTerm property, and set the usePromotions property to true.

1{
2  "query": {
3    "textQuery": {
4      "searchPhrase": "laptop"
5    }
6  },
7  "catalogId": "0ZSxx0000000001GAA",
8  "categoryId": "0ZGT100000000qlOAA",
9  "correlationId": "9cbb9650-48c5-11ed-96d1-0afcf185843b",
10  "limit": 10,
11  "cursor": "MTAwMDAwMDAwNg==",
12  "orderBy": [
13    "name:asc",
14    "id:desc"
15  ],
16  "userContext": {
17    "accountId": "001xx0000000001AAA",
18    "contactId": "003xx00000000D7AAI"
19  },
20  "additionalFields": {
21    "Product2": {
22      "fields": [
23        "CustomField1__c",
24        "CustomField2__c",
25        "StandardField1"
26      ]
27    }
28  },
29  "usePromotions": true
30}

This example shows a sample request to run visibility rules.

1{
2  "enableQualification": true,
3  "enablePricing": true,
4  "includeCatalogDetails": true,
5  "searchTerm": "128GB LRDIMM",
6  "catalogId": "0ZSVW000000AhdC4AS",
7  "limit": 12,
8  "userContext": {
9    "accountId": null
10  },
11  "priceBookId": "01sVW0000024PZlYAM",
12  "currencyCode": "USD",
13  "transactionId": "0Q0VW000001190f0AA",
14  "filter": {
15    "criteria": [
16      {
17        "property": "isActive",
18        "operator": "eq",
19        "value": true
20      },
21      {
22        "property": "UsedFor",
23        "operator": "eq",
24        "value": ""
25      }
26    ]
27  },
28  "orderBy": [
29    "name:asc"
30  ],
31  "executeConfigurationRules": true
32}

Properties

NameTypeDescriptionRequired or OptionalAvailable Version
additional​Context​DataContext Data Input[]Additional nodes that are added to the custom or default context definition. The maximum number of supported nodes is 10.Optional60.0
additional​FieldsMap<String, Additional Fields Input>Additional standard or custom fields of the Product2 object to include in the response. If the requested fields are invalid or access to fields isn’t available, then the API throws an error.Optional61.0
catalog​IdStringID of the catalog. If the catalog ID is specified, then the API returns the list of offers from the catalog with the pricing details related to the catalog.Optional60.0
category​IdStringID of the category. If the category ID isn’t specified, then the API returns the matching query offers from the catalog.Optional60.0
context​DefinitionStringAPI name of the custom context definition that’s sent for context creation. If this property isn’t specified, then the default context definition is used.Optional60.0
context​MappingStringDefault context mapping of the context definition. If a context mapping is specified, then the API checks whether the mapping belongs to the specified context definition to process the details for hydration.Optional60.0
correlation​IdStringUnique identifier of the request.Optional60.0
currency​CodeStringCurrency code that’s considered for pricing and filtering request.Optional60.0
cursorStringUnique ID to represent the position of each product in the dataset.Optional60.0
enable​PricingBooleanIndicates whether to enable pricing for the products ( true ) or not ( false ). The default value is true. The Pricing Procedure toggle from the Product Discovery Settings page from Setup overrides this property. For example, if the Pricing Procedure toggle is disabled, then setting the enablePricing property to true has no effect and the prices property in the API response is returned empty.Optional60.0
enable​QualificationBooleanIndicates whether to enable qualification rules for the products ( true ) or not ( false ). The default value is true. The Qualification Procedure toggle from the Product Discovery Settings page from Setup overrides this property. For example, if the Qualification Procedure toggle is disabled, then setting the enableQualification property to true has no effect and the qualificationContext property in the API response isn’t returned.Optional60.0
execute​ConfigurationRulesBooleanIndicates whether to execute configuration rules (true) or not (false).Optional67.0
filterFilter InputFilters records based on supported criteria. The supported property is name. The supported operators are eq; in; contains; gt—Specifies a greater than criteria. Available from API version 63.0 and later for Number, Date, and Datetime data types only; lt—Specifies a less than criteria. Available from API version 63.0 and later for Number, Date, and Datetime data types only; gte—Specifies a greater than or equal to criteria. Available from API version 63.0 and later for Number, Date, and Datetime data types only; or lte—Specifies a less than or equal to criteria. Available from API version 63.0 and later for Number, Date, and Datetime data types only. If multiple criteria are specified, then the resultant criteria are combined by using the and operator.Optional60.0
include​CatalogDetailsBooleanIndicates whether to include catalog details in the response (true) or not (false).Optional61.0
limitIntegerNumber of items to include in the response. The default value is 10.Optional60.0
offsetIntegerReserved for internal use.Optional60.0
orderByString[]Sort order of the results, which is either ascending or descending order. The default sort order is ascending order. The default value is asc.Optional60.0
priceBookIdStringID of the price book to get the prices from. If this property isn’t specified, then prices from the standard price book are fetched.Optional60.0
pricingProcedureStringAPI name of the custom pricing procedure that’s used for the pricing process. If this property isn’t specified, then the default pricing procedure is executed.Optional60.0
product ClassificationIdStringID of the product classification.Optional60.0
qualification​ProcedureStringAPI name of the custom qualification procedure that’s used for the product qualification process. If this property isn’t specified, then the default qualification procedure is executed.Optional60.0
queryMap<String, Object>Query to search the products.Required60.0
related​ObjectFilterRelated Object Filter Input[]Filter records based on supported criteria for related objects. The supported object is ProductSpecificationRecType. The supported property is IsCommerical. The supported operator is eq. The supported values are true and false.Optional60.0
searchTermStringString used to get products with the product name containing the search term. See Search Considerations When Using Indexed Data.Optional62.0
transaction​ContextIdStringID of the transaction context.Optional66.0
transactionIdStringID of the transaction.Optional66.0
usePromotionsBooleanIndicates whether to retrieve eligible promotions from Global Promotion Management (GPM) for each product in the search results (true) or not (false). If Promotion feature is enabled in the org and this property isn’t specified, then the default value is true. If the Promotion feature isn’t enabled, the default value is false.Optional66.0
userContextUser Context InputUser context details. For example, account ID or contact ID.Optional60.0

Response Body for POST 

CPQ Base List