Alternative to deprecated averageOrderAmount field

Alternative to deprecated averageOrderAmount field

Paul_vd_Dool
Shopify Partner
111 6 97

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?

Doppelganger - Managing duplicate user accounts
Reply 1 (1)

Eric-HAN
Shopify Partner
89 13 6

Hi there

 

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

EricHAN_0-1719286177832.png

 

- Helpful? Please hit Like and mark it as a solution
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me    Buy Me A Coffee