--- title: BaseCartLine - Storefront API description: > Defines the shared fields for items in a shopping cart. Implemented by [`CartLine`](/docs/api/storefront/2026-01/objects/CartLine) for individual merchandise and [`ComponentizableCartLine`](/docs/api/storefront/2026-01/objects/ComponentizableCartLine) for grouped merchandise like bundles. Each implementation includes the merchandise being purchased, quantity, cost breakdown, applied discounts, custom attributes, and any associated [`SellingPlan`](/docs/api/storefront/2026-01/objects/SellingPlan). api_version: 2026-01 api_name: storefront type: interface api_type: graphql source_url: html: 'https://shopify.dev/docs/api/storefront/latest/interfaces/BaseCartLine' md: 'https://shopify.dev/docs/api/storefront/latest/interfaces/BaseCartLine.md' --- # Base​Cart​Line interface Defines the shared fields for items in a shopping cart. Implemented by [`CartLine`](https://shopify.dev/docs/api/storefront/2026-01/objects/CartLine) for individual merchandise and [`ComponentizableCartLine`](https://shopify.dev/docs/api/storefront/2026-01/objects/ComponentizableCartLine) for grouped merchandise like bundles. Each implementation includes the merchandise being purchased, quantity, cost breakdown, applied discounts, custom attributes, and any associated [`SellingPlan`](https://shopify.dev/docs/api/storefront/2026-01/objects/SellingPlan). ## Fields * attribute [Attribute](https://shopify.dev/docs/api/storefront/latest/objects/Attribute) An attribute associated with the cart line. * key [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required ### Arguments The key of the attribute. *** * attributes [\[Attribute!\]!](https://shopify.dev/docs/api/storefront/latest/objects/Attribute) non-null The attributes associated with the cart line. Attributes are represented as key-value pairs. * cost [Cart​Line​Cost!](https://shopify.dev/docs/api/storefront/latest/objects/CartLineCost) non-null The cost of the merchandise that the buyer will pay for at checkout. The costs are subject to change and changes will be reflected at checkout. * discount​Allocations [\[Cart​Discount​Allocation!\]!](https://shopify.dev/docs/api/storefront/latest/interfaces/CartDiscountAllocation) non-null The discounts that have been applied to the cart line. * id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) non-null A globally-unique ID. * merchandise [Merchandise!](https://shopify.dev/docs/api/storefront/latest/unions/Merchandise) non-null The merchandise that the buyer intends to purchase. * quantity [Int!](https://shopify.dev/docs/api/storefront/latest/scalars/Int) non-null The quantity of the merchandise that the customer intends to purchase. * selling​Plan​Allocation [Selling​Plan​Allocation](https://shopify.dev/docs/api/storefront/latest/objects/SellingPlanAllocation) The selling plan associated with the cart line and the effect that each selling plan has on variants when they're purchased. * estimated​Cost [Cart​Line​Estimated​Cost!](https://shopify.dev/docs/api/storefront/latest/objects/CartLineEstimatedCost) non-nullDeprecated *** ## Types implemented in * [Cart​Line](https://shopify.dev/docs/api/storefront/latest/objects/CartLine) OBJECT An item in a customer's [`Cart`](https://shopify.dev/docs/api/storefront/2026-01/objects/Cart) representing a product variant they intend to purchase. Each cart line tracks the merchandise, quantity, cost breakdown, and any applied discounts. Cart lines can include custom attributes for additional information like gift wrapping requests, and can be associated with a [`SellingPlanAllocation`](https://shopify.dev/docs/api/storefront/2026-01/objects/SellingPlanAllocation) for purchase options like subscriptions, pre-orders, or try-before-you-buy. The [`instructions`](https://shopify.dev/docs/api/storefront/2026-01/objects/CartLine#field-CartLine.fields.instructions) field indicates whether the line can be removed or have its quantity updated. * attribute [Attribute](https://shopify.dev/docs/api/storefront/latest/objects/Attribute) An attribute associated with the cart line. * key [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required ### Arguments The key of the attribute. *** * attributes [\[Attribute!\]!](https://shopify.dev/docs/api/storefront/latest/objects/Attribute) non-null The attributes associated with the cart line. Attributes are represented as key-value pairs. * cost [Cart​Line​Cost!](https://shopify.dev/docs/api/storefront/latest/objects/CartLineCost) non-null The cost of the merchandise that the buyer will pay for at checkout. The costs are subject to change and changes will be reflected at checkout. * discount​Allocations [\[Cart​Discount​Allocation!\]!](https://shopify.dev/docs/api/storefront/latest/interfaces/CartDiscountAllocation) non-null The discounts that have been applied to the cart line. * id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) non-null A globally-unique ID. * instructions [Cart​Line​Instructions!](https://shopify.dev/docs/api/storefront/latest/objects/CartLineInstructions) non-null The instructions for the line item. * merchandise [Merchandise!](https://shopify.dev/docs/api/storefront/latest/unions/Merchandise) non-null The merchandise that the buyer intends to purchase. * parent​Relationship [Cart​Line​Parent​Relationship](https://shopify.dev/docs/api/storefront/latest/objects/CartLineParentRelationship) The parent of the line item. * quantity [Int!](https://shopify.dev/docs/api/storefront/latest/scalars/Int) non-null The quantity of the merchandise that the customer intends to purchase. * selling​Plan​Allocation [Selling​Plan​Allocation](https://shopify.dev/docs/api/storefront/latest/objects/SellingPlanAllocation) The selling plan associated with the cart line and the effect that each selling plan has on variants when they're purchased. * estimated​Cost [Cart​Line​Estimated​Cost!](https://shopify.dev/docs/api/storefront/latest/objects/CartLineEstimatedCost) non-nullDeprecated * [Componentizable​Cart​Line](https://shopify.dev/docs/api/storefront/latest/objects/ComponentizableCartLine) OBJECT Represents information about the grouped merchandise in the cart. * attribute [Attribute](https://shopify.dev/docs/api/storefront/latest/objects/Attribute) An attribute associated with the cart line. * key [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required ### Arguments The key of the attribute. *** * attributes [\[Attribute!\]!](https://shopify.dev/docs/api/storefront/latest/objects/Attribute) non-null The attributes associated with the cart line. Attributes are represented as key-value pairs. * cost [Cart​Line​Cost!](https://shopify.dev/docs/api/storefront/latest/objects/CartLineCost) non-null The cost of the merchandise that the buyer will pay for at checkout. The costs are subject to change and changes will be reflected at checkout. * discount​Allocations [\[Cart​Discount​Allocation!\]!](https://shopify.dev/docs/api/storefront/latest/interfaces/CartDiscountAllocation) non-null The discounts that have been applied to the cart line. * id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) non-null A globally-unique ID. * line​Components [\[Cart​Line!\]!](https://shopify.dev/docs/api/storefront/latest/objects/CartLine) non-null The components of the line item. * merchandise [Merchandise!](https://shopify.dev/docs/api/storefront/latest/unions/Merchandise) non-null The merchandise that the buyer intends to purchase. * quantity [Int!](https://shopify.dev/docs/api/storefront/latest/scalars/Int) non-null The quantity of the merchandise that the customer intends to purchase. * selling​Plan​Allocation [Selling​Plan​Allocation](https://shopify.dev/docs/api/storefront/latest/objects/SellingPlanAllocation) The selling plan associated with the cart line and the effect that each selling plan has on variants when they're purchased. * estimated​Cost [Cart​Line​Estimated​Cost!](https://shopify.dev/docs/api/storefront/latest/objects/CartLineEstimatedCost) non-nullDeprecated *** ##### Variables ```json { "attribute": { "key": "" }, "attributes": "", "cost": "", "discountAllocations": "", "estimatedCost": "", "id": "", "merchandise": "", "quantity": "", "sellingPlanAllocation": "" } ``` ##### Schema ```graphql interface BaseCartLine { attribute: Attribute attributes: [Attribute!]! cost: CartLineCost! discountAllocations: [CartDiscountAllocation!]! estimatedCost: CartLineEstimatedCost! id: ID! merchandise: Merchandise! quantity: Int! sellingPlanAllocation: SellingPlanAllocation } ```