Create an expense
expense_createCreates one expense in the flat with payer and debtor splits summing to the total, and books due fixed costs in the same step so shared balances stay correct.
Instructions
Creates one expense in the flat, paid by the caller or by paidByMemberId and divided into debtor splits whose sum must equal amountCents (otherwise splits_sum_mismatch). Use it for a new purchase or for booking a due fixed cost; to change an existing expense use expense_update, to repay a debt use cash_payment_record or settlement_commit. If someone else paid, the caller must carry a positive share (otherwise paid_by_must_include_caller). To book a due fixed cost send recurringExpenseId and expectedRecurringNextDueAt together (nextDueAt from recurring_get): the expense is created and the template advanced in one step. Side effects: posts a chat notice and notifies the other members by push, not the caller. The answer holds the created expense and a warning that is null when notifications went out normally.
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": {
"amountCents": "<amountCents>",
"description": "<description>",
"splits": "<splits>"
},
"name": "expense_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| splits | Yes | Who owes what. One entry per debtor, no duplicate members, amounts summing to amountCents. | |
| wgCode | No | Share code of the flat (code from wg_list). Leave it out when the account belongs to one flat. | |
| category | No | Spending category; use other when none fits. | other |
| currency | No | Currency of the expense and its splits. | EUR |
| imageUrl | No | URL of a receipt image already uploaded to this flat in the ManaWG app. Omit unless you have one. | |
| occurredAt | No | When the purchase happened, ISO 8601 with offset. Omit for now. | |
| amountCents | Yes | Total price of the expense in cents, e.g. 1250 for 12.50. | |
| description | Yes | Short title shown in the expense list, e.g. "Groceries". | |
| paidByMemberId | No | Member who paid, from members_list. Omit when the caller paid. | |
| recurringExpenseId | No | Id of the fixed cost (recurring_list) this expense books. Send with expectedRecurringNextDueAt. | |
| expectedRecurringNextDueAt | No | nextDueAt of that fixed cost as read from recurring_get; the booking fails if it has moved. |