Get Cart
Read the current cart with its line items and recalculated totals.
Endpoint
POST /api/shop/cartReading the cart is a POST, not a GET. The cart is identified by the token in the Authorization header rather than by a path parameter, and the endpoint takes an empty JSON body.
Request Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
Accept | Yes | application/json |
X-STOREFRONT-KEY | Yes | Your storefront API key |
Authorization | Yes | Bearer <cartToken> for a guest, or the customer's Bearer token when signed in |
Request Body
json
{}Response Fields
The response is the cart itself, returned as a bare object with no wrapper.
| Field | Type | Description |
|---|---|---|
id | integer | Cart ID. |
cartToken | string | Token identifying this cart. |
customerId | integer | Owning customer, or null for a guest cart. |
channelId | integer | Channel the cart belongs to. |
itemsCount | integer | Number of line items. |
itemsQty | integer | Total units across those lines. |
items | array | Line items — fields below. |
subtotal / baseSubtotal | decimal | Items subtotal. |
discountAmount / baseDiscountAmount | decimal | Discount applied. |
taxAmount / baseTaxAmount | decimal | Tax calculated. |
shippingAmount / baseShippingAmount | decimal | Shipping cost, once a method is chosen. |
grandTotal / baseGrandTotal | decimal | Grand total. |
formattedSubtotal, formattedDiscountAmount, formattedTaxAmount, formattedShippingAmount, formattedGrandTotal | string | The same amounts, currency-formatted. |
couponCode | string | Applied coupon, or null. |
isGuest | boolean | Whether the cart belongs to a guest. |
Item Fields
| Field | Type | Description |
|---|---|---|
id | integer | Cart item ID. This is what the update and remove endpoints expect. |
cartId | integer | Parent cart ID. |
productId | integer | Product on this line. |
name / sku | string | Product name and SKU as added. |
quantity | integer | Units on this line. |
price / total | decimal | Unit price and line total. |
formattedPrice / formattedTotal | string | The same values, currency-formatted. |
priceInclTax / totalInclTax | decimal | Tax-inclusive equivalents, with formatted* variants. |
discountAmount / taxAmount | decimal | Per-line discount and tax. |
options | array | Selected options for configurable, bundle, and customizable products. null when none apply. |
type | string | Product type of the line. |
baseImage | string | JSON string of the product's image URLs at each size. |
productUrlKey | string | Storefront slug, for linking back to the product. |
canChangeQty | boolean | false for event and appointment bookings, whose quantity is fixed. |
Use Cases
- Render the cart page — one call returns items and every total needed for the summary panel.
- Refresh the mini-cart — read after any change to pick up recalculated totals.
- Resume a guest session — a stored
cartTokenrestores the cart on a return visit.
Best Practices
- Treat
404 Cart not foundas "no cart yet" — a cart only exists once an item has been added, and it is cleared again when the last item is removed - Read the totals from the response, not from your own arithmetic — discounts and tax are recalculated server-side on every change
- Use the
formatted*fields for display — they carry the active currency's symbol and formatting - Keep the numeric item
id— update and remove both key off it
Related Resources
- Create Cart — obtain the cart token every other cart call needs
- Add to Cart — add a product of any type to the cart
- Update Cart Item — change a line's quantity
- Remove Cart Item — remove one line, or several in one call

