How do I export the total refunded quantity at the order level?

To export the total refunded line item quantity from a Shopify order, you can use the formula below in the Calculated Fields section of EZ Exporter:

get_total(get_attribute_value(flatten_list(get_attribute_value({{ refunds }}, "refund_line_items", return_raw_results=True)), "quantity", recursive=False, return_raw_results=True))

This is quite coomplicated as it requires parsing the raw refunds data which is deeply nested.

If you need the refunded quanity at the line item level, you can simply select the field line_items.refunded_quantity.


Related Articles:


App: EZ Exporter

Tags: advanced features, refunds, calculated fields