Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Cart still available from API after checkout

Cart still available from API after checkout

bebejane
Shopify Partner
1 0 0

Hi, we are building a headless Shopify site with Next.js and the Storefront API. After going live last week we are getting complaints that the cart is not cleared upon finishing the checkout process. We are creating the cart via the Storefront API and using the checkoutUrl from the Cart object to get to checkout.

 

The order is registered with Shopify and everything is fine, however when the customer returns to the site after checkout and we call the API on the frontend with the same cartId, the API still returns the old cart with the same items instead of null where we would then create a new cart.

 

According to the docs the API should return null for the same cartId after checkout completes. "Shopify automatically deletes the cart when the customer completes their checkout."  https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/cart#limitations-and-... 

 

We have tried disabling apps and reverted to default theme without success. 

 

If anyone have similar problems please let me know!

 

 

Reply 1 (1)

jamalsoueidan
Shopify Partner
66 3 10

Maybe this is a bug.

Would you mind creating an issue here: https://github.com/Shopify/hydrogen/issues