previewCreditNote
Compute a credit note for an issued or paid invoice without creating it: it stores nothing and emails no one. Call it before createCreditNote with the same invoiceRef and lines. Returns the credit note with its lines and totals, and splits totalAmount into prePaymentAmount, the part that lowers what the customer still owes on the invoice, and postPaymentAmount, the part the customer already paid, which createCreditNote must give back. Get creditNote.invoiceRef from getInvoices. Each line credits one invoice item: invoiceItemRef is the id of one of that invoice's items (from getInvoiceItems with invoiceRef), with either quantity, a whole number of units up to the item's quantity, or amount, a share of the item's total before discount in major units of the invoice currency, with exclusive tax added on top. Never pass both, and credit each item at most once. Never invent UUIDs; only use values from prior tool responses.
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": {
"creditNote": "<creditNote>"
},
"name": "previewCreditNote"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| creditNote | Yes | Credit note to preview. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| creditNote | Yes |