Nombaone.Metrics (Nomba One v0.1.0)

View Source

Metrics — MRR, churn, and the dunning funnel, computed from the ledger on read.

Summary

Functions

Billing KPIs over a window (defaults to a recent window server-side). Optional :from / :to (ISO-8601 date-times).

Functions

billing(client, params \\ %{}, opts \\ [])

@spec billing(Nombaone.Client.t(), map(), keyword()) ::
  {:ok, Nombaone.BillingMetrics.t()} | {:error, Nombaone.Error.t()}

Billing KPIs over a window (defaults to a recent window server-side). Optional :from / :to (ISO-8601 date-times).

Example

{:ok, metrics} = Nombaone.Metrics.billing(client)
IO.puts("MRR ₦#{metrics.mrr_in_kobo / 100}")

billing!(client, params \\ %{}, opts \\ [])

Raising variant of billing/3.