How to know if a user cancelled and resubscribed again after certain period ?

Hi, I was looking at the api documentation for the transaction history api. https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history

And I want to understand, how do I know if the user cancelled the subscription and re-subscribed after some period ?

Hi, we use online receipt validation, server response contain this info

for example:

    environment = Sandbox;
    "latest_receipt" = "<base64 encoded receipt>";
    "latest_receipt_info" =     (
                {
            **"expires_date" = "2021-04-01 08:11:41 Etc/GMT";**
            "expires_date_ms" = 1617264701000;
            "expires_date_pst" = "2021-04-01 01:11:41 America/Los_Angeles";
            "is_in_intro_offer_period" = false;
            "is_trial_period" = false;
            "original_purchase_date" = "2021-04-01 08:06:43 Etc/GMT";
            "original_purchase_date_ms" = 1617264403000;
            "original_purchase_date_pst" = "2021-04-01 01:06:43 America/Los_Angeles";
            "original_transaction_id" = 1000000796251683;
            "product_id" = "<some product id>";
            "purchase_date" = "2021-04-01 08:06:41 Etc/GMT";
            "purchase_date_ms" = 1617264401000;
            "purchase_date_pst" = "2021-04-01 01:06:41 America/Los_Angeles";
            quantity = 1;
            "subscription_group_identifier" = 20744130;
            "transaction_id" = 1000000796251683;
            "web_order_line_item_id" = 1000000061338245;
        }
    );
    **"pending_renewal_info" =     (
                {
            "auto_renew_product_id" = "<some product id>";
            "auto_renew_status" = 1;
            "original_transaction_id" = 1000000796251683;
            "product_id" = "<some product id>";
        }**
    );
    receipt =     {
        "adam_id" = 0;
        "app_item_id" = 0;
        "application_version" = "4.0";
        "bundle_id" = "<some bundle id>";
        "download_id" = 0;
        "in_app" =         (
                        {
                "expires_date" = "2021-04-01 08:11:41 Etc/GMT";
                "expires_date_ms" = 1617264701000;
                "expires_date_pst" = "2021-04-01 01:11:41 America/Los_Angeles";
                "is_in_intro_offer_period" = false;
                "is_trial_period" = false;
                "original_purchase_date" = "2021-04-01 08:06:43 Etc/GMT";
                "original_purchase_date_ms" = 1617264403000;
                "original_purchase_date_pst" = "2021-04-01 01:06:43 America/Los_Angeles";
                "original_transaction_id" = 1000000796251683;
                "product_id" = "<some product id>";
                "purchase_date" = "2021-04-01 08:06:41 Etc/GMT";
                "purchase_date_ms" = 1617264401000;
                "purchase_date_pst" = "2021-04-01 01:06:41 America/Los_Angeles";
                quantity = 1;
                "transaction_id" = 1000000796251683;
                "web_order_line_item_id" = 1000000061338245;
            }
        );
        "original_application_version" = "1.0";
        "original_purchase_date" = "2013-08-01 07:00:00 Etc/GMT";
        "original_purchase_date_ms" = 1375340400000;
        "original_purchase_date_pst" = "2013-08-01 00:00:00 America/Los_Angeles";
        "receipt_creation_date" = "2021-04-01 08:06:43 Etc/GMT";
        "receipt_creation_date_ms" = 1617264403000;
        "receipt_creation_date_pst" = "2021-04-01 01:06:43 America/Los_Angeles";
        "receipt_type" = ProductionSandbox;
        "request_date" = "2021-04-01 08:06:46 Etc/GMT";
        "request_date_ms" = 1617264406754;
        "request_date_pst" = "2021-04-01 01:06:46 America/Los_Angeles";
        "version_external_identifier" = 0;
    };
    status = 0;
}

When a customer cancels during an active period, you will see the auto renew status change to false and their subscription ends on the expires date. Like the above response, reviewing the transactions history you can see any gaps.

but to truly monitor the customer journey, you can use Server Notifications Version 2 that alert you cancels, refunds and even notifies you for a resubscribe.

How to know if a user cancelled and resubscribed again after certain period ?
 
 
Q