Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Accessing web user checkout using store front checkout API

Accessing web user checkout using store front checkout API

anupsai_28988
Visitor
1 0 1

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

 

 

 

 

 

Replies 3 (3)

JoshS
Shopify Partner
12 0 8

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
Shopify Partner
6 0 2

@anupsai_28988 @JoshS did you guys figured it out how to achieve that?

Josh68
Excursionist
21 2 10

@filosganga, no, I think what I was trying to do is not possible. I do not rely on being able to do this.