INTERACTIVE_RENEWAL notification is sent while user resubscribed to another SKU

It is in sandbox environment, and our serice is using v1

Base on this doc, the INTERACTIVE_RENEWAL notification would be sent:

  1. Subscription is active; customer upgraded to another SKU
  2. Subscription has expired; customer resubscribed to another SKU (upgrade or downgrade)
{
     "environment": "Sandbox",
     "receipt": {
          "receipt_type": "ProductionSandbox",
          "bundle_id": "co.appeconomy.alarm",
          "receipt_creation_date": "2023-04-26 10:13:24 Etc/GMT",
          "request_date": "2023-04-26 10:17:11 Etc/GMT",
          "original_purchase_date": "2013-08-01 07:00:00 Etc/GMT",
          "original_application_version": "1.0"
     },
     "latest_receipt_info": [
          {
               "quantity": "1",
               "product_id": "co.appeconomy.alarm.monthly",
               "transaction_id": "2000000320391970",
               "original_transaction_id": "2000000320390725",
               "purchase_date": "2023-04-26 10:11:53 Etc/GMT",
               "original_purchase_date": "2023-04-26 10:09:59 Etc/GMT",
               "expires_date": "2023-04-26 10:16:53 Etc/GMT",
               "web_order_line_item_id": "2000000026088214",
               "is_trial_period": "false",
               "is_in_intro_offer_period": "false",
               "in_app_ownership_type": "PURCHASED",
               "subscription_group_identifier": "20906883"
          },
          {
               "quantity": "1",
               "product_id": "co.appeconomy.alarm.monthly",
               "transaction_id": "2000000320390725",
               "original_transaction_id": "2000000320390725",
               "purchase_date": "2023-04-26 10:09:53 Etc/GMT",
               "original_purchase_date": "2023-04-26 10:09:59 Etc/GMT",
               "expires_date": "2023-04-26 10:11:53 Etc/GMT",
               "web_order_line_item_id": "2000000026088213",
               "is_trial_period": "true",
               "is_in_intro_offer_period": "false",
               "in_app_ownership_type": "PURCHASED",
               "subscription_group_identifier": "20906883"
          }
     ],
     "pending_renewal_info": [
          {
               "auto_renew_product_id": "co.appeconomy.alarm.monthly",
               "is_in_billing_retry_period": "0",
               "product_id": "co.appeconomy.alarm.monthly",
               "original_transaction_id": "2000000320390725",
               "auto_renew_status": "0"
          }
     ],
     "status": 0
}

these is the response from verifyReceipt api

Can notice that I request at '2023-04-26 10:17:11 Etc/GMT' and latest receipt shows that subscription is expired at '2023-04-26 10:16:53 Etc/GMT'. So obviously this subscription is expired already

But when I resubscribed the same sku(in this case is co.appeconomy.alarm.monthly) in the Setting > App Store > Edit Subscription. My server can still receive INTERACTIVE_RENEWAL notification.

{
     "bid": "co.appeconomy.alarm",
     "bvrs": "2",
     "environment": "Sandbox",
     "unified_receipt": {
          "status": 0,
          "environment": "Sandbox",
          "latest_receipt_info": [
               {
                    "quantity": "1",
                    "product_id": "co.appeconomy.alarm.monthly",
                    "expires_date": "2023-04-26 10:23:47 Etc/GMT",
                    "purchase_date": "2023-04-26 10:18:47 Etc/GMT",
                    "transaction_id": "2000000320398679",
                    "is_trial_period": "false",
                    "in_app_ownership_type": "PURCHASED",
                    "web_order_line_item_id": "2000000026088350",
                    "original_transaction_id": "2000000320390725",
                    "is_in_intro_offer_period": "false",
                    "subscription_group_identifier": "20906883"
               },
               {
                    "quantity": "1",
                    "product_id": "co.appeconomy.alarm.monthly",
                    "expires_date": "2023-04-26 10:16:53 Etc/GMT",
                    "purchase_date": "2023-04-26 10:11:53 Etc/GMT",
                    "transaction_id": "2000000320391970",
                    "is_trial_period": "false",
                    "in_app_ownership_type": "PURCHASED",
                    "web_order_line_item_id": "2000000026088214",
                    "original_transaction_id": "2000000320390725",
                    "is_in_intro_offer_period": "false",
                    "subscription_group_identifier": "20906883"
               },
               {
                    "quantity": "1",
                    "product_id": "co.appeconomy.alarm.monthly",
                    "expires_date": "2023-04-26 10:11:53 Etc/GMT",
                    "purchase_date": "2023-04-26 10:09:53 Etc/GMT",
                    "transaction_id": "2000000320390725",
                    "is_trial_period": "true",
                    "in_app_ownership_type": "PURCHASED",
                    "web_order_line_item_id": "2000000026088213",
                    "original_transaction_id": "2000000320390725",
                    "is_in_intro_offer_period": "false",
                    "subscription_group_identifier": "20906883"
               }
          ],
          "pending_renewal_info": [
               {
                    "product_id": "co.appeconomy.alarm.monthly",
                    "auto_renew_status": "1",
                    "auto_renew_product_id": "co.appeconomy.alarm.monthly",
                    "original_transaction_id": "2000000320390725"
               }
          ]
     },
     "auto_renew_status": "true",
     "notification_type": "INTERACTIVE_RENEWAL",
     "auto_renew_product_id": "co.appeconomy.alarm.monthly",
     "original_transaction_id": 2000000320390725
}

From the product_id and subscription_group_identifier can recognize that I really resubscribed the same sku, so why? Does I miss any exceptional case in document?

Replies

I feel like this notification(INTERACTIVE_RENEWAL) just tell us there are a new subscription is now active(is from non-active to active or from an active to another active). there are 2 situation:

  1. user coming back while an subscription expired
  2. user upgrade to another sku

how can i seperate these 2 situation?

I think i could check the previous receipt, while it's is_upgraded is true, indicate that it is from an active subscription upgrade to another. If is false, then should be reactivation

Yes, You can check if the transaction is "is_upgraded", and if it's true, then it means that the subscription has been upgraded to another SKU. Also, If you check "auto_renew_product_id", it tells you the product that the customer’s subscription renews.

But I would suggest to upgrade to Notification V2, as you can easily identify scenarios such as RESUBSCRIBE, UPGRADE, DOWNGRADE with subtype. Please refer to this document: https://developer.apple.com/documentation/appstoreservernotifications/subtype