Browse the extensions reference

Preview Reconciliations

post/extensions/roboledger/{graph_id}/operations/preview-reconciliations

Part of RoboLedger: Ledger & Events.

Compare the ledger's account balances at a period end with the books they were synced from. Reads QuickBooks' own trial balance for the period end and sets it beside the ledger's, account by account: each row carries both balances, the difference, and whether the account ties. Balance-sheet accounts are compared cumulatively; income and expense accounts from the start of the fiscal year. A difference means the ledger's copy of the books has drifted from the source (a transaction deleted or back-dated there after it was synced, or activity not yet synced), so run this before trusting any other figure on a synced ledger. Writes nothing. Only for a graph with a connected QuickBooks ledger.

Idempotency: supply an Idempotency-Key header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

Authentication

Authenticate in any one of these ways — not all of them:

  • API key in the X-API-Key header.
  • Bearer token in the Authorization header.

Path parameters

NameTypeDescription
graph_idrequiredstringGraph Id

Constraints: matches ^(kg[a-f0-9]{16,}(?:_[a-zA-Z0-9]{1,20})?|sec(?:_[a-zA-Z0-9]{1,20})?|library)$

Header parameters

NameTypeDescription
Idempotency-KeyoptionalstringIdempotency-Key

Request body

Required, application/json.

FieldTypeDescription
periodrequiredstring

Period to compare at its last day, as YYYY-MM.

include_tiedoptionalboolean

Also return the accounts that tie. Off by default: the differences are the work, and the counts cover the rest.

Default: false

Example request

curl
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/preview-reconciliations" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "period": "2026-08"
}'

Responses

200 Successful Response

FieldTypeDescription
operationrequiredstring

Kebab-case operation name

operationIdrequiredstring

op_-prefixed ULID for audit and SSE correlation

statusrequiredstring

Operation lifecycle state

One of: completed, pending, failed

resultoptionalReconciliationPreviewResponse

Command-specific result payload

ReconciliationPreviewResponse fields
FieldTypeDescription
periodrequiredstring
as_ofrequiredstring (date)

The period's last day.

fiscal_year_startrequiredstring (date)

Income-statement accounts are compared from this date to as_of.

methodrequiredstring
sourcerequiredstring

The system the independent side was read from.

report_basisoptionalstring

Accounting basis the source reported on.

last_sync_atoptionalstring (date-time)

When the source was last synced. A difference on a sync older than the period end may be activity not yet synced, not a fault in the mirror.

accounts_comparedrequiredinteger

Accounts with a balance on either side; zero on both is left out.

accounts_tiedrequiredinteger
accounts_differentrequiredinteger

Every account that does not tie, whatever the reason.

total_differencerequirednumber

Sum of the absolute differences across accounts, not a net figure: one missing transaction counts on each account it touches.

rowsrequiredReconciliationRow[]

Accounts that do not tie, largest difference first; tied accounts follow when include_tied is set.

ReconciliationRow fields
FieldTypeDescription
element_idoptionalstring

The chart account; null when the ledger has none for it.

account_codeoptionalstring

The chart account's code.

account_namerequiredstring

The account's name in the ledger, else in the source.

source_account_idoptionalstring

The account's id in the source system, when it has one.

statementoptionalstring

balance_sheet or income_statement. Balance-sheet accounts are compared cumulatively to the period end; income-statement accounts from the start of the fiscal year. Null when the ledger has no account.

ledger_balancerequirednumber

What the ledger holds, from landed entries.

independent_balancerequirednumber

What the independent source says.

differencerequirednumber

Ledger minus independent.

statusrequiredstring

tied: both sides agree to the cent. different: both know the account and disagree. not_in_ledger: the source reports an account the ledger has none for. not_in_source: the ledger holds a balance on an account the source does not have.

notesoptionalstring[]

How the comparison was made, and anything that qualifies it.

atrequiredstring

ISO-8601 UTC timestamp

createdByoptionalstring

User ID that initiated the operation

idempotentReplayoptionalboolean

True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions.

Default: false

StatusMeaning
400Invalid request
401Authentication required
403Access denied
404Resource not found
409Idempotency-Key conflict — key reused with different body
422Validation error
429Rate limit exceeded
500Internal server error