Share carts

Hydrogen uses the Storefront API to manage carts, while the online store typically uses Liquid to manage carts. However, Liquid carts and Storefront API carts are separate. You can't query a Liquid cart through the Storefront API, and you can't access a Storefront API cart through Liquid. Because of this, customers might lose their active carts when a store migrates from the online store to a Hydrogen storefront.

Liquid carts are active for ten days. To share carts between the online store and Hydrogen, both implementations must use Storefront API carts. You need to implement Storefront API carts on your online store theme, and handle both Storefront API and Liquid carts for at least ten days to prevent customers from losing their active carts during the migration.