# Credit rate overrides

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


A credit rate override sets a different credit rate for one subscription, for example to apply a negotiated rate. It replaces the [feature-level credit rate](/docs/api/credit_rates) for that subscription only. A subscription can have one override per metered feature, and the override uses the credit unit of the feature-level credit rate.

**How overrides work**

-   An override applies as soon as it is created or updated. Usage that was already converted into credits is not re-priced.
-   Each update creates a new version of the override.
-   Removing an override returns the subscription to the feature-level credit rate that applies to it.

See [Credit rates](/docs/api/credit_rates#how-the-applicable-credit-rate-is-determined) for how credit rates are versioned and how the applicable rate is determined.

Overrides are managed with [Set a credit rate override](/docs/api/credit_rates/set-a-credit-rate-override), [Retrieve a credit rate override](/docs/api/credit_rates/retrieve-a-credit-rate-override), and [Remove a credit rate override](/docs/api/credit_rates/remove-a-credit-rate-override), which are listed under [Credit rates](/docs/api/credit_rates).

## Credit rate overrides attributes

## Input Parameters

- `id` (required, string, max chars=50)
  Identifier of the override. It stays the same across all versions and is used for logging and correlating versions. Operations identify an override by `metered_feature_id` and `subscription_id`, not by this value.

- `metered_feature_id` (required, string, max chars=50)
  The identifier of the [metered feature](/docs/api/metered_features) this override belongs to.

- `credit_unit_id` (required, string, max chars=50)
  The identifier of the [credit unit](/docs/api/credit_units) inherited from the feature-level credit rate. An override cannot change it.

- `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.

- `conversion_model` (optional, enumerated string)
  Determines how usage is converted into credits. See [Conversion models](/docs/api/credit_rates#conversion-models).
  Possible 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. Applies only when `conversion_model` is `package`; for `unit` it is always `1`.
  
  **Constraints**
  
  -   Must be greater than `0`.
  -   Supports up to 9 decimal places.

- `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`.
  
  **Constraints**
  
  -   Supports up to 9 decimal places.

- `effective_from` (optional, long)
  The time this version took effect, in UTC seconds. This is when the override was created or last updated.

- `version` (optional, long)
  The version number, starting at `0` for the first version and increasing by one with each update. Use it to display version history; use `resource_version` to detect changes.

- `resource_version` (optional, long)
  A timestamp in milliseconds identifying this version of the override. 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.

- `updated_at` (optional, timestamp(UTC) in seconds)
  The time at which the override was last modified, in UTC seconds.

- `note` (optional, string, max chars=500)
  The reason given for this change, shown in the version history.

- `created_by` (optional, string, max chars=100)
  The email of the user who created the override.

- `created_at` (optional, long)
  The time at which the override was created, in UTC seconds.

- `updated_by` (optional, string, max chars=100)
  The email of the user who last modified the override.

- `deleted` (optional, boolean)
  Indicates whether this override has been removed.

- `subscription_id` (required, string, max chars=50)
  The identifier of the [subscription](/docs/api/subscriptions) this override applies to.

- `credit_rate_version` (optional, long)
  The version of the feature-level credit rate the subscription would use without an override. Together with `version`, this identifies a specific override version—for example, override version `1` for credit rate version `0`.

