Skip to Content

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

FieldTypeDescription
idStringReturns the id for this cart.
createdAtStringDate when this order was created in RFC 2822 format.
confirmedAtStringDate when this order was confirmed in RFC 2822 format.
fulfilledAtStringDate when this order was fulfilled in RFC 2822 format.
customerCustomerCustomer linked to this order if any.
discounts[CartDiscount]Return the discounts applied to this cart.
tags[String]Returns the tags associated with this cart.
subtotalPriceFloatReturns the subtotal in customer’s currency.
totalPriceFloatReturns the total in customer’s currency.
currencyStringReturns the currency for this cart.
totalNetPriceFloatReturns the net total in customer’s currency.
totalTaxFloatReturns the total tax in customer’s currency.
taxLines[CartTaxLine]Returns the tax lines for this cart.
customerNoteStringReturns the customer note.
paymentMethods[CartPaymentMethod]Returns the payment methods for this cart.
paymentFeeFloatReturns the total payment fee in customer’s currency.
shippingMethods[CartShippingMethod]Returns the shipping methods for this cart.
shippingPriceFloatReturns the total shipping costs in customer’s currency.
lines[CartLineItem]Returns the items in this cart.
physicalLines[CartLineItem]Returns the physical items in this cart.
lineCountIntReturns the number of items in this cart.
shippingAddressAddressReturns the shipping address for this cart.
billingAddressAddressReturns the billing address for this cart.
checkoutUrlStringReturns the checkout URL for this cart.

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.