Admin API

devsinfluencer
Shopify Partner
4 0 0

Hello Team, 

I have created a template and integrated it with the admin API generated from Shopify apps. The purpose of this API is to retrieve orders and products based on certain criteria. While this setup works perfectly fine on the staging site, I encountered an error after going live. Below is the error message I received:

Error: 
Access to fetch at 'https://staging-site.com/admin/api/2023-07/customers/customernumber/orders.json?status=any' (redirected from 'https://live-site.com/admin/api/2023-07/customers/customernumber/orders.json?status=any') from origin 'https://live-site.com' 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Attachement: https://prnt.sc/WyZ5V1cBCizE

How can I resolve the redirection and CORS policy issues to successfully run this API?

Thank you in Advance!!!

Replies 0 (0)