Changes the credit rate for a metered feature by creating a new version. Earlier versions are kept, and usage that was already converted into credits is not re-priced.
Fields you don't pass keep their values from the current version. credit_unit_id cannot be changed. change_option decides which subscriptions get the new version and when. See How the applicable credit rate is determined.
Prerequisites & Constraints
- The metered feature must already have a credit rate.
Implementation Notes
- To change the rate for one subscription right away, don't update the credit rate. Use Set a credit rate override instead; an override applies to its subscription as soon as it is created.
- The response contains the new version. To see the rate that applies to a particular subscription, use List credit rates for a subscription.
Sample Request
Sample Result[JSON]
URL Format
Input Parameters
Determines which subscriptions get the new version and when. Pass end_of_term or grandfathered.
immediately Not accepted. To change the rate for one subscription right away, use Set a credit rate override.
Only subscriptions created after the update get the new version. Existing subscriptions stay on the version they already use.
Subscriptions created after the update get the new version right away. Existing subscriptions get it when their term renews or resets.
Determines how usage is converted into credits. If not passed, the current value is kept. See Conversion models.
Every unit of usage costs credit_cost credits. Do not pass package_size.
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.
The number of usage units in one package. If not passed, the current value is kept.
Required if
conversion_modelispackage.
Constraints
- Must be greater than
0. - Supports up to 9 decimal places.
- Not accepted when
conversion_modelisunit.
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. If not passed, the current value is kept.
Constraints
- Must be greater than or equal to
0. - Supports up to 9 decimal places.
Returns
The new version of the credit rate.