App reviews, troubleshooting, and recommendations
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi All,
We are trying to calculate customer returns programmatically. I couldn't find any object/variable/query that allow us to readily use the total returns by customers. Only close option I can see is this: https://shopify.dev/docs/api/admin-graphql/2024-01/objects/Customer#connection-orders-query-query-fi.... However, we want to get customers with count of returns done in the life time. Is there any other way we can get parameters closer to this ?
Solved! Go to the solution
This is an accepted solution.
This is not directly available and you are on the right track.
But instead of getting customer object, it would be slightly cheaper to directly use the orders query. Query by both the "customer_id" and "return_status".
https://shopify.dev/docs/api/admin-graphql/2024-01/queries/orders#argument-query
This is an accepted solution.
This is not directly available and you are on the right track.
But instead of getting customer object, it would be slightly cheaper to directly use the orders query. Query by both the "customer_id" and "return_status".
https://shopify.dev/docs/api/admin-graphql/2024-01/queries/orders#argument-query