How do I export the restock status at the line item level for a refunded or partially refunded Shopify order?

You can use the formula below in the Calculated Fields to export the restock status of each refunded line item in a Shopify order:

",".join([str(r.restock) for r in load_json_data({{ refunds }}) if str({{ line_items.id }}) in [str(li.line_item_id) for li in r.refund_line_items]])

The output of the formula will either be True or False if there's a matching refund record and will be blank if there's no refund associated with the line item.


Related Articles:


App: EZ Exporter

Tags: advanced features, refunds