For QBO, call GET https://quickbooks.api.intuit.com/v3/company/{realmId}/reports/TrialBalance with date parameters (start_date, end_date) and accounting_method (Accrual or Cash) derived from the company Preferences entity; for Xero, call GET https://api.xero.com/api.xro/2.0/Reports/TrialBalance with the paymentsOnly and date parameters.
Parse the trial balance response for each platform: QBO returns a hierarchical Rows/ColData structure — flatten it to a list of (account_code, account_name, account_type, net_balance) tuples; Xero returns a similar Rows array.
Store the extracted balances in a flux analysis table keyed by (period, account_code, source_system) with columns for current_period_balance, prior_period_balance, and variance.
Compute the variance and percentage change for each account; apply configurable flux thresholds (e.g., flag accounts where absolute variance exceeds $10,000 AND percentage change exceeds 10%) to produce a list of accounts requiring explanation.
For flagged accounts, automatically query the transaction detail from the respective API (QBO TransactionList report, Xero Account Transactions endpoint) to retrieve the underlying transactions that drove the movement, attaching them to the flux exception record.
Generate a flux analysis report grouped by financial statement section (revenue, COGS, operating expenses, balance sheet) with the variance, percentage change, and transaction detail for flagged accounts; route the report to account owners for written explanations as part of the close package.
Known gotchas
QBO's TrialBalance report does not support filtering by Class or Department tracking dimensions; to produce a segmented flux analysis, use the ProfitAndLossDetail and BalanceSheetDetail reports with class or department parameters and reconstruct the trial balance programmatically.
Xero's TrialBalance endpoint does not support tracking category filters (a confirmed current limitation); divisional flux analysis in Xero requires calling the ProfitAndLoss and BalanceSheet reports with tracking parameters separately and merging the results.
Period-over-period comparisons are distorted by chart-of-accounts changes (new accounts, renamed accounts, merged accounts) between periods; maintain a stable account mapping and detect COA changes via the Accounts API before running flux to avoid false positives.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp