Menu
site_search_searchProducts
Search products by term, price, rating, category, brand and attributes, with sort, available filters and suggestions.
Use it in a workflow
- Add a step and choose the BigCommerce Storefront connector.
- Pick the site_search_searchProducts action (under Search).
- Fill in the fields below, then reference the result from later steps as
{{siteSearchSearchproducts.response.data}}.
Query
This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.
query SiteSearchSearchProducts($filters: SearchProductsFiltersInput!, $sort: SearchProductsSortInput) {
site {
search {
searchProducts(filters: $filters, sort: $sort) {
suggestions {
sourceField
results {
text
}
}
}
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"filters": {
"searchTerm": "string",
"price": {
"minPrice": 0,
"maxPrice": 0
},
"rating": {
"minRating": 0,
"maxRating": 0
},
"categoryEntityId": 0,
"categoryEntityIds": [
0
],
"searchSubCategories": false,
"brandEntityIds": [
0
],
"productAttributes": [
{
"attribute": "string",
"values": "string"
}
],
"isFreeShipping": false,
"isFeatured": false,
"hideOutOfStock": false,
"topLevelOnly": false
},
"sort": "A_TO_Z"
}
Response
Read the result with {{siteSearchSearchproducts.response.data.data.searchProducts}}. If the API returns errors, the step fails and they are at {{siteSearchSearchproducts.response.data.errors}}.
Need more? See the BigCommerce Storefront guide for connection setup and behaviour shared by every action.
Was this page helpful?