GraphQL refunds but no refundLineItems retrieved

eraskin
New Member
1 0 0

Hi:

Noob here.  I am downloading orders and refunds to sync with my system.  When I go to download refunds, I get entries but they have no refundLineItems values (empty edges[] array returned).   Is this possible?  Here's the image of the test refund:

eraskin_0-1608233910277.png

Here's the GraphQL query:

 

 

query($numOrders: Int!, $cursor: String, $criteria: String!) {{
  orders(first:$numOrders, query: $criteria, after: $cursor) {{
    edges {{
      cursor
      node {{
        id
        name
        customer {{
          id
        }}
        totalPrice
        totalRefunded
        totalShippingPrice
        cancelledAt
        closed
        closedAt
        createdAt
        fulfillments {{
          createdAt
        }}
        refunds(first:10) {{
          createdAt
          refundLineItems(first:10) {{
            edges {{
              node {{
                lineItem {{
                  quantity
                  sku
                }}
                price
                subtotal
              }}
            }}
          }}
          totalRefunded {{
            amount
          }}
          id
        }}
        tags
      }}
    }}
    pageInfo {{
      hasNextPage
      hasPreviousPage
    }}
  }}
}}

 

 

Variables are:

 

 

{
 "numOrders": 5,
 "cursor": null,
 "criteria": "created_at:>2020-01-01T00:00:00Z created_at:<2020-12-31T00:00:00Z financial_status:refunded status:closed"
}

 

 

Here are the results:

eraskin_1-1608234132174.png

Why is my refundLineItems empty?

0 Likes
_JCC_
Shopify Staff
Shopify Staff
158 21 27

@eraskin 

It is possible to perform a refund in Shopify without selecting a line item to be refunded. If no line items are selected when the refund is created the refundLineItems as you're seeing will be an empty list.

Regards,

John

John C | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes