customerCartSummary
Requires a customer (portal or buyer app) session.
Returns the item count and total of the signed-in customer's cart, for a header badge. It uses the same customer and address as the cart.
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 CustomerCartSummary {
customerCartSummary {
itemCount
subtotal
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CustomerCartSummary {\n customerCartSummary {\n itemCount\n subtotal\n }\n}"
}
EOF
Response:
{
"data": {
"customerCartSummary": {
"itemCount": 0,
"subtotal": 0
}
}
}
customerCartSummary: CartSummary!
Type
CartSummary object
The cart's totals.