create_cospend_bill
Create an expense bill in a Cospend project by specifying project, amount, payer, and members who share the cost. Returns the new bill's ID.
Instructions
Create a bill (expense) in a Cospend project. Requires PARTICIPANT access.
Args:
project_id: String project id.
what: Short description of the expense (e.g. "Pizza").
amount: Total amount paid.
payer: Member id of the person who paid.
payed_for: Non-empty list of member ids who share the cost.
Cospend requires at least one ower per bill — passing [] raises
ValueError (the server would reject it on create and silently
no-op on update, so we reject it up front for both).
date: Date string "YYYY-MM-DD". Defaults to today (UTC) if both
date and timestamp are omitted; the underlying API requires one.
timestamp: Alternative to date — Unix seconds. If both are set, the
server uses timestamp.
comment: Free-form longer note.
category_id: Category id (see project's categories). Omit for
uncategorized (id=0).
payment_mode_id: Payment mode id (see project's paymentmodes).
Omit for unset (id=0).
repeat: Repetition mode: "n"=no repeat (default), "d"=daily,
"w"=weekly, "b"=biweekly, "s"=semi-monthly, "m"=monthly,
"y"=yearly.
repeat_freq: Every N units (default 1). E.g. repeat="m",
repeat_freq=3 means quarterly.
repeat_until: Stop repeating after this date "YYYY-MM-DD".
repeat_all_active: 0 (default) = repeat with the same owers,
1 = on each repetition use whoever is currently active.
Returns: JSON {"bill_id": } — the integer id of the new bill.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | ||
| what | Yes | ||
| payer | Yes | ||
| amount | Yes | ||
| repeat | No | n | |
| comment | No | ||
| payed_for | Yes | ||
| timestamp | No | ||
| project_id | Yes | ||
| category_id | No | ||
| repeat_freq | No | ||
| repeat_until | No | ||
| payment_mode_id | No | ||
| repeat_all_active | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |