Add an expense
add_expenseRecords a shared expense split equally: description, amount, currency, who paid (defaults to the participant) and who shares it (defaults to everyone). It records the cost only and moves no money. Use when the user reports something they or someone in the group paid for.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | Yes | Saved plan link (e.g. https://lesgooo.fun/ab12/when) or its 4-character plan ID. Links without a plan ID (e.g. https://lesgooo.fun/when) are unsaved local drafts and are not accepted. | |
| amount | Yes | Total, max 2 decimals (e.g. 42.5). Send a plain number. | |
| currency | No | ISO code, e.g. CZK or EUR. Sets the plan's currency if it has no expenses yet; otherwise must match it (see get_plan currency). | |
| description | Yes | What it was for, e.g. "Groceries" (max 120 chars). | |
| split_among | No | Who shares the cost (participant_id values or exact names). Defaults to everyone. | |
| participant_id | Yes | From create_plan or join_plan. | |
| allow_duplicate | No | Only if the user confirms a second, identical expense within 10 minutes (otherwise it is treated as a retry). | |
| participant_token | Yes | From create_plan or join_plan. | |
| paid_by_participant_id | No | Who paid (participant_id from get_plan, or their exact name). Defaults to you. |