Getting cart token

Hi,

I was wondering if there was a way of retrieving the cart token from the javascript-sdk. In version 3 there doesn’t seem to be any way of retrieving the cart token from the session like
Snipcart.api.cart.get() method. I was wondering if the Snipcart.store.getState() method would provide this but the token seems to be null.

The session token that I’m referring to would reference a cart and would be converted to an invoice number once payment has gone through.

Hi there,

In Snipcart version 3, all the app’s state, including data for the current cart, is available using Snipcart.store.getState().

The token can therefore be retrieved via Snipcart.store.getState().cart.token

:+1: :rocket: