Introducing the Chargebee CLI

Usage summary

Usage summary represents aggregated usage data for a metered feature in a subscription over a specific reporting period. The aggregation is performed based on the aggregation method configured in Billing.

Use this resource to analyze feature-level usage for reporting or analytics purposes, independent of usage billing or invoicing.

Group-by attributes

When usage is grouped, each distinct set of group-by attribute values forms one group. The response returns each group as a separate usage_summary object with an attributes list containing:

  • name: The group-by attribute name.
  • value: The group-by attribute value for that group. A null group is returned as JSON null, and an empty-string group is returned as "".

For example:

The attributes list is not returned when usage is not grouped.

The order of entries in attributes matches the order of the names specified in group_by.

Sample Usage summaryJSON

Usage summary attributes

subscription_id
required, string, max chars=50

The unique identifier of the subscription for which usage is reported.

feature_id
required, string, max chars=100

The unique identifier of the metered feature for which usage is aggregated.

aggregated_value
required, string, max chars=33

The total usage aggregated over the reporting window defined by aggregated_from and aggregated_to. The aggregation is performed based on the aggregation method configured in Billing.

aggregated_from
required, timestamp(UTC) in seconds

The start timestamp (inclusive) of the aggregation window in UTC.

aggregated_to
required, timestamp(UTC) in seconds

The end timestamp (exclusive) of the aggregation window in UTC.

attributes
optional

The group-by attributes that identify the usage group. Each entry contains the group-by attribute's name and value. A null group is returned with value set to JSON null, while an empty-string group has value set to "".

This list is returned only when the request includes group_by. Its order matches the group-by attribute order specified in group_by.