Verifying subscription receipt responds with an identification key. The key is available to distinguish the result of receipt verification and receipts by market after verifying the subscription receipt.

Due to individual subscription process by market, make sure to manage in accordance with the response of receipt identification key, hiveiap_apple_infofrom Apple App Store, hiveiap_google_info from Google Play Store, hiveiap_amazon_info from Amazon Appstore, hiveiap_huawei_infofrom Huawei AppGallery, and hiveiap_onestore_infofrom ONE store.

  • Workflow of subscription purchase and restoration
  • Workflow of scheduling to verify subscription receipt for renewal

 

  • Request URL
    Common URL https://hiveiap.qpyou.cn/api_v4/verify_subscription
    Sandbox URL https://sandbox-hiveiap.qpyou.cn/api_v4/verify_subscription
    HTTP Method POST
    HTTP Header Content-Type text/html
    Authorization Bearer (Optional)

    • You can use a Bearer token only if the Hive Certification Flag at Hive Console AppCenter > Game Management > Game List: Select your company’s game > Game Details > Basic Info is set to Y.
    • The Bearer token is the Hive Certification Key at AppCenter > Game Management > Game List: Select your company’s game > Game Details > Basic Info.
    Data Format JSON
  • Request
    Field Name Description Type Required
    purchase_bypass_info Purchaser, device and receipt information extracted by Hive SDK.
    When implementing Hive IAP v4 in-app purchase, bypassInfo (the value encoded to Base64 with JSON format) from IAPV4Receipt Object is sent from Hive SDK v4 to Game Client → Game Server → Hive IAP v4 Subscried-receipt Verification Server in order. The object is a callback of purchaseSubscriptionupdate() or restoreSubscription() method in the IAPV4 class.
    String Y
  • Response
    Field Name Description Type Required
    result Response code

    • 0: Verification success
    • Others: Verification failure or problems with Hive IAP settings
    Integer Y
    result_msg Response message String Y
    hiveiap_market_id Market code which distinguishes the store user paid.

    • 1: Apple App Store
    • 2: Google Play Store
    • 5: Amazon Store
    • 7: Huawei Store

    Deliver only when the response code is 0 (verification success).

    Integer N
    hiveiap_receipt The value which converts the String-format receipt to Object. Apple App Store is unavailable to generate the object format, so it only receives as String.
    Deliver only when the response code is 0 (Verification success).
    Apple App Store: String
    Google Play Store: Object
    N
    hiveiap_receipt_verify_result The result of receipt verification sent from market verification server

    Deliver only when the response code is 0 (Verification success).

    Object N
    hiveiap_receipt_start_date_ms Start date of subscription (Unix TimeStamp Milliseconds).
    Deliver only when the response code is 0 (Verification success).
    Long N
    hiveiap_receipt_expire_date_ms Expiry date of subscription (Unix TimeStamp Milliseconds).
    Deliver only when the response code is 0 (Verification success).
    Long N
    hiveiap_receipt_subscription_state Subscription status

    • 0: Subscription
    • 1: Grace period
    • 2: Account Holding
    • 3: Pause
    • 4: Expiry

    Only Google subscription transmits this value (Markets except Google responds as 0). This field is added to check the subscription state as supporting account hold and subscription restorations is required for all developers after November 1, 2020 by updating Google policy.

    • Grace period: It extends the expiration time until the payment state of users is normalized. (It is applied for the time setting on Google market console.)
    • Account holding: Access to content is are not given after the expiration time when the user payment status is not normalized, but the subscription expiration time is extended when the subscription is restored after the payment status is normalized. (It holds the state for maximum 30 days.)
    Integer N
    hiveiap_apple_info It responds with the key which distinguishes receipt from the result of verifying subscription receipt on Apple.
    Only for subscription receipts paid on App Store.
    Deliver only when the response code is 0 (Verification success).
    Object N
    ㄴ original_transaction_id The key available to distinguish subscription receipt on Apple market. It returns a same value if upgrading or downgrading subscription within the same group, or cancelling or re-purchasing the same subscription as the previous purchase.
    It is composed by 16 characters, and flexible to change the length as Apple guide has no limits.
    String N
    hiveiap_google_info It responds with the key which distinguishes receipt from the result of verifying subscription receipt on Google.
    Only for subscription receipts paid on Play Store
    Deliver only when the response code is 0 (Verification success).
    Object N
    ㄴ purchase_token Purchase token on receipt
    It is composed of 200 and more characters, and flexible to change the length as Google guide has no limits.
    String N
    ㄴ purchase_token_hash Hashing value (sha1) of purchase_token field
    Due to long value of purchase_token, which may cause problems when game saves or searches DB, it uses hash function (40 characters).
    String N
    ㄴ linked_purchase_token The value avilable to distinguish the purchase token of previous receipt if new receipt is issued by upgrading, downgrading, cancelling the previous subscription, or re-activating the subscription in app. If this value exists, it is recommended to expire the previous receipt by force.
    It is composed of 200 and more characters, and flexible to change the length as Google guide has no limits.
    If you reactivate on Play Store, however, new receipt is not issued.
    String N
    ㄴ linked_purchase_token_hash Hashing value (sha1) of linked_purchase_token field
    Due to long value of linked_purchase_token, which may cause problems when game saves or searches DB, it uses hash function (40 characters).
    String N
    hiveiap_amazon_info It responds with the key which distinguishes receipt from the result of verifying subscription receipt on Amazon.
    Deliver only when the response code is 0 (Verification success).
    Object N
    ㄴ receipt_id Receipt number String N
    hiveiap_huawei_info It responds with the key which distinguishes receipt from the result of verifying subscription receipt on Huawei.
    Deliver only when the response code is 0 (Verification success).
    Object N
    ㄴ pay_order_id Receipt number which is changed at every auto-renewable subscription String N
    ㄴ purchase_token Purchase token on receipt
    It is composed of 92 and more characters, and flexible to change the length as Huawei guide has no limits.
    If subscription in group is unavailable, auto-renewable purchase keeps its token as the same value with that of items only when user purchases the same item with the same market account.
    String N
    ㄴ purchase_token_hash Hashing value (sha1) of purchase_token field String N
    hiveiap_onestore_info It responds with the key which distinguishes receipt from the result of verifying subscription receipt on ONE store.
    Deliver only when the response code is 0 (Verification success).
    Object N
    ㄴ purchase_id Receipt number which is changed at every auto-renewable subscription String N
  • Result code
    Code Message Comment
    0 Success Verification success
    1000001 No requested parameter When sent parameter does not exist
    1000003 DB Connection Error When DB connection is failed
    1000005 Internal Server Error Internal server error
    1000006 The required parameter info is missing When essential parameter has no value
    1000503 Failed to authenticate the receipt When receipt verification is failed or it is a hacked receipt (spoofing)
    1000504 The public key hasn’t been registered When License Key for receipt verification on Google, Amazon, Huawei, or ONE store is not registered
    1000507 Failed to save the purchase info When failed to save the history of purchase
    1000516 The receipt verify server is abnormal When access to the server verifying market receipt is unavailable
    1000517 Failed to find the Google API private key When service account required for implementing Google Developer API is not registered on AppCenter
    1000518 Failed to find the shared secret key When shared secret key required for verifying Apple subscription is not registered on AppCenter
    1000520 Failed to authenticate the API Key Failed to authenticate the Bearer token issued at Hive Console AppCenter.
    1000540 App Store Connect information not found. When not registered App Store Connect API information

 


  • Call Sample
    Apple App Store

    Google Play Store

    Amazon Appstore

    Gallaxy Store

    Huawei AppGallery

    ONE store

  • Request Sample
  • Apple App Store

    Google Play Store

    Amazon Appstore

    Gallaxy Store

    Huawei AppGallery

    ONE store

  • Response Sample
  • Apple App Store

    Google Play Store

    Amazon Appstore

    Gallaxy Store

    Huawei AppGallery

    ONE store