Edit Order
edit_orderEdits an existing order of the current company. Editing REPLACES the whole order: it is not a partial update, and fields you leave out can be reset or cleared. So first fetch the current order with get_order_by_id (or find it in get_current_active_orders or get_current_scheduled_orders), then send the COMPLETE order in orderInfo with only the changes the user asked for applied. customer, restaurant, costInfo, paymentInfo and activityLog are always required. Cost amounts are saved in two groups, (totalCost, tax, discount, serviceFee) and (deliveryFee, tip, cashTip). If any value in a group changes, the whole group is rewritten and omitted values become 0, so always send every amount. deliveryInstruction is cleared if omitted. The restaurant name and phoneNumber are cleared if omitted, paymentMethod is cleared if omitted, and isCatering resets to false if omitted, so send the current values. The restaurant address is always required. orderNumber and orderItems are left unchanged if omitted. A change to addressDetail is only saved if the one-line address, the name, the phone or the email also changes, so change the address line whenever the address breakdown changes. Changing an address line triggers address lookup, which can take a few seconds. If the call says it could not confirm whether the order was updated, fetch the order and compare before trying again.You also need to think if editing something needs change in other fields. For example, changing the quantity of an item should also impact on totalCost. You should ask the user and get confirmation before making any such changes.
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": {
"orderId": "<orderId>",
"orderInfo": "<orderInfo>"
},
"name": "edit_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | Id of the order to edit | |
| orderInfo | Yes | The complete order after the requested changes |