Invalid global id (Product Variant) while Updating Cart with Buy SDK

4 0 0

I am trying to update a Checkout by using the Buy SDK, but it throws this Error:


Error: [{"message":"Variable $lineItems of type [CheckoutLineItemUpdateInput!]! was provided invalid value for Error: [{"message":"invalid id","locations":[{"line":1,"column":3136}],"path":["checkoutLineItemsUpdate"]}]
at C:\code\you-at-campusfoods\node_modules\shopify-buy\index.js:3847:29


I am using the right gid-id and also encoded it to base64 (Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC80MjEyODY2ODU5MDMxNA==). The id is straight from the node admin api. There is also a specific field for it inside the admin API:
admin_graphql_api_id: 'gid://shopify/ProductVariant/42128668590314'

Thank you in advance!



Replies 2 (2)

Shopify Partner
67 12 25

Not sure what API version you're using but could be related to this: (object ids no longer need to be encoded)

4 0 0

I'm using 2022-04 for the webhook API. For the Buy SDK I use the default. I'm not sure which it is, sorry. According to the documentation it should be encoded, but when I encode it says 'invalid id'. If not it says 'invalid global id' ...

Thank you!