I am building an application where I need to fetch data from my Shopify account using Jquery Ajax. I have gone through documents provided by Shopify, but I have not landed to any solution yet because the documentation provided by Shopify does not make any sense. Please provide solution if you guys have any.
Asked
Active
Viewed 2,050 times
1
-
Have you seen this help page of Shopify : https://help.shopify.com/en/api/reference (using the shopify Ajax API) they provide examples – maliness May 09 '19 at 09:36
-
I have seen but it does not make any sense. Please provide and example if possible. – Anonymous May 09 '19 at 09:41
-
What data do you need exactly? What kind of account do you have? Give more details – maliness May 09 '19 at 09:47
-
I have Shopify account and I want to get list of all customers from using jQuery ajax. – Anonymous May 09 '19 at 09:49
1 Answers
1
You have this help page : https://help.shopify.com/en/api/reference/customers/customer#
this url is available :
GET /admin/api/2019-04/customers.json
this retrieves a list of customers. The documentation show you how to :
- Retrieve all customers for a shop GET /admin/api/2019-04/customers.json
- Retrieve all customers after a specified ID GET /admin/api/2019-04/customers.json?since_id=207119551
- Retrieve all customers changed after a certain date GET /admin/api/2019-04/customers.json?updated_at_min=2019-04-17 19:42:24
- Retrieve a list of specific customers GET /admin/api/2019-04/customers.json?ids=207119551,1073339460
You just have to do a GET call.
This link show you how do you have to do : https://guide.freecodecamp.org/jquery/jquery-ajax-get-method/

maliness
- 184
- 3
- 15
-
actually above approach do not works when I am not logged in my account. – Anonymous May 09 '19 at 10:10
-
This is normal, you must have the correct token authentication for this request in the header. Otherwise everyone could see your customers – maliness May 09 '19 at 11:00
-
would you please share an example. So that I can grasp your point well. – Anonymous May 09 '19 at 11:20
-
that's another question about basic authentification with ajax... you can this help here : https://stackoverflow.com/questions/5507234/use-basic-authentication-with-jquery-and-ajax – maliness May 09 '19 at 11:27
-
Actually this is raising CORS issue. I need need to send ajax requests to Shopify from some other domain not from Shopify itself. – Anonymous May 10 '19 at 04:17