Wednesday, January 10, 2018

[WSO2] [APIM] How to change the subscription tier of an existing subscription without re-subscribing

WSO2 APIM 2.1.0 does not support tier modifications for existing subscriptions through UI or the Rest API. However, we can do this manually as below.

The subscription information is stored in the AM_SUBSCRIPTION table of the WSO2AM_DB database. We can change the subscription tiers manually through updating the corresponding db entry.

For example, if we want to change all ‘Unlimited’ tiers to ‘Gold’, then we can execute following command:

update AM_SUBSCRIPTION set TIER_ID = 'Gold' where TIER_ID = 'Unlimited';

If we want to change ‘Unlimited’ tiers to ‘Gold’ of a specific subscription, then we can execute following command after identifying the subscription id:

update AM_SUBSCRIPTION set TIER_ID = 'Gold' where SUBSCRIPTION_ID=1 AND TIER_ID= "Unlimited";

This update will take around 15minutes to update the cache. Note that above queries are written for the mysql server.

No comments:

Post a Comment