Atomia Billing Server

Subscription Expiration

14 views 0

Configuration description

Namespace:Atomia.Billing.Plugins.GenericWorkflowPlugin.ScheduledTasks.SubscriptionExpirationScheduledEventHandler

This handler is used to control the actions for a subscription when it either expires or is terminated. The expiration action is set as a configuration option for the product item.

Possible expire actions:

  • ExpireActionType.NoAction: Do nothing.
  • ExpireActionType.Suspend: Suspend the subscription.
  • ExpireActionType.Terminate: Terminate the subscription.
  • ExpireActionType.Downgrade: Downgrade the subscription to the cheapest package available.

Example plugin configuration:

            {
              "ApprovedItemsCount": 50,
              "ScheduleItemsCount": 50,
              "ApplyToSubresellers":true,
              "AutoApprove": true,
              "Downgrade": false,
              "ExpirationActionAllowedStates": null,
              "ExpirationActionOffsets": [
                {
                  "Key": "Domain",
                  "Value": 8
                }
              ],
              "TerminationActionAllowedStates": null,
              "TerminationActionOffsets": [

              ]
            }
  • ApprovedItemsCount Limit the number of tasks to be auto-approved during one run. Zero means no limit.
  • ScheduleItemsCount Limit the number of subscriptions to be checked during one run. Zero means no limit.
  • ApplyToSubresellers If set to true and this configuration is reseller specific then it also applies to the reseller’s sub-resellers.
  • AutoApprove Should the action be auto-approved.
  • Downgrade If set to true then the downgrade to the cheaper package will be attempted during the termination offset run. If the downgrade is not possible or is unsuccessful, then the termination will be performed.  (Note:  This option is not active at the moment).
  • ExpirationActionAllowedStates List of states that should be used to filter for which subscriptions to run the expire action.
  • ExpirationActionOffsets[].Key The name of the product category to be used. Special value Default can be used to specify the options that apply to all categories with no specific options in the Offsets section.
  • ExpirationActionOffsets[].Value Represents how many days after the subscription expiration to run the configured expire action.
  • TerminationActionAllowedStates List of states that should be used to filter which subscriptions to terminate.
  • TerminationActionOffsets[].Key The name of the product category to be used. Special value Default can be used to specify the options that apply to all categories with no specific options in the Offsets section.
  • TerminationActionOffsets[].Value Represents how many days after the subscription expiration to run the termination action.

Expiration action offsets

It’s possible to define multiple expiration offsets based on product categories. To include all product categories, a special value Default can be set for the ExpirationActionOffsets[].Key.

The expiration offset value (ExpirationActionOffsets[].Value) represents the number of days after the subscription expiration date when to run the expiration action.

The ExpirationActionAllowedStates represents the list of states that should be used to filter which subscriptions should be handled with expired action.

The expiration action will be executed if:

  • there is an offset with the ExpirationActionOffsets[].Key value set to the specific product category of the product related to the subscription (first choice),
  • there is an offset with the ExpirationActionOffsets[].Key value set to Default (fallback option)

There are two types of expire action that can be set individually for a product:

  • discontinued expired action,
  • not paid expire action.

Discontinued Expire Action

Discontinued expire action is applied to expired subscriptions whose recurring flag is set to false (as explained in the Termination at the end of the subscription period).

The available options for this action are:

  • No Action – No action will be performed for a subscription.
  • Suspend – The subscription status will be changed to “Suspend”.
  • Terminate – The subscription will be terminated. (recommended)
  • Downgrade – The subscription will be downgraded to the cheapest package available. (Note:  This option is not active at the moment and is doing the same thing as ‘No Action’).

Not Paid Expire Action

Not paid expire action is applied to expired subscriptions whose recurring flag is set to true. If a recurring subscription has expiration in the past, it means that renewal was not done because the invoice is not paid.

The available options for these actions are:

  • No Action – No action will be performed for a subscription.
  • Suspend – The subscription status will be changed to “Suspend”.
  • Terminate – The subscription will be terminated.
  • Downgrade – The subscription will be downgraded to the cheapest package available.

Good to know

The “Downgrade” action will be executed if it is possible. If the product related to the subscription is already the cheapest product in the downgrade group, or there is no downgrade option for that product, then the subscription will remain unchanged and an error will be logged in the Action Trail.

Termination offsets

It’s possible to define multiple termination offsets based on product categories. Just like for the expiration offset, to include all product categories, a special value Default can be set for the TerminationActionOffsets[].Key.

The termination offset value (TerminationActionOffsets[].Value) represents the number of days after the subscription expiration date when to run the termination action.

The TerminationActionAllowedStates represents the list of states that should be used to filter which subscriptions should be handled with the termination action.

The termination action will be executed if:

  • there is an offset with the TerminationActionOffsets[].Key value set to the specific product category of the product related to the subscription (first choice),
  • there is an offset with the TerminationActionOffsets[].Key value set to Default (fallback option)

Useful tip

The termination action offset can complement expiration action offset by handling subscriptions that are already handled by the expiration action.

For example, we can set a not paid expire action to suspend the subscription 8 days after expiration and then set the termination offset (for the same product category) to handle all subscriptions in the status “Suspend” (TerminationActionAllowedStates) 30 days after expiration.

Suspending the subscription usually disables the service associated with the subscription which will draw the attention of the customer and give him time to react (pay the invoice) before we do the termination and delete all the data that may be difficult to recover.

Another way to achive a similar setup is by adding termination configuration for the product (see Delayed termination configuration ).

Was this helpful?