curl --request POST \
--url https://us.api.flexprice.io/v1/meter-usage/analytics \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"aggregation_type": "COUNT",
"end_time": "2024-02-01T00:00:00Z",
"external_customer_id": "cust_123",
"meter_ids": [
"mtr_abc",
"mtr_def"
],
"start_time": "2024-01-01T00:00:00Z",
"billing_anchor": "2023-11-07T05:31:56Z",
"window_size": "MINUTE"
}
'{
"items": [
{
"aggregation_type": "COUNT",
"event_count": 42,
"meter_id": "mtr_abc",
"points": [
{
"event_count": 10,
"timestamp": "2024-01-01T00:00:00Z",
"value": "100.0000"
}
],
"total_value": "1234.5678"
}
]
}Query aggregated usage from meter_usage table for multiple meters
curl --request POST \
--url https://us.api.flexprice.io/v1/meter-usage/analytics \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"aggregation_type": "COUNT",
"end_time": "2024-02-01T00:00:00Z",
"external_customer_id": "cust_123",
"meter_ids": [
"mtr_abc",
"mtr_def"
],
"start_time": "2024-01-01T00:00:00Z",
"billing_anchor": "2023-11-07T05:31:56Z",
"window_size": "MINUTE"
}
'{
"items": [
{
"aggregation_type": "COUNT",
"event_count": 42,
"meter_id": "mtr_abc",
"points": [
{
"event_count": 10,
"timestamp": "2024-01-01T00:00:00Z",
"value": "100.0000"
}
],
"total_value": "1234.5678"
}
]
}Enter your API key in the format x-api-key <api-key>*
Analytics parameters
COUNT, SUM, AVG, COUNT_UNIQUE, LATEST, SUM_WITH_MULTIPLIER, MAX, WEIGHTED_SUM "2024-02-01T00:00:00Z"
"cust_123"
1["mtr_abc", "mtr_def"]"2024-01-01T00:00:00Z"
MINUTE, 15MIN, 30MIN, HOUR, 3HOUR, 6HOUR, 12HOUR, DAY, WEEK, MONTH, MONTH OK
Show child attributes