customerProducts
Requires a customer (portal or buyer app) session.
Lists the catalogue products a signed-in customer can buy, one page at a time, with filters for category, brand, price, stock and attributes. Prices are the signed-in customer's own. When search text is given, the first page also records the search as buyer activity.
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 CustomerProducts {
customerProducts {
items {
id
name
brandName
availabilityState
brandId
canAddToCart
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CustomerProducts {\n customerProducts {\n items {\n id\n name\n brandName\n availabilityState\n brandId\n canAddToCart\n }\n }\n}"
}
EOF
Response:
{
"data": {
"customerProducts": {
"items": [
{
"id": "id",
"name": "string",
"brandName": "string",
"availabilityState": "string",
"brandId": "id",
"canAddToCart": true
}
]
}
}
}
customerProducts(
filter: CustomerProductFilterInput
): CustomerProductConnection!
Arguments
customerProducts.filter ● CustomerProductFilterInput input
Search text, filters, sort order and paging for the list.
Type
CustomerProductConnection object
A page of products.