Method

taxTable.update

Rename a tax table or replace its lines.

Renames a tax table or replaces all its lines. Posted documents keep the frozen copy of the old lines, so changing a table never changes a posted invoice or bill. Replacing the lines drops the table's cached frozen copy, so the next posting makes a new one; renaming alone keeps it.

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":"taxTable.update","params":{"taxTable":"GST+Levy","entries":[{"account":"Liabilities:Tax","amount":"15","type":"percent"}]}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "name": "GST+Levy",
    "entries": [
      {
        "accountName": "Liabilities:Tax",
        "amount": {
          "num": "15",
          "denom": "1"
        },
        "…": "…"
      }
    ],
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash taxTable.update '{"taxTable":"GST+Levy","entries":[{"account":"Liabilities:Tax","amount":"15","type":"percent"}]}'

It prints:

{
  "name": "GST+Levy",
  "entries": [
    {
      "accountName": "Liabilities:Tax",
      "amount": {
        "num": "15",
        "denom": "1"
      },
      "…": "…"
    }
  ],
  "…": "…"
}

MCP tool call

Tool call:

{"name":"taxTable.update","arguments":{"taxTable":"GST+Levy","entries":[{"account":"Liabilities:Tax","amount":"15","type":"percent"}]}}

Result:

{
  "structuredContent": {
    "name": "GST+Levy",
    "entries": [
      {
        "accountName": "Liabilities:Tax",
        "amount": {
          "num": "15",
          "denom": "1"
        },
        "…": "…"
      }
    ],
    "…": "…"
  }
}

Effect: write, on the Book.

Params

Params of taxTable.update.

  • taxTable (TaxTableRef, required): The tax table (visible ones only).
  • name (string or null): New name.
  • entries (array of TaxLineParams or null): New lines, replacing all the old ones. Posted documents keep their frozen copy of the old lines.

Result

A tax table.

  • guid (Guid, required): Its GUID.
  • name (string, required): Its name; frozen copies share their parent's.
  • refcount (integer (int64), required): How many customers, vendors and lines use it (always 0 for a frozen copy).
  • invisible (boolean, required): True for frozen copies.
  • parent (Guid or null): The table it is a frozen copy of.
  • child (Guid or null): Its current frozen copy, reused by the next posting.
  • entries (array of TaxLineInfo, required): Lines, sorted by account full name then amount, as GnuCash keeps them.