Save loan
save_loanCreate or update a loan: money the business owes. Pass an id from list_loans to update that loan; omit it to create one, which needs a lender. A new loan gets its own liability account. An id this business does not own is refused with code loan-not-found. An opening date later than entries already on the loan's account is refused, unwritten, with code confirm-required until the same call is repeated with confirm true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | The loan to update, from list_loans. Omit it to create a new loan. | |
| name | No | What the business calls the loan, e.g. Vehicle finance. A new loan needs a lender. | |
| rate | No | Yearly interest rate as a percentage, e.g. 11.5. | |
| notes | No | Free-text notes. | |
| amount | No | What was borrowed, in the loan's currency. Not the balance still owed. | |
| lender | No | Who lent the money: a bank, a director, a family member. | |
| confirm | No | Send true only after the user agrees, when an update came back with code confirm-required: the opening date is later than entries already on the loan's account. | |
| current | No | True when the loan is due within a year (a current liability). Only read when the loan is created. | |
| archived | No | True to archive a loan that is paid off. | |
| currency | No | ISO currency code, e.g. ZAR. Omit for the business's own currency. | |
| openingdate | No | Date the opening balance applies from, yyyy-MM-dd. | |
| openingbalance | No | What was still owed on openingdate, for a loan that started before the business used stub. 0 clears it. |