curl --request POST \
--url https://us.api.flexprice.io/v1/events/analytics \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"breakdown_bucket": true,
"end_time": "2023-11-07T05:31:56Z",
"expand": [
"<string>"
],
"external_customer_id": "<string>",
"feature_ids": [
"<string>"
],
"group_by": [
"<string>"
],
"include_children": true,
"property_filters": {},
"sources": [
"<string>"
],
"start_time": "2023-11-07T05:31:56Z"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.events.get_usage_analytics()
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.events.getUsageAnalytics({});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Events.GetUsageAnalytics(ctx, types.GetUsageAnalyticsRequest{})
if err != nil {
log.Fatal(err)
}
if res.GetUsageAnalyticsResponse != nil {
// handle response
}
}{
"currency": "<string>",
"custom_analytics": [
{
"feature_name": "<string>",
"id": "<string>",
"name": "<string>",
"type": "<string>",
"value": "<string>"
}
],
"items": [
{
"add_on_id": "<string>",
"addon": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"aggregation_type": "COUNT",
"bucket_summaries": [
{
"base_charge": "<string>",
"bucket_id": "<string>",
"commitment_type": "<string>",
"commitment_value": "<string>",
"computed_overage": "<string>",
"computed_true_up": "<string>",
"computed_utilized": "<string>",
"end": {
"hour": 12,
"minute": 29
},
"price_id": "<string>",
"start": {
"hour": 12,
"minute": 29
},
"subscription_line_item_id": "<string>",
"total_usage": "<string>"
}
],
"commitment_info": {
"amount": "<string>",
"computed_commitment_utilized_amount": "<string>",
"computed_overage_amount": "<string>",
"computed_true_up_amount": "<string>",
"duration": "MONTHLY",
"is_windowed": true,
"overage_factor": "<string>",
"quantity": "<string>",
"true_up_enabled": true,
"type": "amount"
},
"currency": "<string>",
"event_count": 123,
"event_name": "<string>",
"external_customer_id": "<string>",
"feature": {
"alert_settings": {
"alert_enabled": true,
"alert_threshold_type": "absolute",
"critical": {
"condition": "above",
"threshold": "<string>"
},
"info": {
"condition": "above",
"threshold": "<string>"
},
"warning": {
"condition": "above",
"threshold": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"group": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"entity_type": "price",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"group_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"meter_id": "<string>",
"name": "<string>",
"reporting_unit": {
"conversion_rate": 123,
"unit_plural": "<string>",
"unit_singular": "<string>"
},
"status": "published",
"tenant_id": "<string>",
"type": "metered",
"unit_plural": "<string>",
"unit_singular": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"feature_id": "<string>",
"group": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"entity_type": "price",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"environment_id": "<string>",
"event_name": "<string>",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "<string>",
"name": "<string>",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"meter_id": "<string>",
"name": "<string>",
"plan": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"display_order": 123,
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"plan_id": "<string>",
"points": [
{
"buckets": [
{
"bucket_id": "<string>",
"price_id": "<string>"
}
],
"computed_commitment_utilized_amount": "<string>",
"computed_overage_amount": "<string>",
"computed_true_up_amount": "<string>",
"cost": "<string>",
"discount": "<string>",
"event_count": 123,
"subtotal": "<string>",
"timestamp": "<string>",
"usage": "<string>"
}
],
"price": {
"addon": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grants": [
{
"addon_id": "<string>",
"cadence": "ONETIME",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grant_anchor": "2023-11-07T05:31:56Z",
"credits": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"expiration_duration": 123,
"expiration_duration_unit": "DAY",
"expiration_type": "NEVER",
"id": "<string>",
"metadata": {},
"name": "<string>",
"period": "DAILY",
"period_count": 123,
"plan_id": "<string>",
"priority": 123,
"scope": "PLAN",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"tenant_id": "<string>",
"topup_conversion_rate": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"description": "<string>",
"entitlements": [
{
"addon": "<unknown>",
"aggregation_mode": "additive",
"config_value": {},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"display_order": 123,
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "PLAN",
"environment_id": "<string>",
"feature": {
"alert_settings": {
"alert_enabled": true,
"alert_threshold_type": "absolute",
"critical": {
"condition": "above",
"threshold": "<string>"
},
"info": {
"condition": "above",
"threshold": "<string>"
},
"warning": {
"condition": "above",
"threshold": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"group": {
"created_at": "2023-11-07T05:31:56Z",
"entity_ids": [
"<string>"
],
"entity_type": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"group_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"created_at": "2024-03-20T15:04:05Z",
"event_name": "api_request",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "API Usage Meter",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "tenant123",
"updated_at": "2024-03-20T15:04:05Z"
},
"meter_id": "<string>",
"name": "<string>",
"reporting_unit": {
"conversion_rate": 123,
"unit_plural": "<string>",
"unit_singular": "<string>"
},
"status": "published",
"tenant_id": "<string>",
"type": "metered",
"unit_plural": "<string>",
"unit_singular": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"feature_id": "<string>",
"feature_type": "metered",
"grant_allocation_behavior": "first_usage",
"grant_duration_unit": "hour",
"grant_duration_value": 123,
"grant_measure": "quantity",
"grant_quota": "<string>",
"id": "<string>",
"is_enabled": true,
"is_soft_limit": true,
"parent_entitlement_id": "<string>",
"plan": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grants": [
{
"addon_id": "<string>",
"cadence": "ONETIME",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grant_anchor": "2023-11-07T05:31:56Z",
"credits": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"expiration_duration": 123,
"expiration_duration_unit": "DAY",
"expiration_type": "NEVER",
"id": "<string>",
"metadata": {},
"name": "<string>",
"period": "DAILY",
"period_count": 123,
"plan_id": "<string>",
"priority": 123,
"scope": "PLAN",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"tenant_id": "<string>",
"topup_conversion_rate": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"description": "<string>",
"display_order": 123,
"entitlements": "<array>",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"price_sync_status": {
"current_sequence": 123,
"synced": true,
"unsynced_subscription_count": 123
},
"prices": "<array>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"plan_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"static_value": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"usage_limit": 123,
"usage_reset_period": "MONTHLY"
}
],
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"prices": "<array>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"amount": "<string>",
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"bucket_size": "MINUTE",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"display_name": "<string>",
"display_price_unit_amount": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "PLAN",
"environment_id": "<string>",
"feature": {
"reporting_unit": {
"conversion_rate": 123,
"unit_plural": "<string>",
"unit_singular": "<string>"
}
},
"group": {
"created_at": "2023-11-07T05:31:56Z",
"entity_ids": [
"<string>"
],
"entity_type": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"group_id": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"created_at": "2024-03-20T15:04:05Z",
"event_name": "api_request",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "API Usage Meter",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "tenant123",
"updated_at": "2024-03-20T15:04:05Z"
},
"meter_id": "<string>",
"min_quantity": "<string>",
"parent_price_id": "<string>",
"plan": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grants": [
{
"addon_id": "<string>",
"cadence": "ONETIME",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grant_anchor": "2023-11-07T05:31:56Z",
"credits": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"expiration_duration": 123,
"expiration_duration_unit": "DAY",
"expiration_type": "NEVER",
"id": "<string>",
"metadata": {},
"name": "<string>",
"period": "DAILY",
"period_count": 123,
"plan_id": "<string>",
"priority": 123,
"scope": "PLAN",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"tenant_id": "<string>",
"topup_conversion_rate": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"description": "<string>",
"display_order": 123,
"entitlements": "<array>",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"price_sync_status": {
"current_sequence": 123,
"synced": true,
"unsynced_subscription_count": 123
},
"prices": "<array>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"price_unit": "<string>",
"price_unit_amount": "<string>",
"price_unit_id": "<string>",
"price_unit_tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"price_unit_type": "FIAT",
"pricing_unit": {
"base_currency": "<string>",
"code": "<string>",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"environment_id": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"symbol": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"sequence": 123,
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"tenant_id": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "up"
},
"trial_period_days": 123,
"type": "USAGE",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"price_id": "<string>",
"properties": {},
"reporting_unit": {
"conversion_rate": 123,
"unit_plural": "<string>",
"unit_singular": "<string>"
},
"source": "<string>",
"sources": [
"<string>"
],
"sub_line_item_id": "<string>",
"subscription_id": "<string>",
"subscription_line_item": {
"addon_association_id": "<string>",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"commitment_amount": "<string>",
"commitment_duration": "MONTHLY",
"commitment_overage_factor": "<string>",
"commitment_quantity": "<string>",
"commitment_time_buckets": [
{
"commitment_type": "amount",
"commitment_value": "<string>",
"end": {
"hour": 12,
"minute": 29
},
"id": "<string>",
"overage_factor": 123,
"price_id": "<string>",
"start": {
"hour": 12,
"minute": 29
},
"true_up_enabled": true
}
],
"commitment_true_up_enabled": true,
"commitment_type": "amount",
"commitment_windowed": true,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"customer_id": "<string>",
"display_name": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "plan",
"environment_id": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"environment_id": "<string>",
"event_name": "<string>",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "<string>",
"name": "<string>",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"meter_display_name": "<string>",
"meter_id": "<string>",
"plan_display_name": "<string>",
"price": {
"amount": "<string>",
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"bucket_size": "MINUTE",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"display_name": "<string>",
"display_price_unit_amount": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "PLAN",
"environment_id": "<string>",
"group_id": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter_id": "<string>",
"min_quantity": "<string>",
"parent_price_id": "<string>",
"price_unit": "<string>",
"price_unit_amount": "<string>",
"price_unit_id": "<string>",
"price_unit_tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"price_unit_type": "FIAT",
"sequence": 123,
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"tenant_id": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "up"
},
"trial_period_days": 123,
"type": "USAGE",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"price_id": "<string>",
"price_type": "USAGE",
"price_unit": "<string>",
"price_unit_id": "<string>",
"quantity": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"subscription_phase_id": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"subtotal": "<string>",
"total_cost": "<string>",
"total_discount": "<string>",
"total_usage": "<string>",
"total_usage_display": "<string>",
"unit": "<string>",
"unit_plural": "<string>",
"window_size": "MINUTE"
}
],
"subtotal": "<string>",
"total_cost": "<string>",
"total_discount": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Get usage analytics
Use when building analytics views (e.g. usage by feature or customer over time). Supports filtering, grouping, and time-series breakdown.
curl --request POST \
--url https://us.api.flexprice.io/v1/events/analytics \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"breakdown_bucket": true,
"end_time": "2023-11-07T05:31:56Z",
"expand": [
"<string>"
],
"external_customer_id": "<string>",
"feature_ids": [
"<string>"
],
"group_by": [
"<string>"
],
"include_children": true,
"property_filters": {},
"sources": [
"<string>"
],
"start_time": "2023-11-07T05:31:56Z"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.events.get_usage_analytics()
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.events.getUsageAnalytics({});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Events.GetUsageAnalytics(ctx, types.GetUsageAnalyticsRequest{})
if err != nil {
log.Fatal(err)
}
if res.GetUsageAnalyticsResponse != nil {
// handle response
}
}{
"currency": "<string>",
"custom_analytics": [
{
"feature_name": "<string>",
"id": "<string>",
"name": "<string>",
"type": "<string>",
"value": "<string>"
}
],
"items": [
{
"add_on_id": "<string>",
"addon": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"aggregation_type": "COUNT",
"bucket_summaries": [
{
"base_charge": "<string>",
"bucket_id": "<string>",
"commitment_type": "<string>",
"commitment_value": "<string>",
"computed_overage": "<string>",
"computed_true_up": "<string>",
"computed_utilized": "<string>",
"end": {
"hour": 12,
"minute": 29
},
"price_id": "<string>",
"start": {
"hour": 12,
"minute": 29
},
"subscription_line_item_id": "<string>",
"total_usage": "<string>"
}
],
"commitment_info": {
"amount": "<string>",
"computed_commitment_utilized_amount": "<string>",
"computed_overage_amount": "<string>",
"computed_true_up_amount": "<string>",
"duration": "MONTHLY",
"is_windowed": true,
"overage_factor": "<string>",
"quantity": "<string>",
"true_up_enabled": true,
"type": "amount"
},
"currency": "<string>",
"event_count": 123,
"event_name": "<string>",
"external_customer_id": "<string>",
"feature": {
"alert_settings": {
"alert_enabled": true,
"alert_threshold_type": "absolute",
"critical": {
"condition": "above",
"threshold": "<string>"
},
"info": {
"condition": "above",
"threshold": "<string>"
},
"warning": {
"condition": "above",
"threshold": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"group": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"entity_type": "price",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"group_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"meter_id": "<string>",
"name": "<string>",
"reporting_unit": {
"conversion_rate": 123,
"unit_plural": "<string>",
"unit_singular": "<string>"
},
"status": "published",
"tenant_id": "<string>",
"type": "metered",
"unit_plural": "<string>",
"unit_singular": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"feature_id": "<string>",
"group": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"entity_type": "price",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"environment_id": "<string>",
"event_name": "<string>",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "<string>",
"name": "<string>",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"meter_id": "<string>",
"name": "<string>",
"plan": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"display_order": 123,
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"plan_id": "<string>",
"points": [
{
"buckets": [
{
"bucket_id": "<string>",
"price_id": "<string>"
}
],
"computed_commitment_utilized_amount": "<string>",
"computed_overage_amount": "<string>",
"computed_true_up_amount": "<string>",
"cost": "<string>",
"discount": "<string>",
"event_count": 123,
"subtotal": "<string>",
"timestamp": "<string>",
"usage": "<string>"
}
],
"price": {
"addon": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grants": [
{
"addon_id": "<string>",
"cadence": "ONETIME",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grant_anchor": "2023-11-07T05:31:56Z",
"credits": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"expiration_duration": 123,
"expiration_duration_unit": "DAY",
"expiration_type": "NEVER",
"id": "<string>",
"metadata": {},
"name": "<string>",
"period": "DAILY",
"period_count": 123,
"plan_id": "<string>",
"priority": 123,
"scope": "PLAN",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"tenant_id": "<string>",
"topup_conversion_rate": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"description": "<string>",
"entitlements": [
{
"addon": "<unknown>",
"aggregation_mode": "additive",
"config_value": {},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"display_order": 123,
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "PLAN",
"environment_id": "<string>",
"feature": {
"alert_settings": {
"alert_enabled": true,
"alert_threshold_type": "absolute",
"critical": {
"condition": "above",
"threshold": "<string>"
},
"info": {
"condition": "above",
"threshold": "<string>"
},
"warning": {
"condition": "above",
"threshold": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"group": {
"created_at": "2023-11-07T05:31:56Z",
"entity_ids": [
"<string>"
],
"entity_type": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"group_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"created_at": "2024-03-20T15:04:05Z",
"event_name": "api_request",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "API Usage Meter",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "tenant123",
"updated_at": "2024-03-20T15:04:05Z"
},
"meter_id": "<string>",
"name": "<string>",
"reporting_unit": {
"conversion_rate": 123,
"unit_plural": "<string>",
"unit_singular": "<string>"
},
"status": "published",
"tenant_id": "<string>",
"type": "metered",
"unit_plural": "<string>",
"unit_singular": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"feature_id": "<string>",
"feature_type": "metered",
"grant_allocation_behavior": "first_usage",
"grant_duration_unit": "hour",
"grant_duration_value": 123,
"grant_measure": "quantity",
"grant_quota": "<string>",
"id": "<string>",
"is_enabled": true,
"is_soft_limit": true,
"parent_entitlement_id": "<string>",
"plan": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grants": [
{
"addon_id": "<string>",
"cadence": "ONETIME",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grant_anchor": "2023-11-07T05:31:56Z",
"credits": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"expiration_duration": 123,
"expiration_duration_unit": "DAY",
"expiration_type": "NEVER",
"id": "<string>",
"metadata": {},
"name": "<string>",
"period": "DAILY",
"period_count": 123,
"plan_id": "<string>",
"priority": 123,
"scope": "PLAN",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"tenant_id": "<string>",
"topup_conversion_rate": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"description": "<string>",
"display_order": 123,
"entitlements": "<array>",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"price_sync_status": {
"current_sequence": 123,
"synced": true,
"unsynced_subscription_count": 123
},
"prices": "<array>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"plan_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"static_value": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"usage_limit": 123,
"usage_reset_period": "MONTHLY"
}
],
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"prices": "<array>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"amount": "<string>",
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"bucket_size": "MINUTE",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"display_name": "<string>",
"display_price_unit_amount": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "PLAN",
"environment_id": "<string>",
"feature": {
"reporting_unit": {
"conversion_rate": 123,
"unit_plural": "<string>",
"unit_singular": "<string>"
}
},
"group": {
"created_at": "2023-11-07T05:31:56Z",
"entity_ids": [
"<string>"
],
"entity_type": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"group_id": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"created_at": "2024-03-20T15:04:05Z",
"event_name": "api_request",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "API Usage Meter",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "tenant123",
"updated_at": "2024-03-20T15:04:05Z"
},
"meter_id": "<string>",
"min_quantity": "<string>",
"parent_price_id": "<string>",
"plan": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grants": [
{
"addon_id": "<string>",
"cadence": "ONETIME",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grant_anchor": "2023-11-07T05:31:56Z",
"credits": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"expiration_duration": 123,
"expiration_duration_unit": "DAY",
"expiration_type": "NEVER",
"id": "<string>",
"metadata": {},
"name": "<string>",
"period": "DAILY",
"period_count": 123,
"plan_id": "<string>",
"priority": 123,
"scope": "PLAN",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"tenant_id": "<string>",
"topup_conversion_rate": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"description": "<string>",
"display_order": 123,
"entitlements": "<array>",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"price_sync_status": {
"current_sequence": 123,
"synced": true,
"unsynced_subscription_count": 123
},
"prices": "<array>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"price_unit": "<string>",
"price_unit_amount": "<string>",
"price_unit_id": "<string>",
"price_unit_tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"price_unit_type": "FIAT",
"pricing_unit": {
"base_currency": "<string>",
"code": "<string>",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"environment_id": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"status": "published",
"symbol": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"sequence": 123,
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"tenant_id": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "up"
},
"trial_period_days": 123,
"type": "USAGE",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"price_id": "<string>",
"properties": {},
"reporting_unit": {
"conversion_rate": 123,
"unit_plural": "<string>",
"unit_singular": "<string>"
},
"source": "<string>",
"sources": [
"<string>"
],
"sub_line_item_id": "<string>",
"subscription_id": "<string>",
"subscription_line_item": {
"addon_association_id": "<string>",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"commitment_amount": "<string>",
"commitment_duration": "MONTHLY",
"commitment_overage_factor": "<string>",
"commitment_quantity": "<string>",
"commitment_time_buckets": [
{
"commitment_type": "amount",
"commitment_value": "<string>",
"end": {
"hour": 12,
"minute": 29
},
"id": "<string>",
"overage_factor": 123,
"price_id": "<string>",
"start": {
"hour": 12,
"minute": 29
},
"true_up_enabled": true
}
],
"commitment_true_up_enabled": true,
"commitment_type": "amount",
"commitment_windowed": true,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"customer_id": "<string>",
"display_name": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "plan",
"environment_id": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"environment_id": "<string>",
"event_name": "<string>",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "<string>",
"name": "<string>",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"meter_display_name": "<string>",
"meter_id": "<string>",
"plan_display_name": "<string>",
"price": {
"amount": "<string>",
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"bucket_size": "MINUTE",
"conversion_rate": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"display_name": "<string>",
"display_price_unit_amount": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "PLAN",
"environment_id": "<string>",
"group_id": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter_id": "<string>",
"min_quantity": "<string>",
"parent_price_id": "<string>",
"price_unit": "<string>",
"price_unit_amount": "<string>",
"price_unit_id": "<string>",
"price_unit_tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"price_unit_type": "FIAT",
"sequence": 123,
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"tenant_id": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "up"
},
"trial_period_days": 123,
"type": "USAGE",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"price_id": "<string>",
"price_type": "USAGE",
"price_unit": "<string>",
"price_unit_id": "<string>",
"quantity": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"subscription_phase_id": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"subtotal": "<string>",
"total_cost": "<string>",
"total_discount": "<string>",
"total_usage": "<string>",
"total_usage_display": "<string>",
"unit": "<string>",
"unit_plural": "<string>",
"window_size": "MINUTE"
}
],
"subtotal": "<string>",
"total_cost": "<string>",
"total_discount": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Body
Request body
BreakdownBucket when true augments each time-series point with BucketID/PriceID and appends a BucketSummaries rollup to each item. Requires WindowSize to be set and the item to be linked to a subscription line item that has CommitmentTimeBuckets. Default: false (opt-in, backward compatible).
allowed values: "price", "meter", "feature", "subscription_line_item","plan","addon"
ExternalCustomerID is the single external customer ID. Optional when ExternalCustomerIDs is provided; required otherwise.
allowed values: "source", "feature_id", "properties.<field_name>"
IncludeChildren when true folds child customers' usage into the single aggregated total. Default: false.
Property filters to filter the events by the keys in properties field of the event
Show child attributes
Show child attributes
MINUTE, 15MIN, 30MIN, HOUR, 3HOUR, 6HOUR, 12HOUR, DAY, WEEK, MONTH 
