reconcile.setState
Set a split's reconcile state (n, c, y or f); y stamps the reconcile date.
Sets the reconcile state of one split: n (new), c (cleared), y (reconciled) or f (frozen). Setting y stamps
the reconcile date with date, which GnuCash's engine leaves to its reconcile window; red-ale stamps it so a
reconciled split always says when. date is a day, stamped at 23:59:59 local time as the reconcile window stamps a
statement date, or an RFC 3339 timestamp for an exact time; by default it is now. Prefer reconcile.finish
to reconcile a whole statement.
v (void) cannot be set; it comes only from transaction.void, and the splits of a voided
transaction cannot be changed (conflict).
Examples
Example: with a copy of the reports/reconcile example book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"reconcile.setState","params":{"split":"d0000000000000000000000000000000","state":"c"}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"split": "d0000000000000000000000000000000",
"transaction": "c0000000000000000000000000000000",
"state": "c",
"reconcileDate": null
}
}
Request:
{"jsonrpc":"2.0","id":2,"method":"reconcile.setState","params":{"split":"d0000000000000000000000000000002","state":"c"}}
Response:
{
"jsonrpc": "2.0",
"id": 2,
"error": {
"code": 2003,
"message": "…",
"data": {
"help": "error/conflict"
}
}
}
Command line
red-ale exec --book book.gnucash --script - <<'EOF'
reconcile.setState {"split":"d0000000000000000000000000000000","state":"c"}
reconcile.setState {"split":"d0000000000000000000000000000002","state":"c"}
EOF
It fails with exit status 2, printing on standard error:
{
"error": {
"code": 2003,
"message": "…",
"data": {
"help": "error/conflict"
}
}
}
MCP tool call
Tool call:
{"name":"reconcile.setState","arguments":{"split":"d0000000000000000000000000000000","state":"c"}}
Result:
{
"structuredContent": {
"split": "d0000000000000000000000000000000",
"transaction": "c0000000000000000000000000000000",
"state": "c",
"reconcileDate": null
}
}
Tool call:
{"name":"reconcile.setState","arguments":{"split":"d0000000000000000000000000000002","state":"c"}}
Result:
{
"isError": true,
"structuredContent": {
"error": {
"code": 2003,
"name": "conflict",
"message": "…",
"data": {
"help": "error/conflict"
}
}
}
}
Reconciling a split as of a statement's day:
Example: with a copy of the reports/reconcile example book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"reconcile.setState","params":{"split":"d0000000000000000000000000000000","state":"y","date":"1970-01-31"}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"split": "d0000000000000000000000000000000",
"transaction": "c0000000000000000000000000000000",
"state": "y",
"reconcileDate": "1970-01-31T23:59:59Z"
}
}
Command line
red-ale exec --book book.gnucash reconcile.setState '{"split":"d0000000000000000000000000000000","state":"y","date":"1970-01-31"}'
It prints:
{
"split": "d0000000000000000000000000000000",
"transaction": "c0000000000000000000000000000000",
"state": "y",
"reconcileDate": "1970-01-31T23:59:59Z"
}
MCP tool call
Tool call:
{"name":"reconcile.setState","arguments":{"split":"d0000000000000000000000000000000","state":"y","date":"1970-01-31"}}
Result:
{
"structuredContent": {
"split": "d0000000000000000000000000000000",
"transaction": "c0000000000000000000000000000000",
"state": "y",
"reconcileDate": "1970-01-31T23:59:59Z"
}
}
Effect: write, on the Book.
Params
Params of reconcile.setState.
split(Guid, required): The split.state(State, required): The new state:n,c,yorf.vcomes only from voiding the transaction.date(ReconcileDate or null): Withyonly: the reconcile date,YYYY-MM-DDfor the end of that local day (as the reconcile window stamps its statement date), or an RFC 3339 timestamp for an exact time. Defaults to now.
Result
A split's reconcile state.
split(Guid, required): The split.transaction(Guid, required): Its transaction.state(State, required): Its reconcile state.reconcileDate(Timestamp or null): When it was reconciled, if a date is stored.