Stats
QuotaStack adds up what customers used. See the totals here.
This object returns six numbers for a dashboard. How many customers you have, what they hold, how many are subscribed, and what moved this week.
The call takes no filters and no date range. The reply answers one question, quickly, for one environment.
“Today” means since midnight UTC. “Week” means the last 7 days counting back from now, not a calendar week.
The numbers are a summary, not a report. Break usage down by metric or by day with the usage calls instead.
QuotaStack works each number out separately, so a busy account can return totals that disagree by a moment.
Which call do I want?
- You want the numbers for a dashboard home page →
GET /v1/stats/dashboard - You want one customer balance, not a total →
getCustomerCredits - You need to break usage down by metric or by day →
listCustomerUsageThis call returns six totals and nothing else. The numbers cannot be grouped, filtered, or backdated.
Get dashboard stats
/v1/stats/dashboard | Idempotency-Key | Not used. This is a read. |
|---|---|
| Environment | Sandbox and Live |
| Auth | Tenant API key |
| Writes | Nothing. A read has no side effects. |
| Fires | No webhooks. |
This call returns six totals for the environment your key belongs to. A sandbox key sees sandbox numbers. The call takes no filters, and no date range. "Today" means since midnight UTC, not midnight where you are. "Week" means the last 7 days counting back from now, not a calendar week. QuotaStack works each number out with its own query. So the six are read moments apart, and a busy account can return totals that disagree slightly.
{
"customer_count": 1284,
"total_balance": 45230000,
"active_subscriptions": 912,
"credits_consumed_today": 1875000,
"credits_consumed_week": 12400000,
"credits_granted_week": 30000000
} | Field | Type | Meaning |
|---|---|---|
customer_countrequired | integer (int64) | How many customers you have in this environment. Deleted ones are left out. |
total_balancerequired | integer (int64) | What all your customers hold, added up. Unit: millicredits, where 1 credit is 1000 millicredits. |
active_subscriptionsrequired | integer (int64) | How many subscriptions are running. Four states count here: active, trialing, cancelling, and overdue. A paused one does not. |
credits_consumed_todayrequired | integer (int64) | Credits spent since midnight UTC. A charge counts, and so does a reservation you committed. Unit: millicredits, where 1 credit is 1000 millicredits. |
credits_consumed_weekrequired | integer (int64) | Credits spent in the last 7 days, counting back from now. Unit: millicredits, where 1 credit is 1000 millicredits. |
credits_granted_weekrequired | integer (int64) | Credits handed out by a plan in the last 7 days. Only plan grants are counted. Topups are missing from this number, and so is every grant you make yourself. Add those up from the ledger when you need the real total. Unit: millicredits, where 1 credit is 1000 millicredits. |
Loading…