@plentymarkets/shop-api / getSearch
Function: getSearch() ​
getSearch(
context,params):Promise<Data<ItemSearchResult>>
Defined in: api/getSearch/index.ts:67
Method getSearch - returns a list of products based on the search term
Parameters ​
context ​
PlentysystemsIntegrationContext
params ​
Needs type search and term Or type tag and at least one of tagId and tagName
Returns ​
Promise<Data<ItemSearchResult>>
products: Product[] - The list of products
Remarks ​
- Calls /rest/storefront/items
- This method is used to search for products based on the search term.
Examples ​
ts
const { data } = await useSdk().plentysystems.getSearch({ term: 'Drone' });ts
const { data } = await useSdk().plentysystems.getSearch({
type: 'tag',
tagId: '123',
page: 1,
itemsPerPage: 20,
});ts
const { data } = await useSdk().plentysystems.getSearch({
type: 'tag',
tagName: 'Summer',
});ts
const { data } = await useSdk().plentysystems.getSearch({
type: 'tag',
tagId: ['123', '456'],
});