How to get cart token from StoreFront GraphQL API

kushagrapushowl
Tourist
5 0 1

I am building a custom Frontend for my store on top on StoreFront GraphQL API. For some purpose, I need the cart token whenever the cart is updated (i.e. lineitems are updated). 

When adding line items, I get back a checkout response which has an ID - a base64 string which is something like gid://shopify/Checkout/<someID>?key=<somekey>.

Is the cart token in that URL? Otherwise how can the cart token be obtained?

0 Likes
Greg_Kujawa
Shopify Partner
947 79 202

Couldn't you listen for and handle the checkout creation webhook? That would pass along the cart token and everything else, right?

0 Likes