Profit & loss report
get_pnl_reportGenerates a profit & loss report for an organisation over a date range, from events that have been classified and (where needed) human-approved. Returns revenue, cost of goods, operating expenses, payroll, tax, and FX gain/loss as integer cents, plus derived gross_profit_cents (revenue - cost of goods) and net_profit_cents (gross profit - operating expenses - payroll - tax). Expense fields are positive magnitudes; revenue is signed (refunds reduce it). Events still awaiting review are EXCLUDED from all lines and reported in unclassified_cents with a warning — if the warning is present, the report is incomplete until those events are approved via approve_classification. Use this for "how did we do in " questions; for a full current snapshot prefer get_financial_summary. MULTI-CURRENCY: FX conversion is not enabled yet, so when a period contains events in more than one currency the combined *_cents fields are null (a cross-currency sum would be meaningless) and the real figures are returned per currency in currency_breakdown, each a correct single-currency report.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org_id | No | Optional. Defaults to the organisation the authenticated API key is bound to, so you normally omit it and never need to ask the user for their organisation UUID. If provided, it must match the key’s org or the request is rejected. | 0e91146d-511c-469f-bdee-5c867b26ae0d |
| currency | No | ISO 4217 reporting currency label, default USD. Used only as the label for a single-currency period; a multi-currency period ignores it and returns a per-currency breakdown instead (no FX conversion yet). | USD |
| period_end | Yes | End of the period, ISO 8601 date (YYYY-MM-DD), inclusive through end of day. | |
| period_start | Yes | Start of the period, ISO 8601 date (YYYY-MM-DD), inclusive. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | Yes | ||
| warning | No | ||
| currency | Yes | ||
| tax_cents | Yes | ||
| event_count | Yes | ||
| generated_at | Yes | ||
| payroll_cents | Yes | ||
| revenue_cents | Yes | ||
| net_profit_cents | Yes | ||
| currency_breakdown | No | ||
| fx_gain_loss_cents | Yes | ||
| gross_profit_cents | Yes | ||
| unclassified_cents | Yes | ||
| cost_of_goods_cents | Yes | ||
| unrealized_fx_cents | Yes | ||
| operating_expense_cents | Yes |