---
title: "Earnings"
method: GET
path: "/api/v1/seller/earnings"
---

# Earnings

`GET /api/v1/seller/earnings`

## Request

- Base URL: `https://trovastorage.it` (the document declares no server; this is the origin it was published from)
- URL: `https://trovastorage.it/api/v1/seller/earnings`
- Auth: one of:
  - API key in header `X-Access-Token`
  - HTTP bearer

What came in, what is owed, and what the current tenants are worth.

Three queries plus one for the months, each grouped in SQL. The ledger does
not carry a site, so every figure walks
`LedgerEntry -> Booking -> Unit -> FloorPlan -> Site` — four joins and one
GROUP BY, never a query per site. M5.13 closed exactly that N+1 here.

## Response `200`

Successful Response

- SellerEarnings: Three figures that are three different kinds of truth, kept apart on purpose: what came in, what was billed and has not come in, and what the current tenants are worth per month. No forward projection — multiplying rents by months needs a churn assumption nobody has, and the result would sit next to a GMV that means money actually collected.
  - `collected_cents` integer, required
  - `due_cents` integer, required
  - `run_rate_cents` integer, required
  - `by_site` SiteEarnings[], required
    - `site_id` string, uuid, required
    - `name` string, required
    - `collected_cents` integer, required
    - `due_cents` integer, required
    - `run_rate_cents` integer, required
  - `by_month` MonthEarnings[], required
    - `month` string, required
    - `collected_cents` integer, required
    - `by_site` object, required

---

[API](https://skmtc.dev/trovastorage/apis/stock-your-inventory.md) · [All operations](https://skmtc.dev/trovastorage/apis/stock-your-inventory/llms.txt) · [OpenAPI document](https://skmtc.dev/trovastorage/apis/stock-your-inventory/revisions/c75f591a585c?raw)
