Revenue
Endpoint reference: ✅ Verified live against production on 10 May 2026. Revenue endpoints surface the holder’s earnings from a product-level view — what each strain has sold and earned. Distinct fromCommissions(per-order earnings) andDashboard(top-line aggregates).
Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /dapp/revenue | API-key + sig | Revenue per strain, paginated |
GET | /dapp/revenue/summary | API-key + sig | Aggregate sales and profit |
GET | /dapp/revenue/chart-data | API-key + sig | Time-series for revenue charts |
GET /dapp/revenue — revenue per strain
Returns each strain along with its sales totals over the holder’s lifetime. Useful for “top sellers” tables.
Query parameters
| Name | Type | Default | Notes |
|---|---|---|---|
page | integer | 1 | |
limit | integer | 10 | |
sortBy | string | — | Likely totalRevenue, totalQuantity (verify with backend) |
order | string | — | asc or desc |
Canonical payload
urlencode(query) if any present, else "{}".
Response shape (verified)
| Field | Type | Notes |
|---|---|---|
strainId | string (UUID) | Cross-reference to Strains |
strainName | string | Denormalised strain name (snapshot at sale time) |
wholeSalePrice | number (USD) | Per-unit wholesale (current value) |
retailPrice | number (USD) | Per-unit retail (current value) |
totalQuantity | int | Total units (grams) sold of this strain |
totalSales | number (USD) | Total revenue (totalQuantity * retailPrice typically) |
totalRevenue | number (USD) | Same as totalSales in observed data |
🪲totalSalesandtotalRevenueare equal in the verified data — duplicate fields. Pick one.
🪲 The wrapper field isstrains, notrevenue— consistent with the Strains endpoint but a slightly odd choice given this endpoint is/revenue/. Cross-link viastrainId.
⚠️wholeSalePriceandretailPriceare the current prices, not the price at which historical sales occurred. If Dr Green changes a strain’s price, this endpoint will show the new price even for old sales. For an accurate per-sale price, use Orders which captures the price snapshot.
Worked example (Node)
GET /dapp/revenue/summary — aggregate
The headline numbers across all strains.
Canonical payload
{}
Response shape (verified)
🪲totalSalesandtotalProfitare equal in observed data —70and70. This is unexpected; profit should be sales minus wholesale cost. Likely a backend issue or an interpretation difference. Don’t trusttotalProfitfrom this endpoint — cross-check againstdashboard/summary.totalProfit. 🔒 Flag for backend confirmation.
GET /dapp/revenue/chart-data — time-series
For plotting revenue over a date range.
Required query parameters
| Name | Type | Format | Notes |
|---|---|---|---|
startDate | string | YYYY-MM-DD | Inclusive |
endDate | string | YYYY-MM-DD | Inclusive |
400:
Canonical payload
startDate=2026-04-10&endDate=2026-05-10
Response shape (verified, but empty for the test holder)
/orders/chart-data shape (which uses the same response format), expect:
value is the day’s revenue in USD. Defensively handle the empty array — if no data in the window, the array is empty (not absent or null).
🪲 Same gap-filling caveat as dashboard analytics — empty days are not returned. Fill in the client to render a continuous chart. See Dashboard § Empty days for the helper function.
Common patterns
Top-sellers leaderboard
Monthly revenue trend
Reconciliation note
Three endpoints surface “profit”-shaped numbers:| Source | Field | What it actually is |
|---|---|---|
/dapp/dashboard/summary | totalProfit | Lifetime profit (USD) |
/dapp/revenue/summary | totalProfit | Same number, but sometimes equals totalSales ⚠️ |
/dapp/commissions/summary | commissionSummary.totalInDollar | Sum of all commission records (delivered orders only) |
dashboard.totalProfit as the canonical “lifetime earnings” figure. The other two are useful for breakdowns but should reconcile back to it (within rounding).
Caching guidance
| Endpoint | TTL |
|---|---|
| Revenue list | 5m |
| Revenue summary | 5m |
| Revenue chart-data | 5m per date range |
See also
- Strains —
strainIdcross-reference - Orders — orders capture per-sale price snapshots
- Commissions — per-order payout view
- Dashboard — canonical lifetime profit figure