Skip to main content

Line item component information now available for draft orders on the Customer Account API

As of Customer Account API version 2026-04, the DraftOrderLineItem object includes a new components field. This field returns the individual component line items associated with a parent line item.

Additionally, a new optional argument, flattenComponents, has been introduced to the DraftOrder.lineItems connection. For API versions 2026-04 and later, flattenComponents defaults to false, meaning only top-level line items are returned as nodes, with their components accessible via the DraftOrderLineItem.components field. If set to true, both parent and component line items are returned as top-level nodes, aligning with the behavior of earlier API versions. For versions prior to 2026-04, flattenComponents defaults to true to ensure backward compatibility.

Example

query {
  draftOrder(id: "gid://shopify/DraftOrder/1") {
    lineItems(first: 10) {
      nodes {
        name
        quantity
        components {
          name
          quantity
        }
      }
    }
  }
}
Was this section helpful?