Updating line item property from cart page with AJAX API not working

Topic summary

Issue: Updating a cart line item’s custom property via Shopify’s AJAX endpoint (/cart/change.js) returns 200 and updates quantity, but the line item properties remain empty.

Context:

  • Payload sent: line=1, quantity=2, properties={“gift_wrap”: true}.
  • Response shows quantity changed but properties {} unchanged.
  • Line item properties are custom key–value fields on cart items; cart/change.js is Shopify’s AJAX cart update endpoint.

Attempts:

  • Changed property value to a string (“gift_wrap”: “true”) and ensured JSON.stringify in fetch body with proper headers.
  • Despite this, properties still do not update; only quantity and totals change.

Hypothesis:

  • Potential interference from the Shopify Bundles app preventing property updates on bundled items.

Current status:

  • No confirmed solution. Key open question: whether Shopify Bundles (or bundle-specific line items) restricts or overrides updates to line item properties via AJAX, and how to work around it.

Outcome:

  • Discussion remains open; quantity updates work, properties do not, likely due to app/bundle constraints.
Summarized with AI on January 14. AI used: gpt-5.

Hi, when I try to update line item property in the cart with cart/change.js, the endpoint returns 200 but the properties are not updated, seemingly ignored.

This is what I post:

POST /cart/change.js

{
  "line": 1,
  "quantity":2,
  "properties": { "gift_wrap": true }
}​

And the server returns:

{"token":"c1-319404902e789b7e37279d056e1023a6","note":"432432fsdf","attributes":{"delivery_date":"2023-11-16"},"original_total_price":3600,"total_price":3600,"total_discount":0,"total_weight":0.0,"item_count":6,"items":[{"id":44354104656127,"properties":{},"quantity":2 ...}

Which is funny as the quantity updated, but the item property field is completely ignored… Does anyone have any idea?

Edit: I realize it could be the Shopify Bundles app that prevent me from updating the property. Does anyone have a solution?

Drive by take:

“properties”: { “gift_wrap”: true }

should be an actual string value

“properties”: { “gift_wrap”: “true” }

If your using fetch JSON.stringify(data) the data in the fetch body

fetch(window.Shopify.routes.root + 'cart/change.js', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
  "line": 1,
  "quantity":2,
  "properties": { "gift_wrap": "true" }
  })
})
.then(response => {
  return response.json();
})
.catch((error) => {
  console.error('Error:', error);
})

Hi,

Same result unfortunately:

{
  "line": 1,
  "quantity":2,
  "properties": { "gift_wrap": "true" }
}

Result:

{"token":"c1-319404902e789b7e37279d056e1023a6","note":"432432fsdf","attributes":{"delivery_date":"2023-11-16"},"original_total_price":7200,"total_price":7200,"total_discount":0,"total_weight":0.0,"item_count":12,"items":[{"id":44354104656127,"properties":{},"quantity":2,...}