billTerm.delete
Delete a billing term nothing uses.
Deletes a visible billing term that nothing uses. One that a customer, vendor or document refers to is refused with
conflict. Frozen copies stay in the book.
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":"billTerm.delete","params":{"billTerm":"Net30"}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 2003,
"message": "billing term \"Net30\" is in use and cannot be deleted",
"data": {
"help": "error/conflict"
}
}
}
Request:
{"jsonrpc":"2.0","id":2,"method":"billTerm.create","params":{"name":"Net14","type":"days","dueDays":14}}
Response:
{
"jsonrpc": "2.0",
"id": 2,
"result": "…"
}
Request:
{"jsonrpc":"2.0","id":3,"method":"billTerm.delete","params":{"billTerm":"Net14"}}
Response:
{
"jsonrpc": "2.0",
"id": 3,
"result": {}
}
Command line
red-ale exec --book book.gnucash --script - <<'EOF'
billTerm.delete {"billTerm":"Net30"}
billTerm.create {"name":"Net14","type":"days","dueDays":14}
billTerm.delete {"billTerm":"Net14"}
EOF
It fails with exit status 2, printing on standard error:
{
"error": {
"code": 2003,
"message": "billing term \"Net30\" is in use and cannot be deleted",
"data": {
"help": "error/conflict"
}
}
}
MCP tool call
Tool call:
{"name":"billTerm.delete","arguments":{"billTerm":"Net30"}}
Result:
{
"isError": true,
"structuredContent": {
"error": {
"code": 2003,
"name": "conflict",
"message": "billing term \"Net30\" is in use and cannot be deleted",
"data": {
"help": "error/conflict"
}
}
}
}
Tool call:
{"name":"billTerm.create","arguments":{"name":"Net14","type":"days","dueDays":14}}
Result:
{
"content": [
{
"type": "text",
"text": "\"…\""
}
]
}
Tool call:
{"name":"billTerm.delete","arguments":{"billTerm":"Net14"}}
Result:
{
"structuredContent": {}
}
Effect: destructive, on the Book.
Params
Names one billing term.
billTerm(BillTermRef, required): The billing term.
Result
A result with nothing to report.
Type: Done.