Change a cart line
update_cart_itemSet how many units of a variant a cart holds. Use it to buy several of one thing, or to take a line out with quantity 0. Returns the whole cart, or an error when there is not that much stock or no open cart.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"variant_id": "<variant_id>",
"quantity": "<quantity>"
},
"name": "update_cart_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart_id | No | the cart.id that add_to_cart returned; leave out in a browser, which sends its own cart cookie | |
| quantity | Yes | the new number of units; 0 removes the line | |
| variant_id | Yes | the variant to change |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart | No | ||
| error | No | Upstream's error string ("Error adding item to cart", ...); absent on success. |