Storefront API cartLinesAdd response error The merchandise with id does not exist

Storefront API cartLinesAdd response error The merchandise with id does not exist

Xuan1
Shopify Partner
4 0 0

I installed a 17Track APP, which helped me create many additional products. Now I want to use StorefrontAPI in my self-built store and manually add variant Ids to the shopping cart as needed. But now the storefront API returned an error to me.

 

 

 

{
	"data": {
		"cartLinesAdd": {
			"userErrors": [
				{
					"field": [
						"lines",
						"0",
						"merchandiseId"
					],
					"message": "The merchandise with id gid://shopify/ProductVariant/xxxxxxxxxxx does not exist."
				}
			],
			"cart": null
		}
	}
}

 

 

 

 

Replies 4 (4)

Liam
Shopify Staff
2862 312 813

Hi Xuan1,

 

Is this only happening with products created by the 17Track app?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Xuan1
Shopify Partner
4 0 0

Yes, only the products created by 17Track will have this issue. Could it be that StorefrontAPI does not have these permissions? I don't encounter this error when calling the Ajax API.

Liam
Shopify Staff
2862 312 813

That is certainly possible - have you contacted the 17Track team to see if they're aware of behaviour like this?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Xuan1
Shopify Partner
4 0 0

Contacted 17Track, after creating a product in the 17Track application, an error was reported when calling the Shopify API interface (adding products to the shopping cart). This error is responded by Shopify and has nothing to do with 17Track. This issue only occurs in the Storefront API, not in the Shopify Ajax API.