Pay, write off, void or copy an invoice
invoice_actionWhat is done to an invoice once it is written (round 595, like Xero). invoice is an id or a number. what=payment: money received on an issued invoice (amount, left out: what is due; date YYYY-MM-DD, account = the bank or cash account it went into, reference, fee: what the bank or payment service kept, booked to bank charges while the invoice is settled by the whole amount; receipt=true mails the customer a payment receipt once it is booked); less than due leaves the rest open, more is kept as the customer's credit. An invoice in another currency than the books (a euro invoice paid into a pound account): amount is in the invoice's currency, bank_amount what arrived in the bank account's currency (left out: at the day's rate); the difference to the value the invoice was booked at is posted as a realised currency gain or loss. what=allocate: set customer credit against an issued invoice (source = a credit note number, or receipt: of an overpayment, as the list of credits names them; amount optional). what=refund: pay customer credit back (source, amount, date, account; credit in another currency: bank_amount what left the bank in its currency, the difference a realised gain or loss). Payment, allocation and refund are proposed as one pending action each and are booked and settled on release, as the owner's switches say. what=void: cancel an issued invoice the way the law allows: a credit note for all of it that is not credited yet (the Stornorechnung on a German company), dated date, proposed for issue; the invoice keeps its number. An invoice with money on it needs payments=remove (the payments come off it, then it is voided) or payments=keep (what was paid stays the customer's credit); without it nothing is done. what=write_off: write off what is still due as a bad debt (amount optional, date, account optional: the bad debts account, reason; relief=false leaves the VAT as it is): a UK company claims the VAT bad debt relief in box 4, by default dated on the day HMRC gives it from (six months after the later of the due date and the date of supply, VAT Notice 700/18), so it falls in that return; relief_date (YYYY-MM-DD) dates the claim otherwise (earlier is allowed and said once); a German or Austrian company corrects the Umsatzsteuer (section 17 UStG, section 16 UStG 1994); proposed like a payment, the invoice reads Written off on release. what=remove_payment with source = a payment's settlement_id and reason: takes a payment, credit or write off back off the invoice, proposed; on release as Remove on its page (round 633). what=copy: a new draft with the same customer and lines. what=correct (round 793, Lexware's Berichtigen): cancel and reissue in one step: the void's credit note (Stornorechnung) dated date (left out: the invoice's own date in Germany and Austria while that month is open and no return is on record for it, else today; today in the UK) plus a corrected copy as a draft (copy_id; an invoice credited in part already: what is left of it) to change as a draft and issue; the answer names the invoice's state (not_sent, sent, part_paid, paid); what was paid stays the customer's credit. what=state: where the invoice stands for a correction, nothing changed. what=delete: a draft goes (one this connection made; one waiting for release is withdrawn before); an issued invoice is not deleted. what=undo (round 830): an invoice issued by mistake, unpaid, not sent yet and in no VAT return on record, goes back to a draft: a credit note cancels it (its number stays given) and draft copy_id holds its lines. what=void on a credit note: its entry is reversed (date = the credit note's own date unless given), it reads Voided, and what it was set against is due again. what=attach with source = a document_id of an uploaded file: the file is kept with the issued invoice under Stored files. idempotency_key makes a request safe to repeat.
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": {
"what": "<what>"
},
"name": "invoice_action"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fee | No | ||
| date | No | ||
| what | Yes | ||
| amount | No | ||
| reason | No | ||
| relief | No | ||
| source | No | ||
| account | No | ||
| company | No | ||
| invoice | No | ||
| receipt | No | ||
| payments | No | ||
| reference | No | ||
| bank_amount | No | ||
| relief_date | No | ||
| idempotency_key | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||