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.

Api through ajax call not working

Api through ajax call not working

AlishaMathur
New Member
4 0 0

Hello team, 

I want to do some customization on my site. 
I want to fetch specific customers on frontend through apis, but when i call its shows error 
Access to XMLHttpRequest at from origin has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Please give any solution regarding this or any other method to call customers on frontend.

Replies 4 (4)

kneeki
Shopify Partner
23 2 4

That's a CORS error. What URL are you posting to, and if it's local on your machine, is your development environment configured correctly?

---
AlishaMathur
New Member
4 0 0

not on local, i am using live server 

AlishaMathur
New Member
4 0 0

https://fabcurate.myshopify.com/ is my url and i am using live environment.

kneeki
Shopify Partner
23 2 4

Do you have any code you can share to help diagnose this?

---