Method

taxTable.create

Create a tax table with one or more lines.

Creates a tax table: a named set of lines, each a percentage or a fixed amount posted to a liability account. Invoice and bill lines refer to a table by GUID, and posting turns the tax into splits to those accounts.

A table needs at least one line (GnuCash deletes an empty table when it next loads the book), a name no other visible table has, and percentages from -100 to 100. Lines are kept in GnuCash's order, by account full name and then amount, whatever order you give them.

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.create","params":{"name":"VAT20","entries":[{"account":"Liabilities:Tax","amount":"20","type":"percent"}]}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "guid": "…",
    "name": "VAT20",
    "refcount": 0,
    "entries": [
      {
        "accountName": "Liabilities:Tax",
        "amount": {
          "num": "20",
          "denom": "1"
        },
        "type": "percent",
        "…": "…"
      }
    ],
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash taxTable.create '{"name":"VAT20","entries":[{"account":"Liabilities:Tax","amount":"20","type":"percent"}]}'

It prints:

{
  "guid": "…",
  "name": "VAT20",
  "refcount": 0,
  "entries": [
    {
      "accountName": "Liabilities:Tax",
      "amount": {
        "num": "20",
        "denom": "1"
      },
      "type": "percent",
      "…": "…"
    }
  ],
  "…": "…"
}

MCP tool call

Tool call:

{"name":"taxTable.create","arguments":{"name":"VAT20","entries":[{"account":"Liabilities:Tax","amount":"20","type":"percent"}]}}

Result:

{
  "structuredContent": {
    "guid": "…",
    "name": "VAT20",
    "refcount": 0,
    "entries": [
      {
        "accountName": "Liabilities:Tax",
        "amount": {
          "num": "20",
          "denom": "1"
        },
        "type": "percent",
        "…": "…"
      }
    ],
    "…": "…"
  }
}

Effect: write, on the Book.

Params

Params of taxTable.create.

  • name (string, required): A name no other visible tax table has.
  • entries (array of TaxLineParams, required): At least one line.

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.