Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi I am trying to add line items to the customer cart from STOREFRONT API as below with the merchandiseId (type ID) of the productVariant received from products query.:
{
"cartId": "Z2lkOi8vc2hvcGlmeS9DYXJ0L2U2ZmEyZjI0OTZmNGJhNjBmZWZmZWFlZWYxMTQyMzAx",
"lines": [
{
"quantity": 1,
"merchandiseId": "gid://shopify/ProductVariant/{id received from products query}"
}
]
}
I am getting the below error:
The merchandise with id gid://shopify/ProductVariant/0 does not exist.
However, this does work if I provide the merchandiseId to be a string (same as whats in the url of the admin panel as below underlined in "yellow")
I am not sure how I can get this "string" type id, instead of the "ID" type id from the products query.
I also encountered the same problem, is it solved now?