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
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
Canonical payload
urlencode(query) if any present, else "{}".
Response shape (verified)
🪲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
If omitted, returns
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:
Use
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
See also
- Strains —
strainIdcross-reference - Orders — orders capture per-sale price snapshots
- Commissions — per-order payout view
- Dashboard — canonical lifetime profit figure