1

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.

Chris White
  • 1,068
  • 6
  • 11
Anonymous
  • 31
  • 2

1 Answers1

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