How to recognize the parent bundle id when reading the Order query?

I have installed the Shopify Bundle App and created an order with bundle product. However, in the Order query, I can only get the component item Id but not the bundle parent Id. Any other way to recognize the component item Id is belong to which bundle parent Id when reading the Order query?

Hey @ecommerce_e If you’re using the GraphQL Admin API, the field you’re looking for is lineItemGroup on each LineItem in the Order query. When a line item is part of a bundle, this field returns the parent bundle’s details. When it’s a standalone product, it returns null.

Here’s an example query:

query getOrderWithBundles($id: ID!) {
  order(id: $id) {
    id
    name
    lineItems(first: 50) {
      nodes {
        id
        title
        quantity
        lineItemGroup {
          id
          title
          productId
          variantId
          quantity
        }
      }
    }
  }
}

The LineItemGroup object gives you the parent bundle’s productId, variantId, title, and quantity. To reconstruct the bundle structure, group all line items that share the same lineItemGroup.id. The bundles overview covers how this fits into the broader bundle architecture.

Hope this helps get you on the right track!