Generate profit and loss
POST
/firm-partners/workspace/reports/pnlGenerates a profit and loss (income statement) for a date range.
Filters are query parameters only. Required: startDate and endDate (YYYY-MM-DD).
HMAC signature only
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
startDatedaterequiredReport period start.
endDatedaterequiredReport period end.
currencystringoptionalReport currency. Defaults to workspace currency.
transactionStatusenumoptionalFilter transactions by review/reconciliation state.
One of: all, reviewed, unreviewed, reconciled, unreconciled
categoryAccountUuidsstringoptionalComma-separated income/expense account UUIDs to filter categories.
customerUuidsstringoptionalComma-separated customer UUIDs.
projectUuidsstringoptionalComma-separated project UUIDs.
isPnLByTagstringoptionalSet to true for a column-per-tag breakdown.
reportYearenumoptionalYear basis for the report.
One of: financial, calendar
Responses
200Profit and loss report generated. Each `categorized` section carries its `total`, account rows in `subCategories`, and month totals in `byMonth` keyed `YYYY-M`.400Missing startDate/endDate or invalid filters.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). TroubleshootPOST
https://api.getcount.com/firm-partners/workspace/reports/pnlRequest
import 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/pnl';
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/pnl`, {
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());Response · 200
{
"status": "success",
"message": "Success on generating pnl report.",
"data": {
"categorized": {
"Income": {
"total": 45000,
"subCategories": [
{
"total": 45000,
"byTag": {},
"subAccounts": [],
"account": {
"id": "d4e5f6a7-b8c9-0123-defa-234567890123",
"accountUuid": "d4e5f6a7-b8c9-0123-defa-234567890123",
"type": "Income",
"name": "Consulting Revenue",
"mask": null,
"status": "active",
"currency": "USD",
"originalName": "Consulting Revenue",
"connectionSyncEnabled": false,
"bookClosedBeforeDate": null,
"booksSealedThroughDate": null,
"providerAccountId": null,
"officialName": null,
"connectionOnlyAccount": false,
"isDeleted": false,
"isPayrollDefaultAccount": false,
"accountNumber": "4000",
"bankAccountNumber": null,
"bankName": null,
"govFundId": null,
"govSeg1Seg2Seg3Seg4Formatted": null,
"counterpartyTeamId": null,
"subType": {
"id": "01923a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
"type": "Income",
"name": "Income",
"description": "Revenue from the sale of goods and services.",
"anchorEligible": false,
"anchorTier": null,
"providerMatching": [],
"country": null,
"isDeleted": false,
"code": "INCOME",
"displayOrder": 1,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-28T14:22:30.000Z"
},
"parentAccount": null
},
"income": 45000,
"byMonth": {
"2026-1": 15000,
"2026-2": 15000,
"2026-3": 15000
}
}
],
"byTag": {},
"byMonth": {
"2026-1": 15000,
"2026-2": 15000,
"2026-3": 15000
}
},
"Operating Expense": {
"total": 12000,
"subCategories": [
{
"total": 12000,
"byTag": {},
"subAccounts": [],
"account": {
"id": "3c4d5e6f-7a8b-4c9d-8e0f-2a3b4c5d6e7f",
"accountUuid": "3c4d5e6f-7a8b-4c9d-8e0f-2a3b4c5d6e7f",
"type": "Expenses",
"name": "Office Rent",
"mask": null,
"status": "active",
"currency": "USD",
"originalName": "Office Rent",
"connectionSyncEnabled": false,
"bookClosedBeforeDate": null,
"booksSealedThroughDate": null,
"providerAccountId": null,
"officialName": null,
"connectionOnlyAccount": false,
"isDeleted": false,
"isPayrollDefaultAccount": false,
"accountNumber": "6100",
"bankAccountNumber": null,
"bankName": null,
"govFundId": null,
"govSeg1Seg2Seg3Seg4Formatted": null,
"counterpartyTeamId": null,
"subType": {
"id": "01923a4b-5c6d-7e8f-9a0b-1c2d3e4f5a7c",
"type": "Expenses",
"name": "Operating Expenses",
"description": "Day-to-day costs of running the business.",
"anchorEligible": false,
"anchorTier": null,
"providerMatching": [],
"country": null,
"isDeleted": false,
"code": "OPERATING_EXPENSES",
"displayOrder": 2,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-28T14:22:30.000Z"
},
"parentAccount": null
},
"operatingExpense": 12000,
"byMonth": {
"2026-1": 4000,
"2026-2": 4000,
"2026-3": 4000
}
}
],
"byTag": {},
"byMonth": {
"2026-1": 4000,
"2026-2": 4000,
"2026-3": 4000
}
},
"Cost of Goods Sold": {
"total": 0,
"subCategories": [],
"byTag": {},
"byMonth": {}
},
"profitsByYearMonth": {
"grossProfit": {
"2026-1": 15000,
"2026-2": 15000,
"2026-3": 15000
},
"grossMargin": {
"2026-1": 100,
"2026-2": 100,
"2026-3": 100
},
"netProfit": {
"2026-1": 11000,
"2026-2": 11000,
"2026-3": 11000
},
"netMargin": {
"2026-1": 73.3,
"2026-2": 73.3,
"2026-3": 73.3
}
},
"grossProfit": 45000,
"grossMargin": 100,
"netProfit": 33000,
"netMargin": 73.3
},
"filters": {
"startDate": "2026-01-01",
"endDate": "2026-03-31",
"currency": "USD",
"transactionStatus": "all"
},
"fxDisclosure": {
"presentationCurrency": "USD",
"basis": "transaction_date",
"hasForeignAmounts": false,
"asOfDate": null,
"rates": []
},
"tags": []
}
}