Skip to main content

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 from Commissions (per-order earnings) and Dashboard (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)

🪲 totalSales and totalRevenue are equal in the verified data — duplicate fields. Pick one.
🪲 The wrapper field is strains, not revenue — consistent with the Strains endpoint but a slightly odd choice given this endpoint is /revenue/. Cross-link via strainId.
⚠️ wholeSalePrice and retailPrice are 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)

🪲 totalSales and totalProfit are equal in observed data70 and 70. This is unexpected; profit should be sales minus wholesale cost. Likely a backend issue or an interpretation difference. Don’t trust totalProfit from this endpoint — cross-check against dashboard/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)

🔒 Shape with populated data not yet captured — the test holder had no revenue in the probe window. Based on the parallel /orders/chart-data shape (which uses the same response format), expect:
Where 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

  • StrainsstrainId cross-reference
  • Orders — orders capture per-sale price snapshots
  • Commissions — per-order payout view
  • Dashboard — canonical lifetime profit figure