Anchor to section titled 'undefined'

cartAttributesUpdate
mutation

Updates the attributes on a cart.


An array of key-value pairs that contains additional information about the cart.

The input must not contain more than 250 values.

Anchor to cartId
cartId
required

The ID of the cart.


Was this section helpful?

The updated cart.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation cartAttributesUpdate($attributes: [AttributeInput!]!, $cartId: ID!) {
  cartAttributesUpdate(attributes: $attributes, cartId: $cartId) {
    cart {
      # Cart fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "attributes": [
    {
      "key": "<your-key>",
      "value": "<your-value>"
    }
  ],
  "cartId": "gid://shopify/<objectName>/10079785100"
}
input AttributeInput {
  key: String!
  value: String!
}