BillingStatsResult billing.stats-result@1
Generated at from
openvibe-contracts v0.221.0 and
openvibe-sdk v0.65.0.
- Version
- 1.0.0
- Owner
- billing
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/billing/stats-result.v1.json
billing.stats-result@1: GET /api/v1/stats on OpenVibe.Billing (billing.stats.read, ?days=1..90, default 30). Counts with no person in them. purchases: Vibes bought with money (settled purchase transactions, test ones left out): bits_total all time, windows d/w/m (the last 1, 7 and 30 days) and pw (the 7 days before the last 7), series [{ day, value }] per UTC day over `days`. subscriptions: active now, started in the windows (paid first periods, renewals not counted) and per day. as_of is when the counts were taken.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
as_of | string | yes | ||
purchases | object | yes | ||
purchases.bits_total | integer | yes | ||
purchases.windows | https://openvibe.network/contracts/billing/stats-result.v1.json#/$defs/windows | yes | ||
purchases.series | https://openvibe.network/contracts/billing/stats-result.v1.json#/$defs/series | yes | ||
subscriptions | object | yes | ||
subscriptions.active | integer | yes | ||
subscriptions.windows | https://openvibe.network/contracts/billing/stats-result.v1.json#/$defs/windows | yes | ||
subscriptions.series | https://openvibe.network/contracts/billing/stats-result.v1.json#/$defs/series | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: stats
{
"as_of": "2026-10-17T07:40:00.000Z",
"purchases": {
"bits_total": 25000,
"windows": {
"d": 0,
"w": 500,
"m": 1500,
"pw": 0
},
"series": [
{
"day": "2026-10-16",
"value": 500
}
]
},
"subscriptions": {
"active": 3,
"windows": {
"d": 0,
"w": 1,
"m": 2,
"pw": 0
},
"series": [
{
"day": "2026-10-16",
"value": 1
}
]
}
}Rejected: no-subscriptions
{
"as_of": "2026-10-17T07:40:00.000Z",
"purchases": {
"bits_total": 1,
"windows": {
"d": 0,
"w": 500,
"m": 1500,
"pw": 0
},
"series": []
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('billing.stats-result@1', value); // { valid, errors: [{ path, message }] }