目录

Parameter

Mandatory (M)/Optional (O)

Type

Description

applicationId

M

long

App ID.

autoRenewing

M

Boolean

For consumables or non-consumables,

  • the value is fixed to 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

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

kind

M

Integer

Product type. The options are as follows:

  • 0: consumable

  • 1: non-consumable

  • 2: subscription

packageName

O

String

App installation package name.

productId

M

String

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

int

Transaction 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

String

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

int

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. The options are as follows:

  • 0: HUAWEI Points

  • 3: credit card

  • 4: Alipay

  • 6: DCB

  • 13: PayPal

  • 16: debit card

  • 17: WeChat Pay

  • 19: gift card

  • 20: balance

  • 21: HUAWEI Point card

  • 24: WorldPay

  • 31: Huawei Pay

  • 32: Ant Credit Pay

  • 200: M-Pesa

payOrderId

O

String

Transaction order ID.

accountFlag

O

int

Account 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 subscription is purchased 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.

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

int

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

int

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

int

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

  • 0: no

  • 1: yes

introductoryFlag

O

int

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

  • 1: yes

  • 0: no

trialFlag

O

int

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

  • 1: yes

  • 0: no

cancelTime

O

long

Timestamp of the subscription revoking time. 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

int

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

int

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.

renewStatus

O

int

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

int

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 subscription, the subscription has not expired, and no refund has been made. In this case, you can provide services for the user.

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

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

deferFlag

O

int

Indicates whether to postpone a settlement date.

1: yes

cancelWay

O

int

Subscription cancellation initiator. The options are as follows:

  • 0: user

  • 1: developer

  • 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

int

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

resumeTime

O

long

Time when a subscription is resumed.