Store front api has some weird behaviour about the Cart

Topic summary

Developers are encountering issues with two different Cart ID formats in Shopify’s Storefront API:

Format 1: gid://shopify/Cart/Z2NwLXVzLWNlbnRyYWwxOjAxSDFWUkpFN05aWU1BWjJEMDJRU1dISzc5
Format 2: gid://shopify/Cart/c1-cbdb4c4178dafdb65ad2fb30c5cd5d63

Key Problems with Format 1:

  • When calling cartLinesAdd, the API returns an error stating the cart doesn’t exist (“De opgegeven winkelwagen bestaat niet”)
  • Despite the error, a new cart appears to be created with items added to it
  • One user reports being completely unable to query carts with Format 1 IDs, receiving null responses
  • When retrieving the same cart, it shows a total amount but no line items (possibly added before the issue began)

Technical Context:

  • Users are on API version 2022-10 and 2023-10
  • The issue appears recent, suggesting a potential API change

Unresolved Questions:

  • What causes these two different ID formats?
  • How to ensure newly created carts use Format 2?
  • What is the proper solution for handling both formats?

The discussion remains open with no official explanation or resolution provided.

Summarized with AI on November 15. AI used: claude-sonnet-4-5-20250929.

we have an app that use store front api to add/remove product to cart and recently noticed that there are 2 different format of cart id

Format 1: gid://shopify/Cart/Z2NwLXVzLWNlbnRyYWwxOjAxSDFWUkpFN05aWU1BWjJEMDJRU1dISzc5

Format 2: gid://shopify/Cart/c1-cbdb4c4178dafdb65ad2fb30c5cd5d63

and cart with Format 1 id caused some problems. while getting cart or add line items to it.

when calling cartLinesAdd, it returns error De opgegeven winkelwagen bestaat niet. (the cart does not exist.)

but meanwhile it looks like it created a new cart and added the item to it.

but when I call api to retrieve the same cart, it returns the result, but it has total amount (probably added before this become an issue ?) with no line items

can someone please explain what is going on here ? what’s the deal with those 2 format of ids, and possible solution for it. like how to make sure when a new cart is created, it will be the format 2 id ?

we are using 2022-10 api version, which is not deprecated yet.

i had the same issue but for me I’m not even able to query cart with the cart in format 1. If i try to query the cart with that id i get the following result
I’m using api/2023-10

{
	"data": {
		"cart": null
	},
	"extensions": {
		"context": {
			"country": "LT",
			"language": "NL"
		}
	}
}