Przejdź do głównej zawartości

CartLine

A single line item in the cart — one variant, a quantity and the data attached to it (cost, attributes, configurator selections).

type CartLine {
attributeSelections: [AttributeSelection!]!
attributes: [Attribute!]!
cost: CartLineCost!
discountAllocations: [CartDiscountAllocation!]!
giftCardRecipient: GiftCardLineRecipient
id: ID!
productHandle: String
productId: ID
productTitle: String
productType: ProductTypeEnum
quantity: Int!
requiresShipping: Boolean!
variant: ProductVariant!
}

Fields

CartLine.attributeSelections ● [AttributeSelection!]! non-null object

Typed configurator selections filled in by the buyer (snapshot from add-to-cart). Validated server-side against the product attribute definition; carries any pricing surcharge.

CartLine.attributes ● [Attribute!]! non-null object

Free-form custom attributes (line item properties) attached to this line — engraving text, gift wrap, B2B PO line reference, etc.

CartLine.cost ● CartLineCost! non-null object

Per-line cost breakdown (unit price, subtotal, total, optional compare-at).

CartLine.discountAllocations ● [CartDiscountAllocation!]! non-null object

Discount amounts applied to this line, one entry per discount code that reduced it. Empty when no code discounts this line (the code may still apply to other lines — check cart.discountCodes). Amounts across all lines sum to cart.cost.totalDiscount. Line cost.total is not reduced by these amounts.

CartLine.giftCardRecipient ● GiftCardLineRecipient object

Recipient details captured for a GIFT_CARD line via cartUpdateGiftCardRecipient. Null for non-gift-card lines or when no recipient has been set yet — in that case the gift card is delivered to the order customerEmail on completion. Use to initialise the "gift recipient" form from cart state on SSR / page reload / deep link instead of keeping it in client-only state.

CartLine.id ● ID! non-null scalar

Stable line identifier. Use it to address the line in cartUpdateLines / cartRemoveLines.

CartLine.productHandle ● String scalar

URL handle (slug) of the parent product — link target for the cart drawer (denormalised).

CartLine.productId ● ID scalar

ID of the parent product. Denormalised so a cart drawer renders without an extra round-trip.

CartLine.productTitle ● String scalar

Display title of the parent product (denormalised).

CartLine.productType ● ProductTypeEnum enum

Type of the parent product (PHYSICAL, DIGITAL, SERVICE, SUBSCRIPTION, GIFT_CARD). Drives whether the line requires shipping and which post-purchase flow applies.

CartLine.quantity ● Int! non-null scalar

Quantity of the variant in this line (≥ 1; set to 0 with cartUpdateLines to remove).

CartLine.requiresShipping ● Boolean! non-null scalar

True when this line requires physical shipping (productType = PHYSICAL). False for digital, gift card, service and subscription items. Use together with Cart.requiresShipping to decide whether to render the shipping step.

CartLine.variant ● ProductVariant! non-null object

The variant being purchased — fresh data (current price, image, stock).

Member Of

CartLineConnection object ● CartLineEdge object