Add, change and repay loans
loanLoans taken and given, with their repayment schedule (round 607). action=add creates a loan from the fields of the agreement and proposes its drawdown (book_drawdown=false where the drawdown is booked already); the schedule of principal and interest follows from the terms. action=change with loan_id and the fields to change (a new rate makes the planned repayments again). action=post with payment_id proposes one row of the schedule now. action=match with bank_line_id and payment_id posts a repayment from its bank line (the interest as the bank took it) and matches the line on release. action=early with loan_id, amount, date and keep (term or payment) records an early repayment. action=repay with loan_id, amount (principal), interest and date records a repayment of an open loan. action=delete with loan_id. A row in state held is a repayment dated before the schedule was added that may be booked by hand: action=resolve with payment_id and how=booked (journal_id one of the row's held_entries, or none: paid, no entry) or how=post (bank_line_id its bank line, or none). Each month end accrues the interest to that day, reversed on the 1st, from the drawdown on. Every entry is released as the owner's switches say. loan: {lender (or borrower), kind (bank_loan, other_loan, directors_loan), direction (borrowed, the default, or lent), principal, start (drawdown date YYYY-MM-DD), rate (interest % a year), repayment (annuity, fixed_principal, interest_only, open, or rolled_up: the interest added to the loan at each month end, repaid at the end of the term; action=draw with loan_id, amount, date and loan {fees, fees_account, paid_to} records a further drawdown), fees (taken off the advance), fees_account, paid_to (the account the advance went to; left out: the bank), term_months, every_months (1, 3, 6 or 12), first_payment (date; or repayment_day, the day of the month), day_count (30/360, act/365, act/360 or month: a twelfth of the yearly rate per month), reference, bank_account, loan_account, interest_account (account codes; left out: the chart's own), post_mode (bank: a repayment posts when its bank line comes in, at most 5 days late then on its own; date: on its due date), document_id (the uploaded agreement), currency (round 860: a loan in its own currency, drawn and repaid through a bank account held in it; the entries at the day's rate)}
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "loan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| how | No | ||
| date | No | ||
| keep | No | ||
| loan | No | ||
| action | Yes | ||
| amount | No | ||
| reason | No | ||
| company | No | ||
| loan_id | No | ||
| interest | No | ||
| journal_id | No | ||
| payment_id | No | ||
| bank_line_id | No | ||
| book_drawdown | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||