Allocate credit note
allocate_credit_noteSet a credit note against the sales invoice it credits, or a debit note against the bill it reduces, as the app's link on the note does. The invoice's outstanding amount goes down by the amount set; no payment is recorded and no ledger entry is added. Without amount it sets as much as both allow: the rest of the note, or the invoice's outstanding amount if that is less. Without confirm true it changes nothing and answers reason confirm-required naming both documents and the amount; ask the user, then call again with confirm true. Refuses a pair that is not credit note to sales invoice or debit note to bill (not-a-pair), a document in the bin (deleted), a void one, two currencies (currency-mismatch), a pair already linked (unchanged), an invoice with nothing outstanding, an amount of zero or less (invalid-amount), and more than is left on the note or outstanding on the invoice (over-allocated). A missing or another business's id is not-found.
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": {
"invoiceid": "<invoiceid>",
"noteid": "<noteid>"
},
"name": "allocate_credit_note"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | How much of the note to set against it. Omit it to use as much as both documents allow. | |
| noteid | Yes | The credit note or debit note to set against it. | |
| confirm | No | Send true only after the user has agreed to the allocation the refusal described. | |
| invoiceid | Yes | The sales invoice (for a credit note) or bill (for a debit note) to reduce, from list_invoices or get_document. |