Alternative to deprecated averageOrderAmount field

I want to display the average order amount in an app.

There used to be a averageOrderAmount and averageOrderAmountV2 field on the Customer object, but that is being deprecated and removed very soon.

https://shopify.dev/changelog/removal-of-customer-averageorderamount-fields-on-admin-api

But I can’t figure out if there is an alternative to the fields. None is mentioned in the changelog.

I can’t think of anything else other than fetching all the orders, for which you need special access, and then that’s not even desirable as you would potentially have to loop over a lot of orders.

What is currently the best way of getting/calculating the average order amount?

Hi there

I think you could use the two fields numberOfOrders and amountSpent and calculated the average amount by yourself.