MeterUsage

Query meter usage

Query aggregated usage from meter_usage table for a single meter with optional time-window bucketing

post/meter-usage/query

Request body

aggregation_type'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM' required
billing_anchorstring date-time
end_timestring date-time required
external_customer_idstring required
meter_idstring required
start_timestring date-time required
window_size'MONTH' | 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'

Example request

{
  "billing_anchor": "2024-01-15T00:00:00Z",
  "end_time": "2024-02-01T00:00:00Z",
  "external_customer_id": "cust_123",
  "meter_id": "mtr_abc",
  "start_time": "2024-01-01T00:00:00Z"
}

Response

OK

aggregation_type'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM'
event_countinteger
meter_idstring
total_valuestring

Example response

{
  "event_count": 42,
  "meter_id": "mtr_abc",
  "points": [
    {
      "event_count": 10,
      "timestamp": "2024-01-01T00:00:00Z",
      "value": "100.0000"
    }
  ],
  "total_value": "1234.5678"
}

Changes