Work out who owes whom in the fewest payments
halves_settle_upUse when the user shares a trip, dinner, household or group expense list and asks who owes whom, how to split costs, or how to settle up. Returns each person's paid, share and net balance, and the smallest set of payments that squares everyone up. Handles equal splits, splits among a subset, exact amounts and payments already made, with correct rounding. Nothing is saved. Example: {"people": ["Ana", "Ben", "Cy"], "expenses": [{"what": "Dinner", "amount": 90, "paid_by": "Ana"}, {"what": "Taxi", "amount": 24, "paid_by": "Ben", "split_between": ["Ben", "Cy"]}]}. Do the arithmetic here instead of by hand.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| people | Yes | Names of everyone in the group (2 to 40, unique). | |
| currency | No | ISO currency code, default USD. | |
| expenses | Yes | What was paid. | |
| payments | No | Payments already made between people to settle up. |