Edit an expense
update_expenseUse this to change an expense. Send only the fields that change; expectedRevision is the lockVersion from get_transaction, and a stale one means someone else edited it, so read it again first. A new amountCents re-divides an equal split; for any other split type, send splits with the new amounts too.
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": {
"groupToken": "<groupToken>",
"transactionToken": "<transactionToken>",
"expectedRevision": "<expectedRevision>"
},
"name": "update_expense"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | The day it was paid, `YYYY-MM-DD`. Omit to keep it. | |
| splits | No | Who shares the expense, replacing every split. Omit to keep them: a new total re-divides an `equal` split, any other type needs its splits resent. For `equal`, list the members and omit `amountCents`: the server divides the total, odd cents to the first members in the group's order. For `amount`, `percentage` and `shares`, give each member's `amountCents`; they must add up to the total (exactly for `amount`, otherwise within 1 per member). | |
| currency | No | Omit to keep it. One other than the group's is converted into the group currency at the rate on `date`. | |
| splitType | No | How the total is divided. `equal` divides it for you; for any other type each split carries its own `amountCents`. | |
| timeOfDay | No | Time of day, `HH:MM` (24-hour). Omit to keep it. | |
| groupToken | Yes | The group's token, from `listGroups` or `listSearchResults`. | |
| amountCents | No | The total in minor units of `currency` (¥1,000 is 1000, $12.50 is 1250). | |
| description | No | What the expense was for, as the group will see it. | |
| categoryToken | No | Omit to keep the category; `null` clears it. | |
| balanceCurrency | No | Currency bucket used for balances. Omit to keep the current value, unless the edit changes the amount or currency: then it moves to the group currency. Only the group currency or the transaction's own `currency` is kept; any other value (such as the group's previous currency) means the group currency. Changing the group currency re-expresses balances without changing any transaction's `lockVersion`. | |
| expectedRevision | Yes | The `lockVersion` the client last saw on the record it is changing. A mismatch is `409 CONFLICT` with the record as the server now has it. | |
| transactionToken | Yes | The expense or payment's token, from `listTransactions` or `listSearchResults`. | |
| paidByParticipantToken | No | The member who paid, by token from `showGroup`. Omit to keep it. |