How do I get returned products (line items) for all returns

Exillar12
Visitor
1 0 0

Hi, I'm writing a script that will pull all orders and returns from my shopify store, which I wanted to use to identify which products are getting returned the most. However, I have tried using multiple ways to get returned items to no avail. does anyone know how I can get returned products?

P.S :- As I'm gathering all orders and associated returns, I can't input id argument for every return instance.

here is the query so far, (I've removed some parts, shouldn't be necessary to this question)

{
  orders(first: 100) {
    edges {
      node {
        id
        name
        displayFinancialStatus
        displayFulfillmentStatus
        totalTax
        subtotalPrice
        totalPrice
        currencyCode
        createdAt
        updatedAt
        lineItems(first: 100) {
                    edges {
                        node {
                            title
                            variantTitle
                            quantity
                        }
                    }
                }
        refunds {
          createdAt
          order {
            closed
          }
          totalRefundedSet {
            shopMoney {
              amount
            }
          }
        }
      }
    }
  }
}
Replies 0 (0)