splitwise_update_expense
Update an existing Splitwise expense by sending only the fields you want to change. Use it to fix details, date, category, currency, cost, or split, and to move an expense to another group.
Instructions
Change an existing expense — only the fields given are sent.
Calls POST /update_expense/{id}. Refused with Error: … writes are disabled unless
SPLITWISE_ALLOW_WRITES=1 (enforced by the server's client).
WARNING: shares REPLACES ALL existing shares. Splitwise treats any users__* key as
the complete new split, so list EVERY participant with their paid_share and
owed_share — sending only the person who changed drops everyone else from the
expense. Read the current split first with splitwise_get_expense.
No undo tool — to revert, re-send the previous values read with
splitwise_get_expense first.
When shares is given, Σ paid_share and Σ owed_share must each equal the cost: the new
cost if you pass one, otherwise the expense's current cost (read once with
GET /get_expense/{id}). A mismatch is refused before the update is sent. Changing
cost WITHOUT shares leaves the split to Splitwise, which may reject it if the
current shares no longer add up — pass both to be explicit.
When to Use:
Fix a description, date, category or currency.
Change the amount together with the full new split.
Move an expense to another group (group_id; 0 = no group).
When NOT to Use:
To create a new expense (use
splitwise_create_expense).To delete or restore one (use
splitwise_delete_expense/splitwise_undelete_expense).To look up ids by name (use
splitwise_resolve_friend/splitwise_resolve_group/splitwise_resolve_category).
Returns:
A confirmation echoing Splitwise's response: the literal errors value and the expense
as returned (id, description, cost, group, date, shares).
Examples:
params = {"expense_id": 3456789012, "description": "Dinner (incl. tip)"}
params = {"expense_id": 3456789012, "cost": "60.00", "shares": [ {"user_id": 491923, "paid_share": "60.00", "owed_share": "30.00"}, {"user_id": 678, "paid_share": "0.00", "owed_share": "30.00"}]}
Error Handling:
Refused locally (nothing sent) when no field is given, when shares do not add up, or a
share has both/neither identity. Splitwise answers 200 even on failure — the client turns
a non-empty errors into Error: Splitwise rejected the request…; if that body still
carried an expense object the error adds "Splitwise still returned N expense object(s) …
may have landed", so read the expense back before retrying. 404 → wrong id; 403 →
not your expense.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |