# Cart Represents a cart in the store, exposing totals, items, discounts, shipping, and payment information for GraphQL APIs. ## Type Definition ```graphql 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 | Field | Type | Description | |-------|------|-------------| | id | String | Returns the id for this cart. | | createdAt | String | Date when this order was created in RFC 2822 format. | | confirmedAt | String | Date when this order was confirmed in RFC 2822 format. | | fulfilledAt | String | Date when this order was fulfilled in RFC 2822 format. | | customer | Customer | [Customer](#objects/store/customer) linked to this order if any. | | discounts | [CartDiscount] | Return the discounts applied to this cart. | | tags | [String] | Returns the tags associated with this cart. | | subtotalPrice | Float | Returns the subtotal in customer's currency. | | totalPrice | Float | Returns the total in customer's currency. | | currency | String | Returns the currency for this cart. | | totalNetPrice | Float | Returns the net total in customer's currency. | | totalTax | Float | Returns the total tax in customer's currency. | | taxLines | [CartTaxLine] | Returns the tax lines for this cart. | | customerNote | String | Returns the customer note. | | paymentMethods | [CartPaymentMethod] | Returns the payment methods for this cart. | | paymentFee | Float | Returns the total payment fee in customer's currency. | | shippingMethods | [CartShippingMethod] | Returns the shipping methods for this cart. | | shippingPrice | Float | Returns 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. | | lineCount | Int | Returns the number of items in this cart. | | shippingAddress | Address | Returns the shipping address for this cart. | | billingAddress | Address | Returns the billing address for this cart. | | checkoutUrl | String | Returns 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](#objects/store/customer) if a customer is linked to the cart. It contains collections of [CartDiscount](#objects/store/cart-discount) objects representing applied discounts, [CartTaxLine](#objects/store/cart-tax-line) objects for tax calculations, [CartPaymentMethod](#objects/store/cart-payment-method) objects for available payment options, [CartShippingMethod](#objects/store/cart-shipping-method) objects for shipping choices, and [CartLineItem](#objects/store/cart-line-item) objects representing the items in the cart. Shipping and billing information is provided through [Address](#objects/store/address) objects. ## Example ```graphql 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. ## Related Types - [Customer](/reference/storefront/v1/objects/customer) - [CartDiscount](/reference/storefront/v1/objects/cart-discount) - [CartTaxLine](/reference/storefront/v1/objects/cart-tax-line) - [CartPaymentMethod](/reference/storefront/v1/objects/cart-payment-method) - [CartShippingMethod](/reference/storefront/v1/objects/cart-shipping-method) - [CartLineItem](/reference/storefront/v1/objects/cart-line-item) - [Address](/reference/storefront/v1/objects/address)