Method

transaction.list

Transactions, optionally in one account and a date range, in GnuCash's order.

Lists transactions, all of them or those with a split in account, optionally between the dates from and to (inclusive, on the posted date). They come in GnuCash's order: by posted date, closing entries last, then number, date entered, description and GUID. Use transaction.find to search by text, amount or state instead.

A book can hold thousands of transactions, so give account or a date range rather than listing the lot.

Examples

Example: with a copy of the reports/test-data example book open as book.gnucash.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"transaction.list","params":{"account":"Root:Asset:Wallet","from":"1971-01-01","to":"1971-12-31"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "transactions": [
      {
        "guid": "c0000000000000000000000000000007",
        "description": "$100bank -> $80expenses + $20wallet",
        "…": "…"
      }
    ]
  }
}

Command line

red-ale exec --book book.gnucash transaction.list '{"account":"Root:Asset:Wallet","from":"1971-01-01","to":"1971-12-31"}'

It prints:

{
  "transactions": [
    {
      "guid": "c0000000000000000000000000000007",
      "description": "$100bank -> $80expenses + $20wallet",
      "…": "…"
    }
  ]
}

MCP tool call

Tool call:

{"name":"transaction.list","arguments":{"account":"Root:Asset:Wallet","from":"1971-01-01","to":"1971-12-31"}}

Result:

{
  "structuredContent": {
    "transactions": [
      {
        "guid": "c0000000000000000000000000000007",
        "description": "$100bank -> $80expenses + $20wallet",
        "…": "…"
      }
    ]
  }
}

Effect: read.

Params

Params of transaction.list.

  • account (AccountRef or null): Only transactions with a split in this account.
  • from (Date or null): Only transactions posted on or after this date.
  • to (Date or null): Only transactions posted on or before this date.

Result

The result of transaction.list.

  • transactions (array of TransactionInfo, required): The transactions, by posted date, then num, date entered, description and GUID (xaccTransOrder).