Estimate the team's usage fee for the current month
get/v1/teams/{team_id}/billing/usage
Requires an API key
The team's owners, admins and billing members, and Ivora staff; API keys are refused. Every project's kWh so far this month (sessions that ended), its rate and line, the team's discount and any balance carried from an earlier month: what the month's invoice would be now. An estimate: the invoice is made after the month ends (UTC). Reads the CSMS, never Stripe.
Path parameters
- team_idstringRequiredPattern
^team_[0-9a-f]{32}$
Returns · 200
- periodstringRequired
- fromstringRequired
- tostringRequired
- as_ofstringRequired
- team_idstring | null
- billable_fromstring | nullWhen the team's usage starts to be billed: the later of the fee's release and the end of the team's grace period. Usage before it is never invoiced.
- kwhstringRequiredThe team's projects' energy so far this month (sessions that ended).
- usage_minorintegerRequired
- discount_percentintegerDefault
0 - discount_minorintegerDefault
0 - carried_in_minorintegerRequired
- carried_fromstring | null
- estimated_minorintegerRequiredWhat the month's invoice would be now; invoiced after the month ends (UTC).
- minimum_minorintegerRequiredStripe's minimum charge; a smaller amount is carried to the next month.
- currencystringDefault
"usd" - billing_modeenumOne of
self_serve,enterprise· Default"self_serve" - minimum_commitment_minorintegerThe team's minimum monthly commitment (0: none).Default
0 - minimum_topup_minorintegerWhat the minimum adds to the month so far.Default
0 - rate_cents_per_kwhstringRequiredThe team's rate; a project's override is on its line.
- invoicedbooleanRequiredFalse for a waived or internal team.
- linesarray of InvoiceLineRecordRequired
Child attributes
- tenant_idintegerRequiredThe project.
- kindenumusage: the project's sessions that ended in the month. late: sessions of an earlier, already invoiced month that reached the CSMS after it was invoiced.One of
usage,late· Default"usage" - periodsarray of string | nulllate: the months those sessions ended in.
- kwhstringRequiredEnergy of the project's completed charging sessions (that ended in the month, or late ones): the exact decimal sum of the core's kWh.
- rate_cents_per_kwhstringRequired
- rate_sourceenumRequiredOne of
team,project - transactionsintegerRequired
- amount_minorintegerRequiredround_half_up(kwh x rate) in US cents.
- descriptionstring | nullThe invoice line: 'Ivora CSMS, <month>: <kWh> kWh x <rate> cents/kWh (project ...)'.
GET /v1/teams/{team_id}/billing/usage
curl --fail-with-body "https://api.ivoracharge.com/v1/teams/team_0123456789abcdef0123456789abcdef/billing/usage" \
-H "Authorization: Bearer $IVORA_API_KEY"Response · 200
{
"period": "string",
"from": "string",
"to": "string",
"as_of": "string",
"team_id": "team_0123456789abcdef",
"billable_from": "string",
"kwh": "string",
"usage_minor": 1250,
"discount_percent": 0,
"discount_minor": 0,
"carried_in_minor": 1250,
"carried_from": "string",
"estimated_minor": 1250,
"minimum_minor": 1250,
"currency": "usd",
"billing_mode": "self_serve",
"minimum_commitment_minor": 0,
"minimum_topup_minor": 0,
"rate_cents_per_kwh": "string",
"invoiced": false,
"lines": [
{
"tenant_id": 1042,
"kind": "usage",
"periods": [
"string"
],
"kwh": "string",
"rate_cents_per_kwh": "string",
"rate_source": "team",
"transactions": 1,
"amount_minor": 1250,
"description": "string"
}
]
}Try it is not available here yetRequests from this page are off until the production API at
https://api.ivoracharge.com is public. Use the code samples from your application server; Ivora grants production access. Keys are created in Developer tools.