How to filter returns & exchanges data in Reports

Hi,

I am looking to support a Merchant who wants to filter out (and filter for) returns & exchanges SalesAgreements that happen through the Returns & Exchanges API. For example, this merchant does not want to see returns & exchanges data in a particular sales report because they want to isolate sales that happen on original purchases on the online store. The problem is that using the Returns & Exchanges API, these SalesAgreements appear on the sales channel as the original order, so it’s not obvious how to filter them out.

Here is a short video where I outline the problem and desired solution. That should provide all the context necessary to understand what I’m asking for.

Thanks!

Hi @Jake_Goodman,

Thanks for providing the screen recording explaining what you’re looking for, it definitely made it much easier to understand and replicate.

I’ve been looking into this on my own test store and I can confirm that it is possible to filter the Sales reports to only display the original order transactions.

You can remove both the Return and Exchange transactions with a single filter, using the Excludes post-order adjustment filter set to yes.

Alternatively if you only want to remove the Return transactions, you can do so with the Order or return filter.

If you were creating the analytics reports via a ShopifyQL query, the filters would look like this in the query:

  WHERE order_name = '#1098'
    AND excludes_post_order_adjustments = true
    AND order_or_return != 'return'

Hi @Jake_Goodman,

I just wanted to follow up and confirm if this answered all your questions here? If so we can go ahead and mark this thread as solved, otherwise I’m happy to help answer any further questions you may have on this topic!