Retrieve product information when requesting order

Highlighted
Excursionist
22 2 1

I'd like to perform a single API call that retrieves order information and product information for each `line_item` in the order. Is this possible, or do I need to perform a separate products query as well?

0 Likes
Highlighted
Shopify Partner
52 1 10

Hi. For RESTFul Admin API, you need to do separate queries. 

With GraphQL its possible with one query like below:

 

{
  order(id: "gid://shopify/Order/1083359723601") {
    lineItems {
      edges {
        node {
          product {
            id
          }
        }
      }
    }
  }
}
0 Likes