Record a payment
record_paymentRecords money in or out, books it (bank against the customer or supplier account) and, unless you say otherwise, matches it against that contact's oldest open invoices up to the amount paid. Matching is what makes an invoice count as paid. The entry it produces cannot be unposted, though the matching can be undone with unreconcile.
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": {
"company_id": "<company_id>",
"amount": "<amount>",
"payment_date": "<payment_date>"
},
"name": "record_payment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memo | No | ||
| amount | Yes | A positive decimal string; the direction carries the sign. | |
| direction | No | inbound: a customer paid you. outbound: you paid a supplier. May be left out when document_id is given. | |
| reference | No | ||
| client_ref | No | Your own reference for this creation. Calling again with the same one returns what was created the first time (`replayed: true`) instead of creating a second — use it whenever a call might be repeated after a timeout. | |
| company_id | Yes | The company to work in. Ask list_companies if unsure. | |
| contact_id | No | Who paid or was paid. Needed for the payment to be matched against their invoices. | |
| journal_id | No | ||
| document_id | No | The posted document this money pays. It names the contact and the direction, read off what is still open on it, and the matching is offered to that document alone rather than to the oldest open items. | |
| journal_code | No | The bank or cash journal, by code, e.g. BNK. Not needed when bank_account_id is given: the account knows its journal. | |
| payment_date | Yes | ||
| currency_code | No | Left out: the currency the company keeps its books in. | |
| exchange_rate | No | Units of the payment currency for one unit of the company currency, as a rate table states it. Only needed when the payment is in another currency; the realised difference against the invoice is booked at matching. | |
| bank_account_id | No | Which bank account the money moved on. list_bank_accounts says what exists. Given alone, it also names the journal; left out, the default account of the journal is used. | |
| match_open_items | No | Default true: match the payment against the oldest open invoices of that contact, up to the amount paid. |