CommerceSearchConnectFamily Class

Search products by search term or category in a webstore.

Namespace

ConnectApi

CommerceSearchConnectFamily Methods

These methods are for CommerceSearchConnectFamily. All methods are static.

searchProducts(webstoreId, searchTerm, categoryId, sortRuleId, grouping, fields, refinements, pageParam, pageSize, effectiveAccountId, includeQuantityRule)

Search products by search term or category in a webstore.

API Version

58.0

Available to Guest Users

58.0

Requires Chatter

No

Signature

public static ConnectApi.CommerceProductSearchResults searchProducts(String webstoreId, String searchTerm, String categoryId, String sortRuleId, String grouping, List<String> fields, String refinements, Integer pageParam, Integer pageSize, String effectiveAccountId, Boolean includeQuantityRule)

Parameters

webstoreId
Type: String
ID of the webstore.
searchTerm
Type: String
List of up to 32 space-separated search terms.
categoryId
Type: String
Category ID returns results for products in this category or its subcategories.
sortRuleId
Type: String
ID of the sort rule that specifies the order of products in the search results. If unspecified, the default sort type is relevancy.
grouping
Type: String
Grouping option for search results. If unspecified, the default is the value specified in Search | Results Display Settings | Results Grouping.
fields
Type: List<String>
Product fields to return in search results. Search results include fields you have access to.
refinements
Type: String
List up to nine refinements (facets) for search results. Buyers or shoppers can select up to 20 values for each refinement. The refinements parameter is encoded as a Base64 string from the JSON representation of ConnectApi.DistinctValueRefinementInput .
pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 200. If unspecified, defaults to 20.
effectiveAccountId
Type: String
ID of the buyer account or guest buyer profile for which the request is made. If unspecified, the default value is determined from context.
includeQuantityRule
Type: Boolean
Specifies whether to include purchase quantity rule information for products in search results (true) or not (false). If unspecified, defaults to false.

Usage

Searching products respects buyer View Product entitlements and only users entitled to view product data can access this resource.