update_cart_item
Change an item that is already in the shopping cart.
Use this tool to change the quantity, the variant, or the modifier options of one cart item. A cart must exist and must have items.
Steps
Call the 'add_item_to_cart' tool to put an item in the cart.
Call this tool to change the item.
Call the 'create_checkout_url' tool to get a checkout URL.
Rules
Send 'line_item_id' to select the cart item to change. It is the 'entityId' of that item in the cart that the last cart tool call returned, for example 'add_item_to_cart'. It is not 'productEntityId' or 'variantEntityId'. Send 'quantity' and 'productEntityId' in 'item'. If the configuration that the user chose has a variant, send 'variantEntityId'. If it has no variant, see "Configurations with no variant" in the 'add_item_to_cart' tool. The same rules apply here, including when to send 'variantEntityId' as null.
Modifier options
'item.selectedOptions' works as it works in the 'add_item_to_cart' tool. The 'get_product_details' tool returns these options in 'modifierOptions'.
If the product has required modifier options, send them again in this request. If you do not send them, the server does not change the item. Send only the buckets that you need.
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": {
"line_item_id": "<line_item_id>",
"item": "<item>"
},
"name": "update_cart_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | ||
| line_item_id | Yes | The 'entityId' of the cart item to change. Take it from 'cart.lineItems.physicalItems' or 'cart.lineItems.digitalItems' in the latest cart response. It is not 'productEntityId' or 'variantEntityId'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart | Yes | ||
| message | No | ||
| success | Yes |