---
title: "Generate profit and loss · Reports · Practice Manager API · COUNT Partner API"
description: "Generates a profit and loss (income statement) for a date range. POST /firm-partners/workspace/reports/pnl"
canonical: "https://developers.getcount.com/practice-manager/reference/reports/generate-profit-and-loss"
source: "https://developers.getcount.com/practice-manager/reference/reports/generate-profit-and-loss"
---
[Reports](https://developers.getcount.com/practice-manager/reference/reports) / Generate profit and loss

# Generate profit and loss

POST `/firm-partners/workspace/reports/pnl`

Generates 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

[Chart of Accounts API](https://developers.getcount.com/practice-manager/reference/chart-of-accounts) [Tags API](https://developers.getcount.com/practice-manager/reference/tags) [Workspace Stats API](https://developers.getcount.com/practice-manager/reference/workspace-stats) [Fixed Assets API](https://developers.getcount.com/practice-manager/reference/fixed-assets)

#### Headers

`count-workspace-id` uuid required

UUID 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

`startDate` date required

Report period start.

`endDate` date required

Report period end.

`currency` string optional

Report currency. Defaults to workspace currency.

`transactionStatus` enum optional

Filter transactions by review/reconciliation state.

One of: `all`, `reviewed`, `unreviewed`, `reconciled`, `unreconciled`

`categoryAccountUuids` string optional

Comma-separated income/expense account UUIDs to filter categories.

`customerUuids` string optional

Comma-separated customer UUIDs.

`projectUuids` string optional

Comma-separated project UUIDs.

`isPnLByTag` string optional

Set to true for a column-per-tag breakdown.

`reportYear` enum optional

Year basis for the report.

One of: `financial`, `calendar`

#### Responses

`200` Profit and loss report generated. Each `categorized` section carries its `total`, account rows in `subCategories`, and month totals in `byMonth` keyed `YYYY-M`.

`400` Missing startDate/endDate or invalid filters.

`401` Missing signing headers, an invalid HMAC signature, or a timestamp more than 5 minutes off. [Troubleshoot](https://developers.getcount.com/practice-manager/authentication#errors)

`403` The 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. [Troubleshoot](https://developers.getcount.com/practice-manager/authentication#errors)

`404` No workspace exists with the `count-workspace-id` UUID.

`429` Rate limit exceeded (100 requests per minute per firm user of each app, or 10,000 per minute per app). [Troubleshoot](https://developers.getcount.com/practice-manager/authentication#errors)

[Previous POST Generate trial balance](https://developers.getcount.com/practice-manager/reference/reports/generate-trial-balance) [Next POST Generate balance sheet](https://developers.getcount.com/practice-manager/reference/reports/generate-balance-sheet)

POST `https://api.getcount.com/firm-partners/workspace/reports/pnl`

Request

```javascript
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

```json
{
  "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": []
  }
}
```
