Home > @vsf-enterprise/sap-commerce-webservices-sdk > ProductsApi > getProducts
ProductsApi.getProducts() method
Returns a list of products and additional data, such as available facets, available sorting, and pagination options. It can also include spelling suggestions. To make spelling suggestions work, you need to make sure that "enableSpellCheck" on the SearchQuery is set to "true" (by default, it should already be set to "true"). You also need to have indexed properties configured to be used for spellchecking. Get a list of products and additional data
Signature:
getProducts(baseSiteId: string, currentPage?: number, fields?: string, pageSize?: number, query?: string, searchQueryContext?: string, sort?: string, options?: any): Promise<import("axios").AxiosResponse<ProductSearchPage>>;
Parameters
Parameter | Type | Description |
---|---|---|
baseSiteId | string | Base site identifier |
currentPage | number | The current result page requested. |
fields | string | Response configuration. This is the list of fields that should be returned in the response body. Examples: BASIC, DEFAULT, FULL |
pageSize | number | The number of results returned per page. |
query | string | Serialized query, free text search, facets. The format of a serialized query: freeTextSearch:sort:facetKey1:facetValue1:facetKey2:facetValue2 |
searchQueryContext | string | The context to be used in the search query. |
sort | string | Sorting method applied to the return results. |
options | any | Override http request option. |
Returns:
Promise<import("axios").AxiosResponse<ProductSearchPage>>
Exceptions
{RequiredError} ProductsApi