Generate trial balance
/firm-partners/workspace/reports/trial-balanceGenerates a trial balance as of a date.
Filters are query parameters only. Required: endDate (YYYY-MM-DD).
Headers
count-workspace-iduuidrequiredUUID of the client workspace to act on. It must be one of your firm's client workspaces (or the firm's own workspace) and within the API key's client workspaces.
Query parameters
endDatedaterequiredAs-of date for the trial balance.
startDatedateoptionalPeriod start. When omitted the trial balance runs as of endDate, with prior-year profit in a synthetic Retained Earnings row.
currencystringoptionalReport currency. Defaults to workspace currency.
transactionStatusenumoptionalFilter transactions by review/reconciliation state.
One of: all, reviewed, unreviewed, reconciled, unreconciled
accountUuidsstringoptionalComma-separated account UUIDs to include.
tagUuidsstringoptionalComma-separated tag UUIDs to filter by.
noTagsstringoptionalSet to true to include only entries with no tags.
accountTypeenumoptionalRestrict to a single account type.
One of: Assets, Liabilities, Equity, Income, Expenses
Responses
200Trial balance report generated. `data.accounts` holds one row per account with a net `debit` or `credit`; `data.totals` sums both columns.400Missing or invalid query parameters.401Missing signing headers, an invalid HMAC signature, or a timestamp more than 5 minutes off. Troubleshoot403The key is inactive or its scope does not allow this request, the workspace is not managed by your firm or is outside the key's client workspaces, the workspace has no active subscription, or it is portal-only and the route needs bookkeeping. Troubleshoot404No workspace exists with the `count-workspace-id` UUID.429Rate limit exceeded (100 requests per minute per firm user of each app, or 10,000 per minute per app). Troubleshoothttps://api.getcount.com/firm-partners/workspace/reports/trial-balanceimport crypto from 'node:crypto';
const BASE_URL = 'https://api.getcount.com';
const CLIENT_ID = process.env.COUNT_CLIENT_ID;
const CLIENT_SECRET = process.env.COUNT_CLIENT_SECRET;
const method = 'POST';
const signingPath = '/workspace/reports/trial-balance';
const timestamp = Math.floor(Date.now() / 1000).toString();
const bodyString = '';
const bodyHash = '';
const baseString = `${method}:${signingPath}:${timestamp}:${bodyHash}`;
const signature = crypto.createHmac('sha256', CLIENT_SECRET).update(baseString).digest('hex');
const response = await fetch(`${BASE_URL}/firm-partners/workspace/reports/trial-balance`, {
method,
headers: {
'x-client-id': CLIENT_ID,
'x-timestamp': timestamp,
'x-signature': signature,
'count-workspace-id': '5e4d3c2b-1a09-4f8e-8d7c-6b5a49382716',
},
});
console.log(await response.json());{
"status": "success",
"message": "Success on generating trail balance report.",
"data": {
"totals": {
"totalDebit": 54000,
"totalCredit": 54000
},
"accounts": [
{
"id": "c8d9e0f1-a2b3-4567-cdef-789012345678",
"type": "Assets",
"name": "Business Checking",
"originalName": "Business Checking",
"systemCreated": false,
"accountNumber": "1000",
"subType": {
"id": 1,
"type": "Assets",
"name": "Cash and Bank",
"code": "CASH_AND_BANK",
"anchorTier": "PHYSICAL_ACCOUNT"
},
"debit": 39500
},
{
"id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"type": "Assets",
"name": "Accounts Receivable",
"originalName": "Accounts Receivable",
"systemCreated": true,
"accountNumber": "1200",
"subType": {
"id": 2,
"type": "Assets",
"name": "Accounts Receivable",
"code": "ACCOUNTS_RECEIVABLE",
"anchorTier": null
},
"debit": 2500
},
{
"id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"type": "Liabilities",
"name": "Accounts Payable",
"originalName": "Accounts Payable",
"systemCreated": true,
"accountNumber": "2000",
"subType": {
"id": 13,
"type": "Liabilities",
"name": "Accounts Payable",
"code": "ACCOUNTS_PAYABLE",
"anchorTier": null
},
"credit": 900
},
{
"id": "d4e5f6a7-b8c9-0123-defa-234567890123",
"type": "Income",
"name": "Consulting Revenue",
"originalName": "Consulting Revenue",
"systemCreated": false,
"accountNumber": "4000",
"subType": {
"id": 24,
"type": "Income",
"name": "Income",
"code": "INCOME",
"anchorTier": null
},
"credit": 45000
},
{
"id": "3c4d5e6f-7a8b-4c9d-8e0f-2a3b4c5d6e7f",
"type": "Expenses",
"name": "Office Rent",
"originalName": "Office Rent",
"systemCreated": false,
"accountNumber": "6100",
"subType": {
"id": 28,
"type": "Expenses",
"name": "Operating Expenses",
"code": "OPERATING_EXPENSES",
"anchorTier": null
},
"debit": 12000
},
{
"id": "retained-earnings-synthetic",
"type": "Equity",
"name": "Retained Earnings (through Dec 31, 2025)",
"originalName": "Retained Earnings",
"accountNumber": null,
"subType": {
"name": "Retained Earnings",
"code": "RETAINED_EARNINGS",
"type": "Equity"
},
"credit": 8100
}
],
"filters": {
"endDate": "2026-03-31",
"currency": "USD",
"transactionStatus": "all"
}
}
}