Determine InApp Owned/Renew Subscription from Transactions

I have 3 inapp purchase subscriptions in 1 SubscriptionGroup: Basic, Standard, Premium, and in testing I do the the following actions:

(Purchase) Basic
(Upgrade) Standard
(Upgrade) Premium
(Downgrade) Basic
(Upgrade) Standard

How can I determine from the apple inapp purchase transactions which is the currently owned Subscription? And which is the renewal product?

I understand given Apples rules on subscriptions "Premium" would be owned and "Standard" would renewed. However, I don't have access to the auto_renew_product_id information in the receipt from our api provider and need to determine the renewal product from just the transactions and dates.

After running through the above Subscription actions the 3 products had the following details:

Basic:
{
"renewalIntent": "Renew",
"lastRenewalDate": "2021-03-04T00:29:42.000Z",
"purchaseDate": "2021-03-04T00:25:28.000Z",
"expiryDate": "2021-03-04T00:34:42.000Z"
}

Standard:
{
"renewalIntent": "Renew",
"lastRenewalDate": "2021-03-04T00:29:42.000Z",
"purchaseDate": "2021-03-04T00:27:29.000Z",
"expiryDate": "2021-03-04T00:34:42.000Z"
}

Premium:
{
"renewalIntent": "Renew",
"lastRenewalDate": "2021-03-04T00:29:42.000Z",
"purchaseDate": "2021-03-04T00:29:45.000Z",
"expiryDate": "2021-03-04T00:34:42.000Z"
}

As you can see all Subscriptions still have a "Renew" intent, and all the same purchase and lastRenewalDate. Apple seems to give them all the same purchaseDate even though they were purchased a number of minutes apart..?

How can I determine the current/renew product form this? Is there another field I should look at.
Example of the full details I have available for "Basic" .. and similar for "Standard" and "Premium" (I have modified some of the property values):

{
"id": "basic",
"alias": "basic",
"type": "paid subscription",
"group": "1111111111,
"state": "owned",
"title": "Basic",
"description": "A subscription.",
"priceMicros": 7990000,
"price": "$7.99",
"currency": "USD",
"countryCode": "US",
"loaded": true,
"canPurchase": false,
"owned": true,
"introPrice": null,
"introPriceMicros": null,
"introPricePeriod": null,
"introPricePeriodUnit": null,
"introPricePaymentMode": null,
"ineligibleForIntroPrice": false,
"discounts": [],
"downloading": false,
"downloaded": false,
"additionalData": {
"oldPurchasedSkus": [
"standard",
"premium"
],
"applicationUsername": "aaa"
},
"transaction": {
"type": "ios-appstore",
"id": "10000002222222222",
"appStoreReceipt": null,
"original_transaction_id": "10000001111111111",
"quantity": "1",
"product_id": "premium",
"transaction_id": "10000002222222222",
"purchase_date": "2021-03-04 00:29:42 Etc/GMT",
"purchase_date_ms": "1614817782000",
"purchase_date_pst": "2021-03-03 16:29:42 America/Los_Angeles",
"original_purchase_date": "2021-03-04 00:29:45 Etc/GMT",
"original_purchase_date_ms": "1614817785000",
"original_purchase_date_pst": "2021-03-03 16:29:45 America/Los_Angeles",
"expires_date": "2021-03-04 00:34:42 Etc/GMT",
"expires_date_ms": "1614818082000",
"expires_date_pst": "2021-03-03 16:34:42 America/Los_Angeles",
"web_order_line_item_id": "100000003333333333,
"is_trial_period": "false",
"is_in_intro_offer_period": "false",
"subscription_group_identifier": "1111111111"
},
"billingPeriod": 1,
"billingPeriodUnit": "Month",
"valid": true,
"transactions": [],
"isTrialPeriod": false,
"isIntroPeriod": false,
"renewalIntent": "Renew",
"expired": false,
"isExpired": false,
"lastRenewalDate": "2021-03-04T00:29:42.000Z",
"purchaseDate": "2021-03-04T00:25:28.000Z",
"expiryDate": "2021-03-04T00:34:42.000Z"
}
Determine InApp Owned/Renew Subscription from Transactions
 
 
Q