> ## Documentation Index
> Fetch the complete documentation index at: https://docs.equated.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Profit & loss statement

> Income statement for a date window: Revenue → COGS → Gross Profit → Operating Expenses → Net Income. Line amounts are positive magnitudes in account-tree sections; `totals` applies the sign convention. Counts POSTED entries only, so an organization with an unconfirmed inbox reads as zero activity — `coverage=all` counts fresh drafts as well, and the response echoes which coverage produced it. `basis=cash` excludes accrual-sourced entries so AP/AR only reflect cash that actually moved. `compare` adds prior-period totals keyed by account id, and `heroTrend` carries 12 months of section totals for charting.



## OpenAPI

````yaml /openapi.json get /api/reports/pnl
openapi: 3.1.0
info:
  title: Equated API
  version: 1.0.0
  description: >-
    Agent-facing accounting API. Authenticate with a bearer token issued from
    Settings → API Tokens, or via the in-app session cookie when called from the
    web client.
servers:
  - url: https://app.equated.co
    description: API server
security: []
paths:
  /api/reports/pnl:
    get:
      tags:
        - Reports
      summary: Profit & loss statement
      description: >-
        Income statement for a date window: Revenue → COGS → Gross Profit →
        Operating Expenses → Net Income. Line amounts are positive magnitudes in
        account-tree sections; `totals` applies the sign convention. Counts
        POSTED entries only, so an organization with an unconfirmed inbox reads
        as zero activity — `coverage=all` counts fresh drafts as well, and the
        response echoes which coverage produced it. `basis=cash` excludes
        accrual-sourced entries so AP/AR only reflect cash that actually moved.
        `compare` adds prior-period totals keyed by account id, and `heroTrend`
        carries 12 months of section totals for charting.
      parameters:
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: >-
              Inclusive period start (YYYY-MM-DD). Defaults to the start of the
              current year.
          required: false
          description: >-
            Inclusive period start (YYYY-MM-DD). Defaults to the start of the
            current year.
          name: from
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: Inclusive period end (YYYY-MM-DD). Defaults to today.
          required: false
          description: Inclusive period end (YYYY-MM-DD). Defaults to today.
          name: to
          in: query
        - schema:
            type: string
            minLength: 3
            maxLength: 3
            description: >-
              Report currency (ISO-4217). Defaults to the organization's base
              currency.
          required: false
          description: >-
            Report currency (ISO-4217). Defaults to the organization's base
            currency.
          name: currency
          in: query
        - schema:
            type: string
            enum:
              - accrual
              - cash
            description: >-
              Accounting basis; `cash` excludes accrual-sourced entries.
              Defaults to `accrual`.
          required: false
          description: >-
            Accounting basis; `cash` excludes accrual-sourced entries. Defaults
            to `accrual`.
          name: basis
          in: query
        - schema:
            type: string
            enum:
              - none
              - prior_period
              - prior_year
          required: false
          name: compare
          in: query
        - schema:
            type: string
            enum:
              - posted
              - all
            description: >-
              Which entries to count. `posted` (default) is the attested view,
              so an organization that has confirmed nothing reads as zero
              activity. `all` adds the unconfirmed inbox, the way cash flow
              always reports.
          required: false
          description: >-
            Which entries to count. `posted` (default) is the attested view, so
            an organization that has confirmed nothing reads as zero activity.
            `all` adds the unconfirmed inbox, the way cash flow always reports.
          name: coverage
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            description: Scope the P&L to entries attributed to this project.
          required: false
          description: Scope the P&L to entries attributed to this project.
          name: projectId
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            description: Scope to every project in this group.
          required: false
          description: Scope to every project in this group.
          name: projectGroupId
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              When true, scope to entries with no project. Mutually exclusive
              with the other project filters.
          required: false
          description: >-
            When true, scope to entries with no project. Mutually exclusive with
            the other project filters.
          name: unassigned
          in: query
      responses:
        '200':
          description: The P&L report for the requested window
          content:
            application/json:
              schema:
                type: object
                properties:
                  report:
                    $ref: '#/components/schemas/PnlReport'
                required:
                  - report
      security:
        - bearerAuth: []
