Skip to content

Get Cart

About

The getCart query retrieves the contents and summary information for a customer's shopping cart. Use this query to:

  • Display cart previews in sidebars and mini carts
  • Render the full shopping cart page
  • Calculate cart totals with applied discounts and taxes
  • Show line item details and product information
  • Track cart state throughout the checkout process
  • Sync cart data with external inventory systems

This query returns complete cart information including all items, quantities, prices, and applicable discounts/taxes needed for checkout and order processing.

Possible Returns

FieldTypeDescription
idString!Unique cart identifier/token.
items[CartItem!]!Array of products in the cart.
items.idString!Unique cart line item ID.
items.productProduct!Product object with id, name, sku.
items.quantityInt!Number of items ordered.
items.priceFloat!Unit price at time of adding to cart.
items.lineTotalFloat!Total for line item (price × quantity).
itemsCountInt!Total number of line items in cart.
itemsQuantityInt!Total quantity of all items.
subTotalFloat!Cart subtotal before discounts and taxes.
discountAmountFloatTotal discount applied to cart.
taxAmountFloat!Calculated tax on cart.
shippingAmountFloat!Selected shipping cost.
totalFloat!Grand total (subtotal + tax + shipping - discounts).
appliedCoupons[CouponCode!]Active coupon codes applied to cart.
shippingMethods[ShippingMethod!]Available shipping options and costs.
currencyString!Cart currency code (e.g., USD, EUR).
createdAtDateTime!Cart creation timestamp.
updatedAtDateTime!Last update timestamp.

Released under the MIT License.