Anchor to section titled 'undefined'

checkoutLineItemsUpdate
mutation
deprecated

Requires unauthenticated_write_checkouts access scope.

Updates line items on a checkout. The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.


Anchor to checkoutId
checkoutId
required

The checkout on which to update line items.

Line items to update.

The input must not contain more than 250 values.


Was this section helpful?

The updated checkout object.

The list of errors that occurred from executing the mutation.

The list of errors that occurred from executing the mutation. Use checkoutUserErrors instead.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation checkoutLineItemsUpdate($checkoutId: ID!, $lineItems: [CheckoutLineItemUpdateInput!]!) {
  checkoutLineItemsUpdate(checkoutId: $checkoutId, lineItems: $lineItems) {
    checkout {
      # Checkout fields
    }
    checkoutUserErrors {
      # CheckoutUserError fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "checkoutId": "gid://shopify/<objectName>/10079785100",
  "lineItems": [
    {
      "customAttributes": [
        {
          "key": "<your-key>",
          "value": "<your-value>"
        }
      ],
      "id": "gid://shopify/<objectName>/10079785100",
      "quantity": 1,
      "variantId": "gid://shopify/<objectName>/10079785100"
    }
  ]
}
input CheckoutLineItemUpdateInput {
  customAttributes: [AttributeInput!]
  id: ID
  quantity: Int
  variantId: ID
}

input AttributeInput {
  key: String!
  value: String!
}