Creates the credit rate for a metered feature. The new credit rate is version 0, is active, and applies right away to every subscription that has a credit grant for its credit_unit_id.
Prerequisites & Constraints
- The metered feature must exist and be active.
- The metered feature must not already have a credit rate.
Implementation Notes
- To change the credit rate later, use Update a credit rate. Each update creates a new version.
- To set a different rate for one subscription, use Set a credit rate override.
Sample Request
create a credit rate for a metered feature
Sample Result[JSON]
URL Format
POST https://[site].chargebee.com/api/v2/metered_features/{metered-feature-id}/create_credit_rate
Input Parameters
The identifier of the credit unit that usage is converted into. It cannot be changed after the credit rate is created.
Determines how usage is converted into credits. See Conversion models.
Enum Values
unit
Every unit of usage costs credit_cost credits. Do not pass package_size.
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.
Returns
Credit rate object
The credit rate that was created, as version 0.