How long does a cart session live?

Topic summary

Cart session lifetime for a custom storefront using the Cart API (Hydrogen): the only concrete detail confirmed is that unused or abandoned carts automatically expire 10 days after creation. A link to Shopify’s developer docs on carts for custom storefronts was provided for further reference.

Open questions remain about behavior after expiration. One participant asked:

  • If you add/remove items using an expired cart ID, does the mutation fail or is a new cart created (and does it preserve the old items)?
  • If you query an expired cart, does the API return null?

No responses have addressed these follow-ups yet. The thread currently has a partial answer (expiry window) but lacks clarity on API behavior when interacting with an expired cart ID. Status: ongoing, awaiting confirmation on post-expiry mutation and query outcomes.

Summarized with AI on January 5. AI used: gpt-5.

What happens if on the client, you try to add/remove an item from this expired cart ID? Will the mutation just fail? Or will a new cart with a new ID be created but with the same items as the old one?

Or if you try to query for an expired cart, will it just return null?

Thanks!

2 Likes