customerCatalogSearch
Requires a customer (portal or buyer app) session.
Searches the storefront catalog for a signed-in customer: products, brands and categories visible on the storefront. The organization comes from the customer's sign-in.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query CustomerCatalogSearch($limit: Int!, $query: String!) {
customerCatalogSearch(limit: $limit, query: $query) {
brands {
id
name
description
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CustomerCatalogSearch($limit: Int!, $query: String!) {\n customerCatalogSearch(limit: $limit, query: $query) {\n brands {\n id\n name\n description\n }\n }\n}",
"variables": {
"limit": 0,
"query": "string"
}
}
EOF
Variables:
{
"limit": 0,
"query": "string"
}
Response:
{
"data": {
"customerCatalogSearch": {
"brands": [
{
"id": "id",
"name": "string",
"description": "string"
}
]
}
}
}
customerCatalogSearch(
limit: Int! = 10
query: String!
types: [GlobalSearchType!]
): CustomerCatalogSearchResult!
Arguments
customerCatalogSearch.limit ● Int! non-null scalar
The maximum number of results. Defaults to 10.
customerCatalogSearch.query ● String! non-null scalar
The text to search for.
customerCatalogSearch.types ● [GlobalSearchType!] list enum
Only search these result types. It can narrow the search but never widen it beyond products, brands and categories.
Type
CustomerCatalogSearchResult object
The search result for customers and buyers: the storefront catalog and nothing else.