Introducing the Chargebee CLI

Subscription credit rates

A subscription credit rate shows the credit rate a subscription uses for a metered feature: its credit rate override if it has one, otherwise the feature-level credit rate.

Which rate this is

Each entry is the rate the subscription uses for one metered feature. is_overridden says where it comes from:

  • true: the subscription's credit rate override. Every field, including id, version, and effective_from, describes the override.
  • false: the feature-level credit rate that applies to the subscription.

To see the feature-level rate behind an override, use Retrieve a credit rate.

See Credit rates for how credit rates are versioned and how the applicable rate is determined.

Sample Subscription credit rateJSON

Subscription credit rates attributes

id
required, string, max chars=50

Identifier of the rate that applies to the subscription: the subscription's credit rate override when is_overridden is true, otherwise the feature-level credit rate. It stays the same across that rate's versions.

metered_feature_id
required, string, max chars=50

The identifier of the metered feature this credit rate belongs to.

credit_unit_id
required, string, max chars=50

The identifier of the credit unit that usage is converted into.

unit
optional, string, max chars=50

The unit of measure of the metered feature, such as tokens. Included so the rate can be displayed without retrieving the metered feature.

status
optional, enumerated string

The status of the credit rate. Currently always active.

Enum Values
active

Usage is converted into credits according to this credit rate.

archived

Reserved for future use.

conversion_model
optional, enumerated string

Determines how the subscription's usage of this metered feature is converted into credits. See Conversion models.

Enum Values
unit

Every unit of usage costs credit_cost credits. package_size is always 1.

package

Usage is charged in packages of package_size units, and each package costs credit_cost credits. Packages are counted on the total usage in the billing term, and a partly used package is charged as a full package.

package_size
optional, bigdecimal, min=1E-9, max=999999999.999999999

The number of usage units in one package; 1 when conversion_model is unit.

credit_cost
optional, bigdecimal, min=0, max=999999999.999999999

The credits charged for each unit of usage when conversion_model is unit, or for each package of package_size units when conversion_model is package.

effective_from
optional, long

The time the version in this entry took effect, in UTC seconds.

version
optional, long

The version number of the rate in this entry: the override's version when is_overridden is true, otherwise the feature-level credit rate's. The two are versioned separately, each starting at 0. Use resource_version to detect changes.

resource_version
optional, long

A timestamp in milliseconds identifying the version of the rate in this entry. It changes when that rate gets a new version, or when an override is set or removed. Use it to detect changes when syncing. It is not a version number; see version for that.

updated_at
optional, timestamp(UTC) in seconds

The time at which the rate in this entry was last modified, in UTC seconds.

note
optional, string, max chars=500

The reason given for the version in this entry, shown in the version history.

created_by
optional, string, max chars=100

The email of the user who created the credit rate.

created_at
optional, long

The time at which the credit rate was created, in UTC seconds.

updated_by
optional, string, max chars=100

The email of the user who last modified the rate in this entry.

subscription_id
required, string, max chars=50

The identifier of the subscription this credit rate applies to.

is_overridden
optional, boolean

Whether the rate in this entry is the subscription's credit rate override (true) or the feature-level credit rate (false).

credit_rate_version
optional, long

The version of the feature-level credit rate the subscription would use without an override. Returned only when is_overridden is true.