Method

transaction.unvoid

Restore a voided transaction.

Restores a voided transaction: the values and amounts come back from the slots void left, the notes are restored, the splits' state is reset to n and the transaction is editable again. A transaction that is not void is refused with conflict, where GnuCash does nothing.

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.unvoid","params":{"guid":"c0000000000000000000000000000001"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "void": false,
    "readOnly": null,
    "splits": [
      {
        "reconcileState": "n",
        "…": "…"
      },
      {
        "reconcileState": "n",
        "…": "…"
      }
    ],
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash transaction.unvoid '{"guid":"c0000000000000000000000000000001"}'

It prints:

{
  "void": false,
  "readOnly": null,
  "splits": [
    {
      "reconcileState": "n",
      "…": "…"
    },
    {
      "reconcileState": "n",
      "…": "…"
    }
  ],
  "…": "…"
}

MCP tool call

Tool call:

{"name":"transaction.unvoid","arguments":{"guid":"c0000000000000000000000000000001"}}

Result:

{
  "structuredContent": {
    "void": false,
    "readOnly": null,
    "splits": [
      {
        "reconcileState": "n",
        "…": "…"
      },
      {
        "reconcileState": "n",
        "…": "…"
      }
    ],
    "…": "…"
  }
}

Effect: write, on the Book.

Params

Params naming one transaction.

  • guid (Guid, required): The transaction's GUID.

Result

A transaction, as returned by every transaction method.

  • guid (Guid, required): The transaction's GUID.
  • currency (CommodityId, required): The transaction currency, which values are in.
  • num (string or null): Check or reference number.
  • description (string or null): Description.
  • notes (string or null): Notes.
  • datePosted (Date or null): The posted date.
  • datePostedTime (Timestamp, required): The posted instant as stored (the posted date's day-neutral time for transactions GnuCash or red-ale enters).
  • dateEntered (Timestamp, required): When it was entered.
  • void (boolean, required): Void, by GnuCash 5.17's rule: the void timestamp is set.
  • voidReason (string or null): Why it was voided.
  • voidTime (Timestamp or null): When it was voided.
  • readOnly (string or null): Why it may not be changed, when read-only (voided, or generated by a business document).
  • reversedBy (Guid or null): The transaction that reverses this one.
  • closing (boolean, required): A book-closing transaction.
  • balanced (boolean, required): The split values sum to zero; with trading accounts on, trading values and each commodity's amounts too.
  • docLink (string or null): The document link (assoc_uri slot), as stored: a URL, a file:// URI, or a path relative to the path head.
  • splits (array of SplitInfo, required): Its splits, in stored order (debits first).