Hi everyone,> > I’m building a headless storefront using Next.js and Shopify, and I need help figuring out how to redirect users after checkout.> > We are on the Shopify Plus plan, and ideally, we would like customers to land on a custom thank-you page on our own domain after they complete their order. For example: /thankyou on our Next.js frontend.> > A few details:We do not have access to checkoutliquid, so that method is not possible.The storefront is fully headless (we are not using a Shopify theme).> > We are exploring options such as:> > 1.Checkout UI Extensions> > 2.Post-purchase Extensions> > 3.Shopify Functions> > 4.Any Shopify Plus-exclusive capabilities
Hello @Satindersingh Since you’re on Shopify Plus and using a headless storefront (Next.js), your goal of redirecting users to a custom /thankyou page on your own domain after checkout is possible but requires a workaround—because Shopify does not natively support custom post-checkout redirects to external domains (even on Plus) unless you’re using Checkout.liquid, which you’ve said is unavailable (possibly due to Checkout Extensibility being enabled).
Here’s the truth:
You cannot directly change the final redirect URL of the Shopify-hosted checkout to go to your Next.js /thankyou page. The post-checkout thank-you page (order status page) lives on Shopify’s domain, and Shopify does not support redirecting customers away from this page for security and tracking reasons.
But there are clever workarounds that can still help achieve your goal:
Recommended Workaround
Embed a redirect into the “Additional Scripts” section of the Checkout Settings in Shopify Admin, available to Shopify Plus merchants.
Steps:
-
Go to Shopify Admin > Settings > Checkout > Order Status Page > Additional Scripts.
-
Paste in the following Javascript:
This auto-redirects users from the Shopify thank-you page to your own /thankyou route, passing along order info via query params.
This lets you still track orders in Shopify, while handling the final thank-you experience on your frontend.
What won’t work:
. Checkout UI Extensions: Only work inside the checkout, not for redirecting post-checkout.
. Post-purchase extensions: These render after payment but before the thank-you page, and cannot alter redirects.
. Shopify Functions: Modify backend logic (discounts, shipping rates, etc.) — not useful for redirects.
. Shopify Plus APIs: Useful for customer data, etc., but again, can’t force a redirect away from Shopify’s post-checkout page.
Cautions
. Do not rely on the redirect for mission-critical logic. Shopify may eventually change how they treat script injections.
. You may break some tracking or analytics (like Facebook Pixel) if you redirect too quickly. Add a delay if needed.
. Test thoroughly on production-like environments.
Thank you ![]()
Hi @Satindersingh Thanks for sharing.
Since you’re on Shopify Plus and using a fully headless Next.js storefront, you can try the following options:-
-
Use a Script Tag
-
Try Checkout UI Extensions
-
Upgrade to Shopify Plus – As a Plus merchant, you can track checkout completion and send a confirmation email automatically.
-
Use a Custom App – Instead of redirecting immediately, you can create a landing flow with a thank you page with a CTA that link to thanks you.
Let me know which one works for you.