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
confirmedAt: String
fulfilledAt: 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. It maintains a reference to a Customer if a customer is linked to the cart. It contains collections of CartDiscount objects representing applied discounts, CartTaxLine objects for tax calculations, CartPaymentMethod objects for available payment options, CartShippingMethod objects for shipping choices, and CartLineItem objects representing the items in the cart. Shipping and billing information is provided through Address objects.
Example
query GetCart {
cart(id: "eyJhbGciOiJIUzI1NiJ9...") {
id
createdAt
totalPrice
currency
subtotalPrice
totalTax
shippingPrice
lineCount
customer {
id
email
}
lines {
id
quantity
}
discounts {
code
amount
}
shippingAddress {
city
country
}
checkoutUrl
}
}Implements
This type does not implement any interfaces.