create_expense
Create an expense split evenly, by exact amounts, percentages, or shares among a group or friend.
Instructions
Create a new expense, split among a group or with a single friend.
Exactly one of group_id/group_name or friend_id/friend_name must be
given. Every participant in split must be resolvable, by id or by
name, against that group's members (for a group expense) or against
the authenticated user plus their friends (for a friend expense).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date the expense occurred. Defaults to now. A value with no timezone is treated as UTC. | |
| split | Yes | How to divide the expense among its participants. | |
| amount | Yes | Total cost of the expense. | |
| group_id | No | Id of the group this expense belongs to. | |
| payer_id | No | Id of who paid. Defaults to the authenticated user. | |
| friend_id | No | Id of the friend to split this expense with, for a non-group expense. | |
| group_name | No | Name (or partial name) of the group this expense belongs to. | |
| payer_name | No | Name (or partial name) of who paid. | |
| category_id | No | Id of the expense's category. | |
| description | Yes | Short human-readable description of the expense. | |
| friend_name | No | Name (or partial name) of the friend to split this expense with. | |
| category_name | No | Name (or partial name) of the expense's category. | |
| currency_code | Yes | ISO 4217 currency code, e.g. 'USD'. | |
| allow_duplicate | No | Set true to create this expense even if a matching one was created in the last two minutes. | |
| idempotency_key | No | Opaque key identifying this logical write. Reusing it replays the original result instead of creating a second expense. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Splitwise's numeric id for this expense. | |
| cost | Yes | Total cost of the expense, in currency_code units. | |
| date | Yes | Date and time the expense occurred. | |
| splits | No | Per-participant owed and paid shares for this expense. | |
| deleted | No | Whether this expense has been soft-deleted in Splitwise. | |
| category | No | Category assigned to this expense, if any. | |
| group_id | No | Id of the group this expense belongs to, if any. | |
| description | Yes | Short human-readable description of the expense. | |
| currency_code | Yes | ISO 4217 currency code the cost is denominated in. |