目录

Parameter

Mandatory(M)/Optional (O)

Type

Description

applicationId

M

Long

App ID.

autoRenewing

M

Boolean

For consumables or non-consumables, the fixed option is as follows:

  • false

For subscriptions, the options are as follows:

  • true: A subscription is in active state and will be automatically renewed on the next renewal date.

  • false: A user has canceled the subscription. The user can access the subscribed content before the next renewal date but will be unable to access content after the date unless the user enables automatic renewal. If a grace period is provided, this value remains true for the subscription as long as it is still in the grace period. The next renewal date is automatically postponed every day until the grace period ends or the user changes the payment method in the grace period.

orderId

M

String

Order ID, which uniquely identifies a transaction and is generated by the Huawei IAP server during payment.

A different order ID is generated for each fee deduction.

kind

M

Integer

Product type. The options are as follows:

  • 0: consumable

  • 1: non-consumable

  • 2: renewable subscription

  • 3: non-renewable subscription

packageName

O

String

App installation package name.

productId

M

String

In-app product ID. Each product must have a unique ID, which is maintained in the PMS or passed to the PMS when the app initiates a purchase.

productName

O

String

Product name.

purchaseTime

O

Long

Timestamp of the purchase time, which is the number of milliseconds from 00:00:00 on January 1, 1970 to the purchase time.

purchaseState

M

Integer

Purchase status. The options are as follows:

  • -1: initialized

  • 0: purchased

  • 1: canceled

  • 2: refunded

developerPayload

O

String

Information stored on the merchant side, which is passed by the app when the payment API is called.

developerChallenge

O

String

Challenge defined when an app initiates a consumption request, which uniquely identifies the consumption request. This parameter exists only for one-off products.

consumptionState

O

Integer

Consumption status, which exists only for one-off products. The options are as follows:

  • 0: not consumed

  • 1: consumed

purchaseToken

M

String

Purchase token, which uniquely identifies the mapping between a product and a user. It is generated by the Huawei IAP server when the payment is complete.

purchaseType

O

Integer

Purchase type. The options are as follows:

  • 0: in the sandbox

  • 1: in the promotion period (currently unsupported)

This parameter is not returned during common purchase.

currency

O

String

Currency. The value must comply with the ISO 4217 standard.

price

O

Long

Value after the actual price of a product is multiplied by 100. The actual price is accurate to two decimal places. For example, if the value of this parameter is 501, the actual product price is 5.01.

country

O

String

Country or region code, which is used to identify a country or region. The value must comply with the ISO 3166 standard.

payType

O

String

Payment method. For details about the value, please refer to payType.

payOrderId

O

String

Transaction order ID.

accountFlagOIntegerAccount type. The options are as follows:
  • 1: AppTouch user account

  • 0: Huawei account

The following parameters are returned only in the subscription scenario.

lastOrderId

M

String

Order ID generated by the Huawei IAP server during fee deduction for the previous renewal. The parameter value is the same as that of orderId when a product is subscribed to for the first time.

productGroup

O

String

ID of the subscription group to which a subscription belongs.

purchaseTime

O

Long

Timestamp of the purchase time, which is the number of milliseconds from 00:00:00 on January 1, 1970 to the purchase time.

If the purchase is not complete, this parameter is left empty.

oriPurchaseTime

O

Long

Timestamp of the first fee deduction time, which is the number of milliseconds from 00:00:00 on January 1, 1970 to the first successful fee deduction time.

subscriptionId

O

String

Subscription ID.

Note:

This parameter uniquely identifies the mapping between a product and a user. It does not change when the subscription is renewed.

oriSubscriptionId

O

String

Original subscription ID. If this parameter is set to a value, the current subscription is switched from another one. The value can be associated with the subscription about the original subscription.

quantity

O

Integer

Purchase quantity.

daysLasted

O

Long

Days of a paid subscription, excluding the free trial period and promotion period.

numOfPeriods

O

Long

Number of successful standard renewal periods (that is, renewal periods without promotion). If the parameter is set to 0 or left empty, no renewal has been performed successfully.

numOfDiscount

O

Long

Number of successful renewal periods with promotion.

expirationDate

O

Long

Timestamp of the subscription expiration time.

