Line items missing from a fully refunded order json

Line items missing from a fully refunded order json

sapraaman
Visitor
2 0 0

We are using REST API to fetch all orders within specific time range. When we get list of orders, we parse the data, and create multiple csv files, one of which is related to refunds.

 

When we get the list of orders, we get correct "refund_line_items" for all order refunds as long as the order is only partially refunded. For a fully refunded order, we get the refund but "refund_line_items" in the refund is empty.

 

We are using "shopify_api" gem in RoR. Any ideas what's going on and whether it is possible to get refund line items for a full refunded order using REST API. I would like to avoid using GraphQL if possible at this stage of the project.

 

Many thanks in advance.

Replies 2 (2)

Jonathan-HA
Shopify Partner
333 25 105

That does seem odd.  Are you only seeing this for newer orders?

 

We also use the REST API and I ran a quick query on one of our test stores and the refund_line_items is there when financial_status=refunded (this is an old order though):

 

JonathanHA_0-1642195834052.png

 

 

Another possible workaround maybe is add a logic like "if financial_status is refunded and refunds.refund_line_items is null/empty, then use the line_items field"?

 

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
sapraaman
Visitor
2 0 0

Thanks for the tip. It could be related to the API version we are using which is almost 1 year old. We plan to move to the latest version soon. In the meantime, I have implemented your suggestion. Thanks again