Retrieve a checkout, using Storefront API

Retrieve a checkout, using Storefront API

saraZam
Visitor
1 0 0

While the user is still in the checkout page, I need to retrieve that checkout, to have the most up-to-date lineitems array to use in my UI modification JS file.

I need to use Storefront API to retrieve the checkout, but the checkout itself has not been created thru the Storefront API (i.e. with using checkoutCreate), so I'd need something like the checkout.id to be able to make any query.

I know that I have access to that checkout.id on the checkout page because when I add this line to to my checkout.liquid file, I get the id back:

console.log ("checkout ID: ", "{{checkout.id}}");
 

but I don't know how should I get the correct checkout.id thru Storefront API,  any ideas?

Replies 0 (0)