Out now! Check out the Poll results: Do you have a Shopify store?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to retrieve the list of all returning customers and New Cutomers by APi

How to retrieve the list of all returning customers and New Cutomers by APi

zhagan
Shopify Partner
22 1 2

does any know how retrieve the list of all returning customers and New Cutomers by APi?

I don't find any information about it in  https://shopify.dev/api/admin-rest/2021-07/resources/customer#[get]/admin/api/2021-07/customers.json

Thanks for your answer.

Reply 1 (1)

Keyurp
Excursionist
27 0 4

Hello @zhagan 


It gets the whole customer of the store from the API. API is not providing the information is like the new and old customers. If you want to find this information then you will have to do some alternatives like in the response of this API will find some date field 'created_at, updated_at, and updated_at_min'.

So that you will have to bifurcate customers for new and old customer e.g the date is today date then this is a new customer and past date is the old customer.

Host URL
https://apiKey:apiPassword@storename.myshopify.com/admin/api/2021-07/customers.json

Request method: Get

I suggest please first try on postman and also replaced your API credential instead of the host URL that I provided then pass the URL in the postman then you will get the result of customers.