Why can't I add items to the cart using a string id?

When I add to the cart I send my item id which is a long string. I have seen another post that send a number id I tried that and it works.

I send the variant id which is the one being used by the Shopify JavaScript Buy SDK.

I get this error response message: “expected String to be a id: id”

Hi @Manuel_Pineda
Can you please share website URL?
and also can you provide code for this?
So i can check what is exact issue.

I am have created a Gatsby (headless) site using JSDoc: Home
I would like the users to get redirected to a Shopify cart page(non-headless) for ReCharge integration and other benefits. I would like to have both carts in sync.