目录

Understanding Auto-renewable Subscriptions

Users gain access to premium app features or content for a set duration upon purchasing an auto-renewable subscription. At the end of a billing cycle, the subscription automatically renews for the next cycle unless the user cancels it.

Configuring Auto-renewable Subscriptions

[h2]Subscription Group

Subscriptions are managed and maintained by subscription groups. Before creating a subscription, create a subscription group and specify the subscription group to which the subscription belongs.

Such a mechanism provides you with a convenient way to easily manage products with slight differences in their functions.

[h2]Billing Cycle

The billing cycle of an auto-renewable subscription can be 1 week, 30 days, 31 days, 1 month, 2 months, 3 months, 6 months, or 12 months. To set the billing cycle, refer to Configuring an Auto-renewable Subscription.

[h2]Account Hold Period

If a subscription expires due to cancellation, renewal failure, or other causes, the subscription enters the account hold period of up to 180 days. During this period, the user has no access to this subscription. However, if the user resumes a subscription during the account hold period, all services of this subscription are immediately accessible.

Subscription Statuses and Changes

[h2]Subscription Statuses

Status Service Accessible Description
To be active No

The subscription has not taken effect and the user has no access to services of this subscription. (The subscription in this status cannot be queried.)

If a user switches to a subscription that takes effect later in a subscription group, the original subscription is about to expire, and the new subscription is in the to-be-active state. The user can view the start time of the new subscription on the details screen of the original subscription.

Active Yes

Renewable: The subscription will be automatically renewed after the current billing cycle ends.

Expire soon: The subscription will not be automatically renewed after the current billing cycle ends.

Expired No The possible causes may be as follows: The fee deduction fails in the last renewal, the user cancels the subscription, the user does not agree to the price increase, or the fee deduction account is abnormal. Then, the subscription enters the Account Hold Period.
Renewal attempt No The system will automatically attempt to renew your subscription at regular intervals, either shortly before or after your current subscription expires.
Cancelled No The subscription has been successfully canceled. Relevant benefits will be revoked immediately, and neither the user nor you can undo the cancellation.

[h2]Subscription Status Changes

After a user successfully purchases a subscription, the subscription enters the renewable state. The subscription status changes when the following operations are performed:

Status Change Description
Canceling a subscription

A user cancels an auto-renewable subscription. After a subscription is canceled, the user retains access to it until the end of the current billing cycle.

Note: In this scenario, your server will receive a server key event notification of AUTO_RENEW_DISABLED.

Resuming a subscription

A user can resume an expiring or expired subscription to regain access to it.

Note: In this scenario, your server will receive a server key event notification of AUTO_RENEW_ENABLED or RESTORE.

Switching from one subscription to another

When a user has an active subscription and wants to switch to a different subscription within the same subscription group, two things can happen.

- The new subscription takes effect immediately (no account hold period for the original subscription): The original subscription balance will be converted into days for the new subscription, extending the validity period of the new subscription. This happens in the following scenarios:

1. Subscription upgrade: The new subscription has a higher level than the original subscription.

2. The new subscription has the same level and also the same billing cycle as the original subscription.

NOTE

In this scenario, your server will receive the server key event notification of UPGRADE.

For details about how to calculate the validity period of a subscription, please refer to How to Calculate the Validity Period for New Subscriptions upon Immediate Switch of Auto-Renewable Subscriptions?.

- The new subscription will take effect at the end of the current billing cycle: The original subscription is set to the expiring state and the new subscription is marked as to-be-active. The new subscription will be charged and take effect upon the date when the original subscription becomes expired. This happens in the following scenarios:

1. Subscription downgrade: The new subscription has a lower level than the original subscription.

2. The new subscription has the same level as the original subscription, but they have different billing cycles.

Note: In this scenario, your server will receive a server key event notification of DOWNGRADE.

The subscription status changes as follows:

Subscription Management by Users

Your app can use the iap.showManagedSubscriptions API to redirect users to the subscription page or subscription details page to manage subscriptions. Users can also go to Settings > HUAWEI ID > Payment and purchases > Subscriptions to manage subscriptions. They can perform operations such as viewing, canceling, changing, and resuming subscriptions.

Renewal Processing

The renewal price for a subscription (including the original price, the price after any increases, and the price after any decreases) will be determined 10 days before the renewal date. For a subscription with a billing cycle of one week, the price for the next renewal needs to be confirmed immediately after the current renewal is successful. If the price is adjusted after it is confirmed, the next renewal will still be at the original price, while the renewal after that will be at the new price.

24 hours before the end of a billing cycle, the IAP server will attempt to charge the user to renew their subscription. If the charge fails, the IAP server will retry the charge within a certain period to restore the subscription.

If a subscription becomes inactive due to failed billing, the system will automatically retry the billing for up to 60 days.

Promotional Offers

To make subscriptions more attractive, the following promotion methods are available:

When setting a promotion, besides specifying the promotion type, you also need to select a payment method for each promotion:

For details about how to configure the product, please refer to Configuring Products.

  • Whether a user can enjoy an offer depends on the offer ID passed by you. For more information about this parameter, please refer to Generating a Signed Purchase Parameter for a Promotion.

  • The IAP server determines whether a user can enjoy an introductory offer and automatically applies the offer to the user. You can check the hasEligibilityForIntroOffer field of SubscriptionInfo in the return value of iap.queryProducts to determine whether a user has enjoyed an introductory offer.

Modifying Auto-renewable Subscriptions

[h2]Adjusting the Price of a Subscription

You can raise or lower the price of a subscription if you need. Check Modifying a Single Product > Auto-Renewable Subscription for the detailed operations.

[h2]Removing a Subscription

It is necessary to consider the impact on users when you plan to remove certain auto-renewable subscriptions.

Receiving Notifications About Key Subscription Events

If you have specified the notification receiving address, the IAP server will call this API to notify the configured server of some key events in the subscription scenario after a user purchases an auto-renewable subscription. For details, please refer to Key Event Notifications. Here are some key events:

If your app server returns a failure response (the HTTP status code in the response is not 200), the notification about the key event will be periodically resent to your app server. It is recommended that your app server return a success response immediately after receiving the notification, to avoid constantly receiving messages from the IAP server.

Notes on Integrating the Subscription Functions for an App with Multiple Roles for an Account

A user uses their HUAWEI ID to purchase a subscription. For one subscription, only one purchase is allowed for each HUAWEI ID at the same time. In this case, if your app allows an account to have multiple roles, there is a possibility that services are delivered incorrectly. The recommended solutions for this issue are as follows:

  1. Allow a user to purchase only common duration-based products for their roles other than role A, for which they have purchased an auto-renewable subscription. (This can be implemented via consumables.)

  2. Design a mechanism for transferring retained benefits. For example, when a user purchases a subscription for role B after they have purchased an auto-renewable subscription for role A, this mechanism can be used to transfer retained benefits from role A to role B.

  3. Configure multiple subscriptions. For example, for a game in which different game servers have different roles, create independent subscriptions for each server.