FROM CACHE - en_header

CORS issues associating customer with checkout

10 3 4


let req = new XMLHttpRequest() "GET", context.state.checkout.webUrl  )
req.setRequestHeader("X-Shopify-Customer-Access-Token", window.localStorage.shopifyAccessToken);
req.setRequestHeader("Access-Control-Allow-Origin", "*");


redirecting to the Buy SDK webUrl with an associated customer and the request is being blocked by CORS ... 


Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at   (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).



Reply 1 (1)
Shopify Staff
Shopify Staff
1098 146 224

Hey @samullman 


Have you tried redirecting the customer to context.state.checkout.webUrl, instead of using AJAX?

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog