Spree integration - where to find cart token?

  • 13 July 2022
  • 1 reply

Badge +1


we are running a spree commerce site. We are using the official integration at

Everything works great, except the “Return to your cart” link. Spree requires a token to rebuild the cart, but we could find that variable anywhere. Without the token, cart will be empty, which makes the flow useless.

Can anyone please let me know if that variable exists in current Spree integration or not? If yes, where could i find it?

Thank you



Best answer by Dov 13 July 2022, 18:55

View original

1 reply

Userlevel 7
Badge +61

Hi @stevensbooks,

Thanks for sharing this question with our community.

There currently isn’t a cart rebuild token for the Spree integration. Instead, we’ll use the organization URL/cart to direct the user back to their cart page on your site. 

I noticed you had also reached out to our support team on this (they have filed a feature request to expand the integration to include the rebuild token). I’m going to post their reply here in case anyone else is following along and looking for alternative solutions:

OPTION 1: Continue using the default Started Checkout event, but pass the cart token into Klaviyo as a custom profile property via our Identify API. 

Please refer to our guide here for Javascript (frontend) Identify calls: 

Please refer to our guide here for Server-side Identify calls:

Either way, you will be able to pass the cart token into Klaviyo as a custom profile property. Once the profile property exists within Klaviyo, you can refer to it via this guide: 

The cart URL would look something like this:{{ person|lookup:'CART_PROPERTY' }}

OPTION 2: Record your own custom Started Checkout event and use that as the Flow's trigger instead
Please refer to our guide here:

You will be in full control of the information you include in the custom event payload. This way, you can include the cart token in the event data and then refer to it in your Flow email. 

I hope that’s helpful.