Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hey everyone,
I am running a NextJs commerce project and I have troubles redirecting our customer to the checkout page.
We are doing the following:
1. Customer puts stuff in the cart on our custom storefront running on a custom domain (handled with Storefront API all good)
2. Customer clicks the checkout button
3. We are associating the user (when access token present) with the checkout server side and redirect to the checkout url (Status 307 from our server).
4. We get a CORS error from shopify 😥
Strangely enough this all works when running on localhost and we get a status 302 from shopify and the checkout page is shown as expected. I can also open up the url manually in the browser and the checkout is shown as well. Only the redirect from within our application does lead to the CORS problem.
Can anybody help? I am a little clueless...
Regards
Reik
Example URL that we want to redirect to: https://some.myshopify.com/66586783296/checkouts/9f8215d227bc874b7cf67cc25bdd2346?key=ac1c9afd831960...
Did you figure this one out? I'm facing similar issues, but the Storefront API is returning incorrect checkout urls...