Cart
Represents a cart in the store, exposing totals, items, discounts, shipping, and payment information for GraphQL APIs.
Type Definition
type Cart {
id: String
createdAt: String
customer: Customer
discounts: [CartDiscount]
tags: [String]
subtotalPrice: Float
totalPrice: Float
currency: String
totalNetPrice: Float
totalTax: Float
taxLines: [CartTaxLine]
customerNote: String
paymentMethods: [CartPaymentMethod]
paymentFee: Float
shippingMethods: [CartShippingMethod]
shippingPrice: Float
lines: [CartLineItem]
physicalLines: [CartLineItem]
lineCount: Int
shippingAddress: Address
billingAddress: Address
checkoutUrl: String
}Fields
Relationships
The Cart type relates to several other types in the schema:
- Customer: Optionally linked to a customer entity associated with the cart
- CartDiscount: Contains zero or more discounts applied to the cart
- CartTaxLine: Includes tax line items calculated for the cart
- CartPaymentMethod: Lists available or selected payment methods
- CartShippingMethod: Lists available shipping options
- CartLineItem: Contains the actual items in the cart, with separate physical and all items collections
- Address: References both shipping and billing addresses for the cart
Example
{
cart(id: "eyJhbGciOiJIUzI1NiJ9...") {
id
createdAt
totalPrice
subtotalPrice
totalTax
currency
lineCount
customer {
id
email
}
lines {
id
quantity
}
discounts {
code
}
shippingAddress {
city
country
}
checkoutUrl
}
}Implements
This type does not implement any interfaces.