Validate a customer invoice, set it back to draft, mark it paid or delete it
dolibarr_invoice_actionMove a Dolibarr invoice through statuses—validate, set draft, mark paid/unpaid, or delete drafts—with preview unless confirm=true.
Instructions
Moves a invoice to another status. Actions: validate (the draft gets its final invoice number and becomes payable; this is an accounting document); set_draft (an unpaid validated invoice goes back to draft); set_paid (classifies the invoice as paid, writing off any remainder with the close_code); set_unpaid (a paid invoice becomes unpaid again); delete (deletes the invoice (drafts only, or the last invoice of the numbering)). This step cannot simply be undone: without confirm=true it only returns a preview.
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": {
"invoice_id": "<invoice_id>",
"action": "<action>"
},
"name": "dolibarr_invoice_action"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| reason | No | One line on why, kept in the audit log. Required when confirm is true. | |
| confirm | No | false (default) = change nothing, only show what would happen. true = do it. Set true only after the user has explicitly agreed to this exact step. | |
| close_code | No | With set_paid on an invoice not fully paid: why the rest is written off. | |
| close_note | No | With set_paid: a note on the write-off. | |
| invoice_id | Yes |