Tags:
- Storefront GraphQL API
- 2026-07
Identify cart lines by view_key in cartLinesUpdate and cartLinesRemove
view_key in cartLinesUpdate and cartLinesRemoveYou can now identify cart lines by their when calling the and mutations, as an alternative to the cart line id.
What's new
accepts aon each, mutually exclusive withid.accepts alist, mutually exclusive with.
How to use
Provide exactly one identifier per line. Existing integrations that use id or keep working with no changes.
mutation RemoveLineByViewKey($cartId: ID!) {
cartLinesRemove(cartId: $cartId, viewKeys: ["794864053:7c2a9f..."]) {
cart { id }
userErrors { field message }
}
}
mutation RemoveLineByViewKey($cartId: ID!) {
cartLinesRemove(cartId: $cartId, viewKeys: ["794864053:7c2a9f..."]) {
cart { id }
userErrors { field message }
}
}Was this section helpful?