customerCart
Requires a customer (portal or buyer app) session.
Returns the signed-in customer's cart with each line priced live for the delivery address or branch in use.
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 CustomerCart {
customerCart {
id
name
itemCount
revision
subtotal
updatedAt
items {
id
createdAt
acceptAlternativeIfUnavailable
baseUnitPrice
lineTotal
notes
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CustomerCart {\n customerCart {\n id\n name\n itemCount\n revision\n subtotal\n updatedAt\n items {\n id\n createdAt\n acceptAlternativeIfUnavailable\n baseUnitPrice\n lineTotal\n notes\n }\n }\n}"
}
EOF
Response:
{
"data": {
"customerCart": {
"id": "id",
"name": "string",
"itemCount": 0,
"revision": 0,
"subtotal": 0,
"updatedAt": "2025-01-15T00:00:00Z",
"items": [
{
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"acceptAlternativeIfUnavailable": true,
"baseUnitPrice": 0,
"lineTotal": 0,
"notes": "string"
}
]
}
}
}
customerCart: CartType!
Type
CartType object
The customer's cart.