For an automatic renewal receipt where the fee has been deducted successfully, this parameter indicates the renewal date or expiration date. If the value is a past time for the latest receipt of a subscription, the subscription has expired.

expirationIntent

O

Integer

Reason why a subscription expires. The options are as follows:

  • 1: canceled by a user

  • 2: product being unavailable

  • 3: abnormal user signing information

  • 4: billing error

  • 5: price increase disagreed with by a user

  • 6: unknown error

If there are multiple exceptions, a smaller number indicates a higher priority (1 > 2 > 3...).

retryFlag

O

Integer

Indicates whether the system still tries to renew an expired subscription. The options are as follows:

  • 0: no

  • 1: yes

introductoryFlag

O

Integer

Indicates whether a subscription is in the renewal period with promotion. The options are as follows:

  • 1: yes

  • 0: no

trialFlag

O

Integer

Indicates whether a subscription is in the free trial period. The options are as follows:

  • 1: yes

  • 0: no

cancelTime

O

Long

Time when a subscription is revoked. A refund is made and the service is unavailable immediately. This parameter has a value when a user: (1) makes a complaint and revokes a subscription through the customer service personnel; (2) performs subscription upgrade or crossgrade that immediately takes effect and revokes the previous receipt of the original subscription.

Note: If a receipt is revoked, the purchase is not complete.

cancelReason

O

Integer

Cause of subscription cancellation. The options are as follows:

  • 2: A user performs subscription upgrade or crossgrade.

  • 1: A user encounters a problem within the app and cancels the subscription.

  • 0: other causes. For example, a user mistakenly purchases a subscription and has to cancel it.

Note: If this parameter is left empty but the cancelTime parameter has a value, the cancellation is caused by an operation such as upgrade.

appInfo

O

String

App information. This parameter is reserved.

notifyClosed

O

Integer

Indicates whether a user has disabled the subscription notification function. The options are as follows:

  • 1: yes

  • 0: no

If the user disables the subscription notification function, no subscription notification will be sent to this user.

Note: This parameter is returned only when subscription relationships are queried.

renewStatus

O

Integer

Renewal status. The options are as follows:

  • 1: The subscription renewal is normal.

  • 0: The user cancels subscription renewal.

For auto-renewable subscriptions, this parameter is valid for both valid and expired subscriptions. However, it does not represent users' subscription status. Generally, when the value is 0, the app can provide other subscription options for the user, for example, recommending another subscription with a lower level in the same group. The value 0 indicates that a user proactively cancels the subscription.

priceConsentStatus

O

Integer

User opinion on the price increase of a product. The options are as follows:

  • 1: The user has agreed to the price increase.

  • 0: The user does not take any action. After the subscription expires, it becomes invalid.

renewPrice

O

Long

Price used upon the next renewal. It is provided as a reference for users when the priceConsentStatus parameter is returned.

subIsvalid

O

Boolean

true: A user has been charged for a product, the product has not expired, and no refund has been made. In this case, you can provide services for the user.

false: The purchase of a product is not finished, the product has expired, or a refund has been made for the product after its purchase.

Note: If a user has canceled a subscription, the subIsvalid parameter value is still true until the subscription expires.

deferFlag

O

Integer

Indicates whether to postpone the settlement date. The value 1 indicates that the settlement date is postponed.

cancelWay

O

Integer

Subscription cancellation initiator. The options are 0 (user), 1 (developer), and 2 (Huawei).

cancellationTime

O

Long

Subscription cancellation time in UTC.

Note:
cancelWay and cancellationTime are displayed when a subscription renewal stops (the refund is not involved).

cancelledSubKeepDays

O

Integer

Number of days for retaining a subscription relationship after the subscription is canceled.

confirmedOInteger

Confirmation status. The options are as follows: 

  • 0: not confirmed; 

  • 1: confirmed.

 If this parameter is left empty, no confirmation is required.

resumeTime

OLong

Timestamp when a subscription is resumed (UTC).

surveyReasonOInteger

Cancellation reason. The options are as follows:

  • 0: others

  • 1: too high fee

  • 2: technical problem, for example, product not provided

  • 5: fraud and blocklist

  • 7: subscription switch

  • 9: service being rarely used and not required

  • 10: other better apps

surveyDetailsO

String

When the value of surveyReason is 0, this parameter is used to collect the cancellation reason entered by users.