The credit rate establishes a connection between a metered feature and a credit unit. By defining this relationship, it specifies how usage recorded against the metered feature is converted into credits that are drawn down from the subscription's credit balance.
A metered feature has at most one credit rate, its feature-level credit rate, which applies to every subscription granted its credit unit. To set a different rate for one subscription, use a credit rate override. To see the rate in effect for each metered feature on a subscription, use subscription credit rates.
Conversion models
A credit rate converts usage into credits in one of two ways, set by conversion_model.
How credit rates are versioned
- Credit rates are immutable. Update a credit rate creates a new version instead of changing the current one, and never re-prices usage that was already converted.
- The change_option of a new version determines which subscriptions move to it and when. Two values are supported:
end_of_termandgrandfathered. - A version in the history returned by List credit rate versions is not necessarily the version applied to a given subscription. That depends on the subscription and on each version's
change_option.
A credit_cost of 0 records usage without consuming credits. See Credit rates and overrides.
How the applicable credit rate is determined
Subscriptions without the credit unit
A credit rate applies only to subscriptions that have a credit grant for its credit_unit_id. If a subscription has no credit grant for that credit unit, the credit drawdown for usage of the metered feature is rejected.
Sample Credit rateJSON
Credit Rates attributes
The identifier of the metered feature this credit rate belongs to.
The identifier of the credit unit that usage is converted into. It cannot be changed after the credit rate is created. The rate applies only to subscriptions that have a credit grant for this credit unit.
Determines how usage is converted into credits. See Conversion models.
Every unit of usage costs credit_cost credits. package_size is always 1.
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.
Determines which subscriptions get this version and when. Updates accept end_of_term or grandfathered. See How the applicable credit rate is determined.
Only subscriptions created after this version get it. Existing subscriptions stay on the version they already use.
Subscriptions created after this version get it right away. Existing subscriptions get it when their term renews or resets.
Set automatically on the first version of a credit rate. Not accepted by Update a credit rate.
A timestamp in milliseconds identifying this version of the credit rate. Versions are immutable, so the value never changes for a version; each update creates a new version with a new resource_version. Use it to detect changes when syncing. It is not a version number; see version for that.