How to sync storefront API cart with theme cart in Shopify?

I intent to use Shopify cart and checkout. How can I sync storefront API cart with Shopify theme cart? I only have a token on theme and an ID in storefront. Any suggestions?

Hi @tiagob ,

May this guide will help you sync API and create a subscription on that :

https://shopify.dev/api/examples/subscriptions#create-a-cart-and-a-subscription-line-item

I hope this helps.

Themes use a cookie with the name cart and the value cart ID to access the cart. The cart ID is the same one that’s used to query with the Storefront API.