shopify ajax call api cros problem

Topic summary

Core Issue:
An AJAX call to Shopify’s Admin API (/admin/api/2022-07/pages.json) worked before a domain name change but now fails with a CORS (Cross-Origin Resource Sharing) error. The error indicates missing Access-Control-Allow-Origin headers, and the request is being redirected from the new domain to the old myshopify.com domain.

Attempted Solutions:

  • Switching from jQuery.ajax to Shopify.request() function resulted in “Shopify.request is not a function” error in the liquid page context
  • Code snippets provided require proper Shopify token and title parameter replacement
  • Images were shared showing the CORS error and domain redirect behavior

Current Status:
The issue remains unresolved. One participant offered to examine the theme code directly to identify alternative solutions, but access details haven’t been established. The problem appears related to domain redirects interfering with API authentication and CORS policies rather than the code itself.

Summarized with AI on November 20. AI used: claude-sonnet-4-5-20250929.

Not working.