Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Cart Lines API

The Cart Lines API provides the line items in the order, including product details, quantities, costs, and discounts. Use it to display order contents or calculate item totals on the Order status page.

  • Display order items: Show the list of products purchased, including titles, images, selected options, and quantities.
  • Show line-level pricing: Display the cost breakdown for individual line items, including any discounts applied to specific lines.
  • Handle bundles: Detect and display bundle products by checking each cart line for bundled sub-items.

The Cart Lines API object provides the line items from the order. Access the following properties on the API object to read line item data.

Anchor to lines
lines
StatefulRemoteSubscribable<[]>
required

The line items in the order, including product details, quantities, costs, and any applied discounts.

Anchor to Cart line item propertiesCart line item properties

The shopify global object provides the following additional properties on shopify for extensions registered for the cart-line-item extension targets.

Anchor to target
target
StatefulRemoteSubscribable<>
required

The cart line that this extension is attached to. Use this to read the line item's merchandise, quantity, cost, and attributes.


  • Check for bundle components: Use lineComponents to detect and display bundle contents. The array is empty for non-bundle items.
  • Use line item costs for accurate totals: The cost.totalAmount on each line item already includes line-level discounts.

  • Cart lines don't include fulfillment or shipping status. To determine whether items have been shipped, use the GraphQL Admin API through a backend service.

Was this page helpful?