Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.
Error code 6003 is caused by inconsistent certificate fingerprint configurations. Check the following items:
Ensure that the certificate fingerprint has been configured, and the certificate for packing the signature on the local client is the same as the certificate for configuring the fingerprint in AppGallery Connect.
Check the fingerprint entries in the certificate. It is recommended that you use a single entry.
If error code 6003 persists when you run the local client after the fingerprint is configured, the debug certificate is running by default. Clear the cache of HUAWEI HMS Core (APK) and run the client again.
Yes. Currently, the required algorithm is SHA256.
The IAP and Base libraries need to be imported.
No callback address needs to be configured for consumables and non-consumables. However, for subscriptions, you can configure a callback address or not.
This parameter is optional. It is mandatory only when a key subscription event is sent to your server using a callback.
This message is displayed because you have no permission using this account.
PKCS8.
Yes. It is recommended that the app obtain the public payment key from your server in real time. Do not store it on the app to prevent app version incompatibility caused by subsequent key upgrade.
No, you cannot.
This message indicates that HUAWEI IAP is not enabled or is enabled abnormally. You need to enable HUAWEI IAP and set the service parameters.
Go to Develop > Earning > In-App Purchases on the console, check whether a public payment key is generated. If not, generate one.
For details, please refer to Enabling Services.
The length depends on the specifications of the key. It will be optimized to 3072 characters or more. You are advised to store the key in the text type in the database.
The default price is used when product prices are displayed on other pages.
No, unless you change it.
Yes. For details, please refer to Conversion Rule Description.
If the HMS Core IAP SDK version is earlier than 3.0, obtain the public key for signature verification by referring to the related document.
For other versions, please refer to Querying IAP Information.
Perform self-check on the following items:
Check whether the public key has a typesetting problem when being used in different languages and versions.
Example: In the PHP version, if each line contains 32 characters, the signature can be verified. If each line contains 64 characters, the signature fails to be verified. In this case, the carriage return in each line must be a hard return.
If you have deployed a server, you are advised to perform signature verification on the server.
Yes. HUAWEI Developers requires the SHA-256 certificate fingerprint.
The possible causes are as follows:
Under Develop > Earning > In-App Purchases on the console, no public payment key is generated.
The API request parameters are incorrect.
The transferred country/region code and currency are incorrect.
Error code 1203 indicates that the request parameter is incorrect. Sub-error code 12303 indicates that client_id in the request does not exist in the system. For details, please refer to Open Platform Authentication.
Note: Ensure that the value of client_id in the request is the same as of appid and the value of client_secret is the same as that of appsecret.
The request header of this API needs to be authenticated using AccessToken. Currently, Huawei provides two authentication modes, of which the app password mode is used for this API. You are advised to check whether the obtaining method is correct based on Open Platform Authentication.
You are advised to check whether the app ID used for obtaining AccessToken is the same as the app ID associated with purchaseToken in the request.
No. The app APK needs to proactively notify your server after the payment is complete. Your server uses the API in Verifying the Purchase Token for the Order Service to proactively request Huawei to verify the order status.
This message indicates that the signature verification data format is invalid. The possible causes are as follows:
The token in the request header is not encrypted in Base64 mode.
The character string APPAT is not appended before the access token for authorization. The correct access token is similar to APPAT:thisIsAppAtVaule.
For details, please refer to the API specifications.
Value 9 indicates that an expired subscription enters the account retention period.
When a user purchases a subscription, the third-party system deducts the fee, but the Huawei server does not receive a payment success response for a long time. As a result, the order times out. In this case, the Huawei server sends an onhold notification (the value of notificationType is 9) to the app.
This API is used for non-subscriptions. For details about the API for subscriptions, please refer to Purchase Token Verification for the Subscription Service.
According to the requirement, the flow control is performed on too frequent requests. The validity period of the access token is 3,600 seconds. An access token can be reused within the validity period. The app needs to apply for a new access code in advance based on the validity period.
When an app launches, call the obtainOwnedPurchases API to check whether the delivery failure occurs. If so, redeliver the corresponding products. After the successful redelivery, call the consumeOwnedPurchase API to consume them.
If an exception occurs during a payment, call the obtainOwnedPurchases API to check whether the payment is successful. If the delivery failure occurs, redeliver the corresponding product.
If a product has been purchased but is not consumed, error code 60051 is returned during the payment. In this case, call the obtainOwnedPurchases API to check whether the delivery failure occurs. If so, redeliver the corresponding product.
No. Currently, the purchase token is valid for 30 days.
The access token becomes invalid. You are advised to obtain a new access token.
Non-consumables do not need to be consumed after payment. Currently, all purchased non-consumables are returned through the obtainOwnedPurchases API. That is, these products provide services all the time. You can determine whether the non-consumables have been delivered. The product that has provide the service needs to continue providing (which depends on your design). The product that has not been confirmed needs to be delivered and confirmed. For details, please refer to Providing the Services of a Non-Consumable Product.
During common product query, only activated products are returned. For subscriptions, all are returned. The returned products can be distinguished based on the status field in the returned product information.
In a renewal scenario, subscriptionId identifies the one-to-one mapping between users and products. Therefore, the value of this field does not change. You can use this field to identify your request ID.
For example, the payment API needs to be called upon successful first payment of a subscription. The API request contains the developerPayload field. You can use this field to associate the custom request ID. After the payment is complete, subscriptionId is obtained. Your server saves the association between the three fields.
After the successful renewal, Huawei will send you a key subscription event notification, including the subscription ID (associated with the user and product, which is unchanged) and the new order ID generated by Huawei.
In this case, you can use the subscription ID to find developerPayload (request ID) for the first subscription purchase.
Yes. A maximum of 200 records are recommended.
Each token is independent and valid within its validity period. However, your server can apply for up to 2 access token within one hour; otherwise, the flow control will be triggered.
If multiple servers exist or multiple processes are started on a server and you have applied for an access token, handle the fault by referring to App-Level Access Token Sharing and Reuse Solutions.
You need to configure the certificate fingerprint on HUAWEI Developers.
Will a purchased non-consumable be reset and can be purchased again when the APK is reinstalled?
No. The purchase of the non-consumable is recorded on the Huawei IAP server. Reinstalling the APK does not affect the purchase record.
Will the purchase of a non-consumable be automatically canceled after a period of time?
No.
Can I manually cancel the purchase of a non-consumable to avoid creating a separate tester account for each test?
In the sandbox testing, you can call the consumption API to consume the non-consumable. After the non-consumable is consumed successfully, you can purchase it again without creating multiple tester accounts.
Yes. However, the HMS Core (APK) must be installed on the test device. Otherwise, the service cannot run properly. To ensure stability, it is recommended that you use Huawei devices for the test.
The sandbox testing function can be used only when the following conditions are met: A sandbox testing account is successfully added, and the value of versionCode of the test package is greater than that of the released package. In the HMS Core IAP SDK 4.0.2, the isSandboxActivated API is added to check whether the current sandbox testing environment is available. If not, the API returns the reason why the environment is unavailable. For details, please refer to Sandbox Testing.
Yes. This is a normal situation.
Possible cause: The payment using this bank card is under risk control. It is recommended that the user change the payment method or use another bank card.
No. Only real payments are recorded.
Non-Huawei phones have compatibility issues. You are advised to use Huawei phones for testing. For some third-party phones, you can perform the following operations to solve this issue:
Check whether HMS Core (APK) is installed on the mobile phone.
Enable the HMS Core (APK) permission on the mobile phone.
A subscription can be renewed for a maximum of six times in the sandbox testing environment. After that, the subscription cannot be renewed again and is in expired state. This restriction does not apply to the real environment.
When you pay for a subscription in the sandbox testing environment, no fee is deducted, the subscription period is shortened, and the subscription can be renewed for a maximum of six times.
Yes. Other information is the same as that in the real environment, for example, there is a key event notification callback for purchasing subscriptions.
For WeChat Pay, contact Huawei operations personnel to submit an entrusted payment application. For details, contact Huawei operations personnel.
The sum is returned.
Your server will receive the notification in real time. After the app triggers an event, the Huawei server notifies your server within several seconds.
Currently, calling the payment API and opening the payment page are separated. If the payment API does not return a response for a long time due to a network issue, you can allow the user to open the payment page repeatedly. However, you also need to handle the previous payment API call response to prevent the page from being opened twice.
The time starts from the day when the fee is deducted successfully, that is, May 3.
The possible causes are as follows:
The service area of the HUAWEI ID does not support HUAWEI IAP (To view the service area, go to AppGallery > Me > Settings > Country/Region). For details about the countries or regions that support IAP, please refer to Supported Countries and Regions.
The createPurchaseIntentWithPrice API used for payment is not a hosted API. The app needs to use the hosted API createPurchaseIntent outside the Chinese mainland.
Currently, there is only one payment UI.
Yes. You can configure the maximum payment amount in the PMS based on the in-app product price template.
The signature algorithm must be SHA-256. The signature verification algorithm can be determined based on the signType parameter in the callback result.
Yes. You can sign in to HUAWEI Developers. Click Console in the upper right corner. On the displayed console, go to My Reports > HUAWEI IAP, and manually apply for a refund. The above operations are allowed only when you have the refund permission.
In the HMS Core SDK 4.0, all orders are managed by Huawei. That is, Huawei returns the order numbers for which users complete payment to you. For details about the payment request fields, please refer to the HMS Core SDK 4.0 document.
No, it is viewed the next day.
The merchant request ID is the unique ID generated by the Huawei server after the app calls the createPurchaseIntent or createPurchaseIntentWithPrice API to initiate a payment request. The ID is returned to the client.
HMS SDK 2.0: Click the button to trigger the Huawei payment server to send a payment success callback to your server.
HMS SDK 4.0: Click the button to trigger the Huawei payment server to send a payment success callback to the Huawei IAP server. You will not receive the payment success callback.
In the HMS Core SDK 4.0, order IDs are fully managed. After a payment is complete, the Huawei server generates a Huawei order ID (specified by payorderId) or merchant request ID (specified by requestId or orderId) and returns it to your app.
The createPurchaseIntent API returns payorderId and orderId, which correspond to Huawei order ID and merchant request ID in the console report.
The app displays the local price and unit based on the service area to which the current HUAWEI ID belongs. (To view the service area, go to AppGallery > Me > Settings > Country/Region.)
Yes. When creating a subscription in AppGallery Connect, you can set the promotional price to free of charge. The promotional price can be free of charge or a discounted price.
In the Chinese mainland: Only WeChat and Alipay are supported.
If the user's service area supports HUAWEI Points, the user can purchase a subscription by HUAWEI Points. However, the user needs to set the payment mode used first in the payment and bill, and select HUAWEI Points. At the same time, the user needs to select the bank card or DCB. If the user's service area supports HUAWEI Points, the user cannot purchase a subscription by HUAWEI Points.
Actual number of days in the month.
There is no restriction currently. The restriction may be planned in the future.
No, they won't.
30 days.
No. The order is retained until it is redelivered successfully.