Skip to main content

Cart Lines API

The Cart Lines API provides read-only access to the line items in an order on the Order status page. Use this API to read merchandise details, quantities, per-line costs, discount allocations, and bundle components for each item the customer purchased.

  • 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 shopify global object provides the line items in the order. Access the following properties on shopify to read merchandise details, quantities, per-line costs, discount allocations, and bundle line components.

Anchor to lines
lines
<[]>
required

A list of line items in the order. Each line includes the merchandise, quantity, cost, custom attributes, and discount allocations.

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
<>
required

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


  • Group related lines by product: Multiple cart lines can reference the same product with different variants or options. Group by merchandise.product.id if you need to show a product-level summary.

  • 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?