---
title: "Customer revenue-by-client card (accountant mirror)"
method: GET
path: "/accountant/companies/{customerId}/metrics/revenue-by-client"
tags: ["Overview"]
---

# Customer revenue-by-client card (accountant mirror)

`GET /accountant/companies/{customerId}/metrics/revenue-by-client`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/metrics/revenue-by-client`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Accountant-scoped mirror of `GET /companies/{companyId}/metrics/revenue-by-client`. Same payload for the same company and window; non-attributable revenue stays in `otherCents`, never invented per client. Entity scope is resolved from the customer's own entity roster (accountants hold no per-user entity grants): an explicit `entityId` must be one of the customer's concrete (non-group) entities; absent, the customer's single concrete entity is used; a multi-entity customer without `entityId` gets 422 ENTITY_SELECTION_REQUIRED and a customer with no entity gets 422 ENTITY_SCOPE_UNAVAILABLE.

## Query parameters

- `entityId` string, uuid
- `months` integer

## Response `200`

Revenue-by-client payload (same shape as the customer mount)

- RevenueByClientResponse
  - `success` true, required
  - `data` RevenueByClientData, required
    - `available` boolean, required: False when the window holds no posted revenue lines (clients empty, otherCents 0).
    - `reason` 'mixed_currencies': Present only when available is false because the company-wide read spans entities in different functional currencies (banned before consolidation). Entity-scoped reads are single-currency and never carry this.
    - `basis` 'posted-invoices', required
    - `clients` RevenueByClientRow[], required: Descending by revenue, then name.
      - `customerId` string, uuid, required
      - `name` string, required
      - `revenueCents` integer, required: Posted revenue attributed to this customer over the window, in cents.
    - `otherCents` integer, required: Posted revenue with no invoice-to-customer provenance, in cents. Never guessed per client.

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Unknown customer or an explicit entityId not belonging to the customer
- `422`: Request failed validation

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) · [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) · [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/20090ea32b0d?raw)
