Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.Try now
ChargebeechargebeeAPI

Usage charges

Usage charge represents the current, unbilled usage for a metered feature in a subscription within its active usage period. Each usage charge reflects usage accumulated from the start of the current usage period up to the time of the request. It includes:

  • the metered feature (feature_id)
  • the included entitlement for the current period (included_usage)
  • the total usage recorded so far (total_usage)
  • any chargeable usage beyond the included entitlement, including on-demand usage and amount (on_demand_usage, metered_item_price_id, amount)
  • the usage interval (usage_from, usage_to) used to compute the usage

Sample Usage chargeJSON

API Index URL

https://[site].chargebee.com/api/v2/usage_charges

Usage charges attributes

subscription_id
required, string, max chars=100

Unique identifier of the subscription to which the usage charge applies.

feature_id
required, string, max chars=100

Unique identifier of the feature for which usage is tracked.

included_usage
optional, string, max chars=33

Usage included in the subscription entitlement for the current usage period.

total_usage
optional, string, max chars=33

Total usage accumulated so far for the feature in the current usage period.

on_demand_usage
optional, string, max chars=33

Usage beyond the included entitlement for the current usage period. Returned only when the feature has an associated metered addon.

metered_item_price_id
optional, string, max chars=100

Identifier of the metered item price used to calculate charges. Returned only when the feature has an associated metered addon.

amount
optional, string, max chars=39

Current overage charge computed from usage recorded so far, in major units of the currency. This value can change until the usage period ends. Returned only when the feature has an associated metered addon.

currency_code
optional, string, max chars=3

ISO currency code in which the overage charges are computed. Returned only when amount exists.

usage_from
required, timestamp(UTC) in seconds

Start timestamp of the usage window used to compute the accumulated total_usage for the feature.

usage_to
required, timestamp(UTC) in seconds

End timestamp of the usage window used to compute the accumulated total_usage for the feature.