Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hi,
I have been implementing store front API to customise checkout. In that I have created private app and granted access to modify checkout. When I create checkout using API, then it gives me checkout id as "gid://shopify/Checkout/324ssdasd234asd233wde234ddsdfdsy?key=4d4dftdser4ddasdd23rddwd324sd456"
(Note : Its Base64 decoded)
Now, I have checkout token/id (3ba5a280f8f5599250f42185fba140tt, got this from browser URL) for web user, I want to update this checkout using store front API. Is it possible to do that ? If Yes! then from where I get KEY for this checkout to form gid URL like gid://shopify/Checkout/3ba5a280f8f5599250f42185fba140tt?key= <?>
Also is it best practice to update checkout like this ?
Thanks
I have a related question. I am doing exactly what @anupsai_28988 is doing, using JavaScript like this:
btoa('gid://shopify/Checkout/checkout_token?key=checkout_key')
and then passing to a GraphQL query to get back Checkout object details.
This is fine if I've used "checkoutCreate" to create the Checkout, but if I'm going through as an anonymous user, I don't get this "key" query parameter. Is there a way to get to that value from within the checkout flow, maybe from a cookie or Shopify JS object?
Thanks
@filosganga, no, I think what I was trying to do is not possible. I do not rely on being able to do this.