Get or Create Cart

Carts are public, shared by all, and retrievable by id. Carts contain all of the basic meta you need to build a cart + checkout, including totals with tax, shipping, and cart item line and sub totals.

Carts persist for 14 days. Make sure you update the cart to keep it alive if you are sending customers recovery/abandoned emails.

Query

cart(id: ID!, currency: CurrencyInput): Cart!
ArgumentsTypeDescription
idID!The id of the cart you want to fetch
currencyCurrencyInputThe cart currency properties

Example

{
  cart(id: "ck5r8d5b500003f5o2aif0v2b") {
    id
    isEmpty
    totalItems
    items {
      id
    }
  }
}