Redirect customer to Checkout using CheckoutToken from a Checkout Extension

Redirect customer to Checkout using CheckoutToken from a Checkout Extension

3node_vackam
Shopify Partner
15 2 2

Hello,

During checkout, I need to redirect the customer to an external page where they choose their pickup point for the order and then get redirected back. The page gets the checkout token in the url query parameters, generated from the useCheckoutToken() hook in Extensions - However, I don't how to construct an URL using this token. Any help would be greatly appreciated. Thanks

Kamil Václavek - Shopify Checkout Extensibility Specialist
Replies 2 (2)

Liam
Community Manager
3108 340 872
Could you use URLSearchParams to construct the URL?

Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog

3node_vackam
Shopify Partner
15 2 2

The problem isn't adding a parameter to the URL. The problem is 1) what URL to use and 2) how to name the parameter which will pass the token.

But from what I observed, the usual approach seems to be a GraphQL api workaround.

Kamil Václavek - Shopify Checkout Extensibility Specialist