# Reports

> Trial balance, profit and loss, balance sheet, current accounts, depreciation schedule and the general ledger.

Part of the [Prosaic API reference](https://developer.prosaic.works/docs/api.md). Base URL: `https://app.prosaic.works/api/public/v1`. Authenticate with `Authorization: Bearer <API key or access token>`.

## Get general ledger grouped by account

`GET /api/public/v1/entities/{entityId}/general-ledger/account`

SDK: `prosaic.generalLedger.byAccount(entityId, params)`

Returns journal entries grouped by account with running balances and period totals. Supports various period presets and custom date ranges.

### Path parameters

- `entityId` (string, required)

### Query parameters

- `periodType` (string): Period preset for date range filtering. One of: `custom`, `this-month`, `last-month`, `this-quarter`, `last-quarter`, `this-financial-year`, `last-financial-year`, `month-to-date`, `quarter-to-date`, `year-to-date`.
- `startDate` (string): Start date. Required when periodType is `custom`.
- `endDate` (string): End date. Required when periodType is `custom`.
- `accountIds` (array of strings): Comma-separated list of entity account IDs to filter by.
- `includeVoided` (boolean): Include voided journals (default false) Default: `false`.

### Responses

- `200`: Successful response
  - `metadata` (object, required)
    - `entityId` (string, required)
    - `entityName` (string, required)
    - `periodDescription` (string, required)
    - `startDate` (string, required)
    - `endDate` (string, required)
    - `generatedAt` (string, required)
    - `currency` (string, required)
  - `accounts` (array of objects, required)
    - `accountId` (string, required)
    - `accountCode` (string, required)
    - `accountMappedCode` (string, nullable, required)
    - `accountName` (string, required)
    - `accountType` (string, required)
    - `accountSubtype` (string, required)
    - `beginningBalance` (string, required)
    - `endingBalance` (string, required)
    - `totalDebits` (string, required)
    - `totalCredits` (string, required)
    - `netMovement` (string, required)
    - `entries` (array of objects, required)
      - `id` (string, required)
      - `journalId` (string, required)
      - `logicalJournalId` (string, required)
      - `date` (string, required)
      - `narration` (string, required)
      - `description` (string, required)
      - `lineType` (string, required)
      - `parentId` (string, nullable, required)
      - `source` (string, required)
      - `journalStatus` (string, required)
      - `debit` (string, required)
      - `credit` (string, required)
      - `net` (string, required)
      - `gross` (string, required)
      - `runningBalance` (string, required)
      - `gstAmount` (string, required)
      - `taxRate` (object)
        - `id` (string, required)
        - `name` (string, required)
        - `rate` (string, required)
      - `bankTransaction` (object)
        - `id` (string, required)
        - `date` (string, required)
        - `amount` (string, required)
        - `type` (string, required)
        - `description` (string, required)
        - `particulars` (string)
        - `code` (string)
        - `merchant` (object)
          - `id` (string, required)
          - `name` (string, required)
          - `provider` (string)
          - `identifier` (string)
        - `category` (object)
          - `id` (string, required)
          - `name` (string, required)
          - `groupName` (string)
          - `provider` (string)
        - `bankAccount` (object, required)
          - `name` (string, required)
          - `accountNumber` (string)
          - `institution` (string)
  - `totals` (object, required)
    - `totalDebits` (string, required)
    - `totalCredits` (string, required)
    - `netMovement` (string, required)
- `400`: Bad request - invalid parameters
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - No access to the specified entity
- `500`: Internal server error

### Example (Node SDK)

```ts
const result = await prosaic.generalLedger.byAccount(entityId);
```

### Example (curl)

```bash
curl https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/general-ledger/account \
  -H "Authorization: Bearer $PROSAIC_API_KEY"
```

## Get general ledger as flat entry list

`GET /api/public/v1/entities/{entityId}/general-ledger/transaction`

SDK: `prosaic.generalLedger.byTransaction(entityId, params)`

Returns a flat list of journal entries with embedded account metadata. Entries are ordered by date, createdAt, and id for deterministic results.

### Path parameters

- `entityId` (string, required)

### Query parameters

- `periodType` (string): Period preset for date range filtering. One of: `custom`, `this-month`, `last-month`, `this-quarter`, `last-quarter`, `this-financial-year`, `last-financial-year`, `month-to-date`, `quarter-to-date`, `year-to-date`.
- `startDate` (string): Start date. Required when periodType is `custom`.
- `endDate` (string): End date. Required when periodType is `custom`.
- `accountIds` (array of strings): Comma-separated list of entity account IDs to filter by.
- `includeVoided` (boolean): Include voided journals (default false) Default: `false`.

### Responses

- `200`: Successful response
  - `metadata` (object, required)
    - `entityId` (string, required)
    - `entityName` (string, required)
    - `periodDescription` (string, required)
    - `startDate` (string, required)
    - `endDate` (string, required)
    - `generatedAt` (string, required)
    - `currency` (string, required)
  - `entries` (array of objects, required)
    - `account` (object, required)
      - `accountId` (string, required)
      - `accountCode` (string, required)
      - `accountMappedCode` (string, nullable, required)
      - `accountName` (string, required)
      - `accountType` (string, required)
      - `accountSubtype` (string, required)
    - `id` (string, required)
    - `journalId` (string, required)
    - `logicalJournalId` (string, required)
    - `date` (string, required)
    - `narration` (string, required)
    - `description` (string, required)
    - `lineType` (string, required)
    - `parentId` (string, nullable, required)
    - `source` (string, required)
    - `journalStatus` (string, required)
    - `debit` (string, required)
    - `credit` (string, required)
    - `net` (string, required)
    - `gross` (string, required)
    - `runningBalance` (string, required)
    - `gstAmount` (string, required)
    - `taxRate` (object)
      - `id` (string, required)
      - `name` (string, required)
      - `rate` (string, required)
    - `bankTransaction` (object)
      - `id` (string, required)
      - `date` (string, required)
      - `amount` (string, required)
      - `type` (string, required)
      - `description` (string, required)
      - `particulars` (string)
      - `code` (string)
      - `merchant` (object)
        - `id` (string, required)
        - `name` (string, required)
        - `provider` (string)
        - `identifier` (string)
      - `category` (object)
        - `id` (string, required)
        - `name` (string, required)
        - `groupName` (string)
        - `provider` (string)
      - `bankAccount` (object, required)
        - `name` (string, required)
        - `accountNumber` (string)
        - `institution` (string)
  - `totals` (object, required)
    - `totalDebits` (string, required)
    - `totalCredits` (string, required)
    - `netMovement` (string, required)
- `400`: Bad request - invalid parameters
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - No access to the specified entity
- `500`: Internal server error

### Example (Node SDK)

```ts
const result = await prosaic.generalLedger.byTransaction(entityId);
```

### Example (curl)

```bash
curl https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/general-ledger/transaction \
  -H "Authorization: Bearer $PROSAIC_API_KEY"
```

## Get ledger entries (deprecated)

`GET /api/public/v1/entities/{entityId}/ledger`

SDK: `prosaic.ledger.list(entityId, params)`

**Deprecated.** This was the original general ledger endpoint and has been replaced by the general ledger report endpoints. New integrations should use `GET /api/public/v1/entities/{entityId}/general-ledger/transaction` (flat entry list) or `GET /api/public/v1/entities/{entityId}/general-ledger/account` (grouped by account) instead. Returns paginated journal lines (ledger entries) for an entity with optional date range and account filtering. Only includes posted journals, excluding reversal entries.

### Path parameters

- `entityId` (string, required)

### Query parameters

- `page` (integer): Page number (starts at 1) Default: `1`.
- `pageSize` (integer): Number of items per page. Default: `20`.
- `dateFrom` (string, date): Start date for filtering ledger entries (ISO 8601 format YYYY-MM-DD, interpreted in NZ timezone)
- `dateTo` (string, date): End date for filtering ledger entries (ISO 8601 format YYYY-MM-DD, interpreted in NZ timezone)
- `accountIds` (array of strings): Comma-separated list of entity account IDs to filter by.
- `journalId` (string, uuid): Filter by journal ID to get all ledger entries for a specific journal.

### Responses

- `200`: Successful response
  - `data` (array of objects, required)
    - `narration` (string, required)
    - `journalType` (string, required)
    - `bankTransactionId` (string, nullable, required)
    - `gst` (string, required)
    - `id` (string, required)
    - `description` (string, nullable, required)
    - `updatedAt` (string, date-time, required)
    - `createdAt` (string, date-time, required)
    - `parentId` (string, nullable, required)
    - `journalId` (string, required)
    - `entityAccountId` (string, required)
    - `taxRateId` (string, required)
    - `credit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `debit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `entityAccount` (object, required)
      - `id` (string, required)
      - `name` (string, required)
      - `code` (string, required)
    - `taxRate` (object, required)
      - `id` (string, required)
      - `name` (string, required)
      - `description` (string, nullable, required)
      - `code` (string, required)
      - `rate` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `accountVersion` (number, nullable, required)
    - `lineNumber` (number, required)
    - `sumAccountCredits` (string, nullable, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `sumAccountDebits` (string, nullable, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
  - `pagination` (object, required)
    - `currentPage` (number, required)
    - `pageSize` (number, required)
    - `totalCount` (number, required)
    - `totalPages` (number, required)
    - `hasNextPage` (boolean, required)
    - `hasPreviousPage` (boolean, required)
- `400`: Bad request - invalid parameters
  - `error` (string)
  - `code` (string)
  - `field` (string)
  - `value` (string)
- `401`: Unauthorized - Invalid or missing API key
  - `error` (string)
- `403`: Forbidden - No access to the specified entity
  - `error` (string)
  - `code` (string)
- `500`: Internal server error
  - `error` (string)
  - `code` (string)

### Example (Node SDK)

```ts
const page = await prosaic.ledger.list(entityId);
```

### Example (curl)

```bash
curl https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/ledger \
  -H "Authorization: Bearer $PROSAIC_API_KEY"
```

## Get trial balance report

`GET /api/public/v1/entities/{entityId}/trial-balance`

SDK: `prosaic.reports.trialBalance(entityId, params)`

Returns a trial balance report for the specified entity. Supports cumulative
and movement modes, optional period comparisons, and flexible grouping.

**Cumulative mode** (default): Balance sheet accounts show all-time cumulative
balances; P&L accounts show current financial year activity.

**Movement mode**: Shows only journal activity within a specified date range
for all account types. Use `movementStartDate` and `movementEndDate` to specify
the range; when omitted the service defaults to the current financial year.

### Path parameters

- `entityId` (string, required)

### Query parameters

- `asOfDate` (string): As-of date for cumulative mode. Defaults to today.
- `reportMode` (string): Report calculation mode. One of: `cumulative`, `movement`.
- `movementStartDate` (string): Start date for movement mode.
- `movementEndDate` (string): End date for movement mode.
- `groupBy` (string): How to group accounts. Use `reportGroup` for saved report groups in the entity's country order. Each group's `type` is its stable key and `name` is its label. Accounts without a saved group appear together under `unassigned`. Use `none` to group rows yourself. **Deprecated.** Use `groupBy=reportGroup` in place of `groupBy=subtype`. . One of: `type`, `subtype`, `reportGroup`, `none`.
- `includeZeroBalances` (string): Include accounts with zero balances. One of: `false`, `true`.
- `comparison` (string): Whether to include comparison columns. One of: `none`, `periods`.
- `comparisonType` (string): Type of comparison period. Used when comparison=periods. One of: `year`, `month`.
- `comparisonPeriods` (string): Number of comparison periods (1-12). Used when comparison=periods.
- `compareToEndOfMonth` (string): Snap comparison dates to end of month. One of: `false`, `true`.
- `compareToEndOfFinancialYear` (string): Snap comparison dates to end of financial year (31 March) One of: `false`, `true`.

### Responses

- `200`: Successful response
  - `metadata` (object, required)
    - `entityId` (string, required)
    - `entityName` (string, required)
    - `generatedAt` (string, required)
    - `currency` (string, required)
    - `timezone` (string, required)
    - `reportType` (string, required): One of: `trial-balance`.
    - `asOfDate` (string, required)
    - `movementStartDate` (string)
    - `movementEndDate` (string)
  - `totals` (object, required)
    - `totalDebits` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `totalCredits` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `isBalanced` (boolean, required)
    - `variance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
  - `accountGroups` (array of objects, required)
    - `type` (string, required)
    - `name` (string, required)
    - `accounts` (array of objects, required)
      - `accountId` (string, required)
      - `accountCode` (string, required)
      - `accountName` (string, required)
      - `accountType` (string, required): One of: `Equity`, `Revenue`, `Expense`, `Asset`, `Liability`.
      - `accountSubtype` (string, required)
      - `reportGroupKey` (string, nullable)
      - `reportGroupName` (string)
      - `reportCategoryKey` (string, nullable)
      - `reportGroup` (object, nullable)
        - `key` (string, required)
        - `name` (string, required)
      - `reportCategory` (object, nullable)
        - `key` (string, required)
        - `name` (string, required)
      - `debitBalance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `creditBalance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `netBalance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `totalCredit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `totalDebit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `isSystemGenerated` (boolean)
      - `earningsType` (string, nullable): One of: `retained`.
    - `subtotal` (object, required)
      - `debits` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `credits` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `net` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
  - `comparisonTotals` (object)
- `400`: Bad request - invalid query parameters or missing/invalid system account setup (SYSTEM_ACCOUNT_VALIDATION).
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - No access to the specified entity
- `500`: Internal server error

### Example (Node SDK)

```ts
const result = await prosaic.reports.trialBalance(entityId);
```

### Example (curl)

```bash
curl https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/trial-balance \
  -H "Authorization: Bearer $PROSAIC_API_KEY"
```

## Get profit & loss report

`GET /api/public/v1/entities/{entityId}/reports/profit-loss`

SDK: `prosaic.reports.profitLoss(entityId, params)`

Returns a profit & loss report for the specified entity.

### Path parameters

- `entityId` (string, required)

### Query parameters

- `periodType` (string): Period type for the report. Matches the presets available in the Prosaic UI. Relative periods (this-month, this-quarter, etc.) are resolved to full NZ calendar periods, so omit startDate/endDate when using them. Use custom to supply explicit startDate and endDate. One of: `custom`, `this-month`, `last-month`, `this-quarter`, `last-quarter`, `this-financial-year`, `last-financial-year`.
- `startDate` (string): Start date for custom period. Required when periodType is `custom`.
- `endDate` (string): End date for custom period. Required when periodType is `custom`.
- `comparison` (string): Whether to include comparison columns. One of: `none`, `periods`.
- `comparisonType` (string): Granularity of each comparison period. For UI-consistent results, pair month with this-month/last-month, quarter with this-quarter/last-quarter, and year with the financial-year periods. One of: `custom`, `year`, `month`, `quarter`.
- `comparisonPeriods` (string): Number of comparison periods (1-12)
- `includeZeroBalances` (string): Include accounts with zero balances. One of: `false`, `true`.

### Responses

- `200`: Successful response
  - `metadata` (object, required)
    - `entityId` (string, required)
    - `entityName` (string, required)
    - `generatedAt` (string, required)
    - `currency` (string, required)
    - `reportType` (string, required): One of: `profit-loss`.
    - `startDate` (string, required)
    - `endDate` (string, required)
    - `periodDescription` (string, required)
    - `comparisonPeriods` (array of strings)
    - `comparisonPeriodRanges` (array of objects)
      - `label` (string, required)
      - `startDate` (string, required)
      - `endDate` (string, required)
  - `tradingIncome` (object, required)
    - `header` (string, required)
    - `totalLabel` (string, required)
    - `accounts` (array of objects, required)
      - `accountId` (string, required)
      - `accountCode` (string, required)
      - `accountName` (string, required)
      - `accountType` (string, required): One of: `Revenue`, `Expense`.
      - `accountSubtype` (string, required)
      - `totalCredit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `totalDebit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `balance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `comparisonPeriods` (object)
      - `segments` (object)
    - `total` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `comparisonTotals` (object, required)
    - `segmentTotals` (object)
  - `costOfSales` (object, required)
    - `header` (string, required)
    - `totalLabel` (string, required)
    - `accounts` (array of objects, required)
      - `accountId` (string, required)
      - `accountCode` (string, required)
      - `accountName` (string, required)
      - `accountType` (string, required): One of: `Revenue`, `Expense`.
      - `accountSubtype` (string, required)
      - `totalCredit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `totalDebit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `balance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `comparisonPeriods` (object)
      - `segments` (object)
    - `total` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `comparisonTotals` (object, required)
    - `segmentTotals` (object)
  - `otherIncome` (object, required)
    - `header` (string, required)
    - `totalLabel` (string, required)
    - `accounts` (array of objects, required)
      - `accountId` (string, required)
      - `accountCode` (string, required)
      - `accountName` (string, required)
      - `accountType` (string, required): One of: `Revenue`, `Expense`.
      - `accountSubtype` (string, required)
      - `totalCredit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `totalDebit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `balance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `comparisonPeriods` (object)
      - `segments` (object)
    - `total` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `comparisonTotals` (object, required)
    - `segmentTotals` (object)
  - `operatingExpenses` (object, required)
    - `header` (string, required)
    - `totalLabel` (string, required)
    - `accounts` (array of objects, required)
      - `accountId` (string, required)
      - `accountCode` (string, required)
      - `accountName` (string, required)
      - `accountType` (string, required): One of: `Revenue`, `Expense`.
      - `accountSubtype` (string, required)
      - `totalCredit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `totalDebit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `balance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `comparisonPeriods` (object)
      - `segments` (object)
    - `total` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `comparisonTotals` (object, required)
    - `segmentTotals` (object)
  - `hasTradingSection` (boolean, required)
  - `totals` (object, required)
    - `grossProfit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `grossProfitComparison` (object, required)
    - `netProfit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `netProfitComparison` (object, required)
  - `segmentColumns` (array of objects)
    - `key` (string, required)
    - `label` (string, required)
    - `isArchived` (boolean, required)
    - `dimensionId` (string)
    - `dimensionName` (string)
- `400`: Bad request - invalid query parameters
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - No access to the specified entity
- `500`: Internal server error

### Example (Node SDK)

```ts
const result = await prosaic.reports.profitLoss(entityId);
```

### Example (curl)

```bash
curl https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/reports/profit-loss \
  -H "Authorization: Bearer $PROSAIC_API_KEY"
```

## Get balance sheet report

`GET /api/public/v1/entities/{entityId}/reports/balance-sheet`

SDK: `prosaic.reports.balanceSheet(entityId, params)`

Returns a balance sheet report for the specified entity.

### Path parameters

- `entityId` (string, required)

### Query parameters

- `asOfDate` (string): As-of date for the report. Defaults to today.
- `includeZeroBalances` (string): Include accounts with zero balances. One of: `false`, `true`.
- `comparison` (string): Whether to include comparison columns. One of: `none`, `periods`.
- `comparisonType` (string): Type of comparison period. One of: `year`, `month`.
- `comparisonPeriods` (string): Number of comparison periods (1-12)

### Responses

- `200`: Successful response
  - `metadata` (object, required)
    - `entityId` (string, required)
    - `entityName` (string, required)
    - `generatedAt` (string, required)
    - `currency` (string, required)
    - `reportType` (string, required): One of: `balance-sheet`.
    - `asOfDate` (string, required)
  - `sections` (object, required)
    - `assets` (object, required)
      - `type` (string, required): One of: `Equity`, `Assets`, `Liabilities`.
      - `name` (string, required)
      - `groups` (array of objects, required)
        - `type` (string, required)
        - `name` (string, required)
        - `accounts` (array of objects, required)
          - `accountId` (string, required)
          - `accountCode` (string, required)
          - `accountName` (string, required)
          - `accountType` (string, required): One of: `Equity`, `Asset`, `Liability`.
          - `accountSubtype` (string, required)
          - `earningsType` (string): One of: `retained`, `current-year`.
          - `balance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
          - `totalCredit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
          - `totalDebit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
        - `subtotal` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `total` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `liabilities` (object, required)
      - `type` (string, required): One of: `Equity`, `Assets`, `Liabilities`.
      - `name` (string, required)
      - `groups` (array of objects, required)
        - `type` (string, required)
        - `name` (string, required)
        - `accounts` (array of objects, required)
          - `accountId` (string, required)
          - `accountCode` (string, required)
          - `accountName` (string, required)
          - `accountType` (string, required): One of: `Equity`, `Asset`, `Liability`.
          - `accountSubtype` (string, required)
          - `earningsType` (string): One of: `retained`, `current-year`.
          - `balance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
          - `totalCredit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
          - `totalDebit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
        - `subtotal` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `total` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `equity` (object, required)
      - `type` (string, required): One of: `Equity`, `Assets`, `Liabilities`.
      - `name` (string, required)
      - `groups` (array of objects, required)
        - `type` (string, required)
        - `name` (string, required)
        - `accounts` (array of objects, required)
          - `accountId` (string, required)
          - `accountCode` (string, required)
          - `accountName` (string, required)
          - `accountType` (string, required): One of: `Equity`, `Asset`, `Liability`.
          - `accountSubtype` (string, required)
          - `earningsType` (string): One of: `retained`, `current-year`.
          - `balance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
          - `totalCredit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
          - `totalDebit` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
        - `subtotal` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `total` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
  - `totals` (object, required)
    - `totalAssets` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `totalLiabilities` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `totalEquity` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `netAssets` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `isBalanced` (boolean, required)
    - `variance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
  - `earningsBreakdown` (object)
    - `currentYearEarnings` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `retainedEarnings` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
  - `comparisonTotals` (object)
- `400`: Bad request - invalid query parameters or missing/invalid system account setup (SYSTEM_ACCOUNT_VALIDATION).
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - No access to the specified entity
- `500`: Internal server error

### Example (Node SDK)

```ts
const result = await prosaic.reports.balanceSheet(entityId);
```

### Example (curl)

```bash
curl https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/reports/balance-sheet \
  -H "Authorization: Bearer $PROSAIC_API_KEY"
```

## Get current accounts report

`GET /api/public/v1/entities/{entityId}/reports/current-accounts`

SDK: `prosaic.reports.currentAccounts(entityId, params)`

Returns a current accounts report for the specified entity.

### Path parameters

- `entityId` (string, required)

### Query parameters

- `periodType` (string): Period type for the report. Matches the presets available in the Prosaic UI. Relative periods (this-month, this-quarter, etc.) are resolved to full NZ calendar periods, so omit startDate/endDate when using them. Use custom to supply explicit startDate and endDate. One of: `custom`, `this-month`, `last-month`, `this-quarter`, `last-quarter`, `this-financial-year`, `last-financial-year`.
- `startDate` (string): Start date for custom period. Required when periodType is `custom`.
- `endDate` (string): End date for custom period. Required when periodType is `custom`.
- `comparison` (string): Whether to include comparison columns. One of: `none`, `periods`.
- `comparisonType` (string): Granularity of each comparison period. For UI-consistent results, pair month with this-month/last-month, quarter with this-quarter/last-quarter, and year with the financial-year periods. One of: `custom`, `year`, `month`, `quarter`.
- `comparisonPeriods` (string): Number of comparison periods (1-12)

### Responses

- `200`: Successful response
  - `metadata` (object, required)
    - `entityId` (string, required)
    - `entityName` (string, required)
    - `entityType` (string, required)
    - `generatedAt` (string, required)
    - `currency` (string, required)
    - `reportType` (string, required)
    - `startDate` (string, required)
    - `endDate` (string, required)
    - `periodDescription` (string, required)
    - `reportTitle` (string, required)
    - `comparisonPeriods` (array of strings)
    - `comparisonPeriodRanges` (array of objects)
      - `label` (string, required)
      - `startDate` (string, required)
      - `endDate` (string, required)
  - `openingBalance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
  - `openingBalanceComparison` (object)
  - `increases` (object, required)
    - `accounts` (array of objects, required)
      - `accountId` (string, required)
      - `accountCode` (string, required)
      - `accountName` (string, required)
      - `amount` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `comparisonPeriods` (object)
    - `total` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `comparisonTotals` (object)
  - `decreases` (object, required)
    - `accounts` (array of objects, required)
      - `accountId` (string, required)
      - `accountCode` (string, required)
      - `accountName` (string, required)
      - `amount` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
      - `comparisonPeriods` (object)
    - `total` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
    - `comparisonTotals` (object)
  - `closingBalance` (string, required): Exact decimal serialized as a string. Use Decimal.js for arithmetic.
  - `closingBalanceComparison` (object)
- `400`: Bad request - invalid query parameters
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - No access to the specified entity
- `500`: Internal server error

### Example (Node SDK)

```ts
const result = await prosaic.reports.currentAccounts(entityId);
```

### Example (curl)

```bash
curl https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/reports/current-accounts \
  -H "Authorization: Bearer $PROSAIC_API_KEY"
```

## Get depreciation schedule report

`GET /api/public/v1/entities/{entityId}/reports/depreciation-schedule`

SDK: `prosaic.reports.depreciationSchedule(entityId, params)`

Returns a depreciation schedule report for the specified entity.

### Path parameters

- `entityId` (string, required)

### Query parameters

- `startDate` (string, required): Start date for the schedule.
- `endDate` (string, required): End date for the schedule.

### Responses

- `200`: Successful response
  - `metadata` (object, required)
    - `entityId` (string, required)
    - `entityName` (string, required)
    - `currency` (string, required)
    - `startDate` (string, required)
    - `endDate` (string, required)
    - `generatedAt` (string, required)
    - `periodDescription` (string, required)
  - `assets` (array of objects, required)
    - `assetId` (string, required)
    - `name` (string, required)
    - `assetTypeName` (string, nullable, required)
    - `costAccountName` (string, nullable, required)
    - `expenseAccountName` (string, nullable, required)
    - `method` (string, required)
    - `rate` (number, nullable, required)
    - `privateUsePercentage` (number, required)
    - `purchaseDate` (string, nullable, required)
    - `cost` (number, required)
    - `openingValue` (number, required)
    - `purchases` (number, required)
    - `disposals` (number, required)
    - `depreciation` (number, required)
    - `investmentBoost` (number)
    - `accumulatedDepreciation` (number, required)
    - `closingValue` (number, required)
    - `privateUseAmount` (number, required)
  - `totals` (object, required)
    - `cost` (number, required)
    - `openingValue` (number, required)
    - `purchases` (number, required)
    - `disposals` (number, required)
    - `depreciation` (number, required)
    - `investmentBoost` (number)
    - `accumulatedDepreciation` (number, required)
    - `closingValue` (number, required)
    - `privateUseAmount` (number, required)
- `400`: Bad request - invalid or missing query parameters
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - No access to the specified entity
- `500`: Internal server error

### Example (Node SDK)

```ts
const result = await prosaic.reports.depreciationSchedule(entityId, {
  startDate: '2026-04-01',
  endDate: '2026-04-01',
});
```

### Example (curl)

```bash
curl -G https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/reports/depreciation-schedule \
  -H "Authorization: Bearer $PROSAIC_API_KEY" \
  --data-urlencode "startDate=2026-04-01" \
  --data-urlencode "endDate=2026-04-01"
```