components:
  schemas:
    PnlReport:
      type: object
      properties:
        period:
          type: object
          properties:
            from:
              type: string
            to:
              type: string
          required:
            - from
            - to
        currency:
          type: string
        basis:
          type: string
          enum:
            - accrual
            - cash
        coverage:
          type: string
          enum:
            - posted
            - all
          description: >-
            Which entries this run counted. Quote a number next to this — the
            same period reads differently under each.
        compare:
          type: string
          enum:
            - none
            - prior_period
            - prior_year
        project:
          oneOf:
            - type: object
              properties:
                kind:
                  type: string
                  enum:
                    - all
              required:
                - kind
            - type: object
              properties:
                kind:
                  type: string
                  enum:
                    - unassigned
              required:
                - kind
            - type: object
              properties:
                kind:
                  type: string
                  enum:
                    - project
                id:
                  type: number
                name:
                  type: string
                emoji:
                  type: string
                  nullable: true
                group:
                  type: object
                  nullable: true
                  properties:
                    id:
                      type: number
                    name:
                      type: string
                    emoji:
                      type: string
                      nullable: true
                  required:
                    - id
                    - name
                    - emoji
              required:
                - kind
                - id
                - name
                - emoji
                - group
            - type: object
              properties:
                kind:
                  type: string
                  enum:
                    - group
                id:
                  type: number
                name:
                  type: string
                emoji:
                  type: string
                  nullable: true
              required:
                - kind
                - id
                - name
                - emoji
        revenue:
          type: array
          items:
            $ref: '#/components/schemas/ReportLineItem'
        cogs:
          type: array
          items:
            $ref: '#/components/schemas/ReportLineItem'
        operatingExpenses:
          type: array
          items:
            $ref: '#/components/schemas/ReportLineItem'
        totals:
          type: object
          properties:
            revenue:
              type: number
            cogs:
              type: number
            grossProfit:
              type: number
            operatingExpenses:
              type: number
            netIncome:
              type: number
          required:
            - revenue
            - cogs
            - grossProfit
            - operatingExpenses
            - netIncome
        comparison:
          type: object
          properties:
            label:
              type: string
            period:
              type: object
              properties:
                from:
                  type: string
                to:
                  type: string
              required:
                - from
                - to
            amountsByAccountId:
              type: object
              additionalProperties:
                type: number
            totals:
              type: object
              properties:
                revenue:
                  type: number
                cogs:
                  type: number
                grossProfit:
                  type: number
                operatingExpenses:
                  type: number
                netIncome:
                  type: number
              required:
                - revenue
                - cogs
                - grossProfit
                - operatingExpenses
                - netIncome
          required:
            - label
            - period
            - amountsByAccountId
            - totals
        heroTrend:
          type: array
          items:
            type: object
            properties:
              month:
                type: string
              label:
                type: string
              revenue:
                type: number
              expenses:
                type: number
              netIncome:
                type: number
            required:
              - month
              - label
              - revenue
              - expenses
              - netIncome
      required:
        - period
        - currency
        - basis
        - coverage
        - compare
        - project
        - revenue
        - cogs
        - operatingExpenses
        - totals
    ReportLineItem:
      type: object
      properties:
        accountId:
          type: number
        label:
          type: string
        emoji:
          type: string
          nullable: true
        logoDomain:
          type: string
          nullable: true
        amount:
          type: number
          description: >-
            Magnitude in report currency — always positive; the section it
            appears in carries the sign convention.
        children:
          type: array
          items:
            $ref: '#/components/schemas/ReportLineItem'
        total:
          type: number
          description: Present iff `children` is present; equals their sum.
      required:
        - accountId
        - label
        - amount
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token issued from the Equated app under Settings → API Tokens.

````