Reports

Profit and loss statement

Changed on

P&L over a date range. When startDate and endDate are omitted the latest posted month is returned (backward-compatible with pre-date-range clients); allTime=true spans the first through the last posted month. comparePeriod optionally returns a side-by-side comparison column; prior-period shifts back by the range length (snapped to full months when month-aligned), prior-year shifts both dates back 12 months.

get/companies/{companyId}/reports/pl

Request

  • Base URL
    https://api.medianfi.com/api/v1
  • Auth
    HTTP bearer

Path parameters

companyId, string uuid required

Query parameters

entityId, string uuid

Concrete legal entity to read. Mutually exclusive with reportingScopeId/scopeAsOf. Omission is accepted only when the actor is authorized to exactly one concrete entity.

reportingScopeId, string uuid

Immutable within-company consolidated reporting-scope identity. Must be supplied with scopeAsOf and cannot be combined with entityId.

scopeAsOf, string date

ISO date used to pin the effective sealed reporting-scope hierarchy version. Must be supplied with reportingScopeId.

startDate, string date

Inclusive period start (YYYY-MM-DD). Must be supplied together with endDate.

endDate, string date

Inclusive period end (YYYY-MM-DD). Must be supplied together with startDate.

allTime, 'true'

true reports from the first through the last posted month on the P&L and cash flow, where omitting startDate/endDate still returns only the latest posted month, so "all time" must be requested by name. The general ledger reads an omitted range as the whole ledger either way. Cannot be combined with startDate/endDate, month or a comparePeriod other than none (400).

comparePeriod, 'none' | 'prior-period' | 'prior-year'

Comparison mode. prior-period shifts back by the range length (snapped to full calendar months when the range is month-aligned). prior-year shifts both dates back 12 months. none (default) returns no comparison.

granularity, 'month' | 'quarter' | 'year'

Override inferred granularity. Advisory; the service still validates the actual range.

classId, string

Optional class filter for class-aware report endpoints. Pass a company-scoped accounting class UUID, or unassigned for journal lines with no class. Customer-facing use returns data only for active approved company classes.

groupBy, 'class'

Add a grouped class breakdown where supported.

basis, 'accrual' | 'cash'

#4962 / #4981: the basis a customer statement (P&L, account drilldown, balance sheet, cash flow, trial balance, and the P&L and balance sheet exports) is calculated on. Omitted: the company's configured statement basis (configuredBasis, the source the accountant app reads) on the range's end date; cash only when it is cash, accrual otherwise. An explicit value wins. When cash is only the default and the cash view refuses (for example policy_unreviewed), the answer is the accrual calculation, labelled reportBasis: accrual; an explicitly asked cash is refused instead. Display only: nothing is written to the ledger. Any other value is a 400.

tagId, union
string
OR
string[]

Accounting tag filter (#1166). Comma-separated or repeated, up to 50. Keeps posted journal lines owned by a transaction carrying ANY listed tag: the line's own transaction link, or for an unlinked line the entry's single source transaction when no other line names a different transaction. Each line counts once however many selected tags it carries. Single legal entity only; not combinable with groupBy=class. The monthly-cache check reports NOT_CHECKED with reason tag_filtered. Every other report (balance sheet, trial balance, cash flow, exports) refuses tagId with 400, because a tag selects one leg of a balanced entry. untagged is refused on reports.

month, string

Legacy month param (YYYY-MM or YYYY-MM-DD). Prefer startDate/endDate.

Response

P&L payload. Includes legacy numeric/boolean self-check fields and additive checks execution evidence for arithmetic and monthly-cache reconciliation. isConsistent: true alone does not prove all checks ran. When a comparison is requested, an optional comparison object with the same shape plus mode, startDate, endDate, period and hasData is included on the payload.

object required
success, boolean
data, intersection

Changes

    • info

      added the new optional query request parameter basis

    • warning

      added the new cash-basis-v2 enum value to the data/allOf[#/components/schemas/StatementBasisMetadata]/cashBasis/policyId response property for the response status

    • info

      removed the cash-basis-v1 enum value from the data/allOf[#/components/schemas/StatementBasisMetadata]/cashBasis/policyId response property for the response status