Get Cart
Retrieve the current shopping cart with all items and totals.
Endpoint
GET /api/shop/cartRequest Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
X-STOREFRONT-KEY | Yes | Your storefront API key |
Response Fields (200 OK)
| Field | Type | Description |
|---|---|---|
id | integer | Cart ID |
items | array | Items in cart |
subtotal | decimal | Items subtotal |
tax | decimal | Calculated tax amount |
shippingCost | decimal | Shipping cost |
total | decimal | Grand total |
itemCount | integer | Total items in cart |
couponCode | string | Applied coupon code (if any) |
Item Fields
| Field | Type | Description |
|---|---|---|
id | integer | Cart item ID |
productId | integer | Product ID |
productName | string | Product name |
quantity | integer | Item quantity |
price | decimal | Unit price |
subtotal | decimal | Line item total |
attributes | object | Product attributes (color, size, etc.) |
Use Cases
- Display shopping cart summary
- Show cart contents to customer
- Calculate cart totals
- Display cart in sidebar/dropdown
- Pre-checkout cart review

