You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I refactored my headless app using the Storefront API, to create a new checkout whenever a user changes their country, to return localized prices.
Whenever I have a checkout with pre-existing items in the cart (lineItems) and I include those lineItems in a CheckoutCreate mutation, Shopify Storefront API responds with a code: "INVALID" error on the lineItem's variantId.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I refactored my headless app using the Storefront API, to create a new checkout whenever a user changes their country, to return localized prices.
Whenever I have a checkout with pre-existing items in the cart (
lineItems) and I include thoselineItemsin aCheckoutCreatemutation, Shopify Storefront API responds with acode: "INVALID"error on the lineItem'svariantId.The response is not returning any helpful information, beyond a general link to https://shopify.dev/api/usage/versioning#deprecation-practices
General Headers:

Response Headers:

Payload:
Payload Variables:
{ "lineItems": [ { "variantId": "gid://shopify/ProductVariant/316533997568980", "quantity": 1 } ], "countryCode": "DE" }Response:
{ "data": { "checkoutCreate": { "checkoutUserErrors": [ { "__typename": "CheckoutUserError", "code": "INVALID", "field": [ "input", "lineItems", "0", "variantId" ] } ], "checkout": null } }, "extensions": { "context": { "country": "DE", "language": "EN" } } }Beta Was this translation helpful? Give feedback.
All reactions