invoice.removeEntry
Delete a line from its documents and order.
Deletes a line from the documents and the order it is on, and destroys it. The document must be unposted and the order open. The tax tables and billing term the line used lose a reference.
Examples
Example: with a copy of the synthetic/business-editable example book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"invoice.removeEntry","params":{"entry":"5eff8018de334b2084ef00f90330cd57"}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
Request:
{"jsonrpc":"2.0","id":2,"method":"invoice.get","params":{"invoice":"71803cac5d8e4dceabfd0d56ec5e7521"}}
Response:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"entryCount": 0,
"entries": [],
"…": "…"
}
}
Command line
red-ale exec --book book.gnucash --script - <<'EOF'
invoice.removeEntry {"entry":"5eff8018de334b2084ef00f90330cd57"}
invoice.get {"invoice":"71803cac5d8e4dceabfd0d56ec5e7521"}
EOF
It prints:
[
{},
{
"entryCount": 0,
"entries": [],
"…": "…"
}
]
MCP tool call
Tool call:
{"name":"invoice.removeEntry","arguments":{"entry":"5eff8018de334b2084ef00f90330cd57"}}
Result:
{
"structuredContent": {}
}
Tool call:
{"name":"invoice.get","arguments":{"invoice":"71803cac5d8e4dceabfd0d56ec5e7521"}}
Result:
{
"structuredContent": {
"entryCount": 0,
"entries": [],
"…": "…"
}
}
Effect: destructive, on the Book.
Params
Names one line.
entry(Guid, required): The line.
Result
A result with nothing to report.
Type: Done.