Update a cart
update_cartModify an open cart before checkout. op: 'add' appends items, 'remove' drops items by 0-based index, 'set' replaces the full item list, 'clear' empties the cart. Merges customer details (name, email, phone) via the customer field. Call get_cart afterwards to confirm. Cannot modify a cart that already has a checkout in progress.
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": {
"cart_id": "<cart_id>"
},
"name": "update_cart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | set | |
| items | No | ||
| cart_id | Yes | ||
| indices | No | Item indices to remove (0-based) when op='remove' | |
| customer | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| cart_id | Yes | ||
| currency | Yes | ||
| customer | Yes | ||
| total_zar | Yes | ||
| created_at | Yes | ||
| expires_at | Yes | ||
| item_count | Yes | ||
| updated_at | Yes |