What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: how to get total returns by a customer through API

Solved

how to get total returns by a customer through API

returnsage123
Shopify Partner
1 0 0

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 ?

 

 

Accepted Solution (1)

invi5H
Shopify Partner
1 1 0

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

 

View solution in original post

Reply 1 (1)

invi5H
Shopify Partner
1 1 0

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