How do I export the refunded subtotal of all the refunded line items from a Shopify order?

To export the refunded subtotal (i.e. excluding taxes) of all refunded line items 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)), "subtotal", 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 subtotal at the line item level, you can simply select the field line_items.refunded_subtotal.


Related Articles:


App: EZ Exporter

Tags: advanced features, refunds, calculated fields