Expired Balances

When a balance or meter expires, the object is removed or purged from the owner's wallet"/> after a configurable amount of time.

When an expired balance is removed from a wallet, the balance entry in the Balance Set database and the balance object in the Subscriber database are both deleted. When a periodic balance is removed, all related balance intervals are also removed. When an aggregated G/L balance is removed, all related virtual balances are updated and, if applicable, are also removed. Balance expiration notifications can be sent before or after a balance is removed.

Criteria for Removing Expired Balances

The following criteria determines when an expired balance is removed from the database:
  • The balance is no longer referenced by any offers purchased by groups, subscribers, or devices.
  • The end time and the configured retention period have elapsed.
  • The required balance forfeiture has been performed.
    Note: If the balance forfeit delay time is larger than the balance purge delay, the removal is delayed until after the forfeiture.

Removal of Expired Private and Non-Private Balances

Balance removal is different for private balances and non-private balances. Non-private balances are removed when both of the following are true:
  • This balance instance is not required in any of the present purchased offers. That is, any purchased offers have been canceled or expired and have been removed.
  • The balance has an EndTime and the balance purge time (EndTime + the configured balance retention period) has been reached.

Private balances are removed when the purchased offer that owns the private balance is removed from the system, That is, the purchased item has an EndTime and the offer purge time (EndTime + the configured offer retention period) has been reached.

Configuring Expired Balance Retention Periods

You can specify retention periods for expired balances in two ways:
  • Specifying a retention period in the create_config.info file.
  • Setting up the retention period using a purge profile.
By default, the expired balance retention period is 45 days after a balance or meter end date. You can change this default by changing the answer to the following create_config.info: Global:How long (in seconds) should expired balances be retained before being purged from the system?

After making this change to the create_config.info question, apply the configuration change. For more information, see the discussion about applying MATRIXX Engine configuration changes in MATRIXX Installation and Upgrade.

For information about configuring global runtime parameters and Task Manager processing, see the discussions about global system configuration and task manager configuration in MATRIXX Configuration.

You can also specify a retention period for an expired balance by using a purge profile. If a purge profile has been specified in the balance template, it is used instead of the create_config.info answer for the retention.

The formula for purging expired balances is based on the maximum time among the parent catalog item purge time, balance purge time, and balance forfeit time. Rating ensures that any catalog item that references the balance is purged before purging the balance. Rating also ensures that any balance forfeit time has expired before purging.

Note: MATRIXX Support recommends that the balance purge time be longer than the longest quota authorization so that no balance is purged while a reservation is still against it. Also, to avoid checkpoint validation errors (for example, when a catalog item is purged and a balance exists that is not required by any offer), set the balance and catalog item purge times to be longer than the longest balance forfeit time for any balance associated with that catalog item.

For more information, see the discussion about purge profiles in My MATRIXX Help.

Expired balances are removed by the Charging Server as a background task triggered by the Task Manager's recurring processing scan. Online charging requests are not interrupted during the removal.