Skip to main content

Identify cart lines by view_key in cartLinesUpdate and cartLinesRemove

You can now identify cart lines by their view_key when calling the cartLinesUpdate and cartLinesRemove mutations, as an alternative to the cart line id.

What's new

  • cartLinesUpdate accepts a viewKey on each CartLineUpdateInput, mutually exclusive with id.
  • cartLinesRemove accepts a viewKeys list, mutually exclusive with lineIds.

How to use

Provide exactly one identifier per line. Existing integrations that use id or lineIds keep working with no changes.

mutation RemoveLineByViewKey($cartId: ID!) {
cartLinesRemove(cartId: $cartId, viewKeys: ["794864053:7c2a9f..."]) {
cart { id }
userErrors { field message }
}
}
Was this section helpful?