Difference between purchase_date and original_purchase_date??

In auto renewable subscription, what is the significance of purchase_date and original_purchase_date??

It is observed that the original_purchase_date and purchase_date changes on every renewal receipt.

How to find if the receipt is renewed one or repurchased receipt??

For an autorenewable subscription there is no difference.

You can compare the IAP dates to the receipt's overall "creation_date" - a purchase that was made at that time will have a close date. I think that will solve your problem. There is no such thing as a 'repurchse' for an autorenewable - there is a restore.

Also, you can find the first IAP purchase of an autorenewable subscription by comparing original_transaction_identifier with transaction_identifier. The first purchase of that subscription (for any duration) will have the same value.



In my case I have to manage the subscription to a magazine, so I need the date of purchase and expires of every receipt's renewals to give the appropriate magazine's numbers to the customer .
This is performed on the Grand Unified Receipt
1)on the first receipt's validation when the client buy the subscription
1) when my batch checks autorenewals and finds a new receipt to validate
2) on every restore required by the customer
In every cases, the dates for every receipt's renewals are always the same: original_purchase_date and expires_date?

Thanks

>In every cases, the dates for every receipt's renewals are always the same: original_purchase_date and expires_date?


No, each individual IAP receipt will have a different expires_date and a different original_purchase_date - and the time in between those two dates is the time for which the subscription was in effect. Unfortunately the "original_purchase_date" does not refer to the original subscription purchase but rather the individual renewal event - it is the same as the purchase_date! If you wish to find the actual original purchase date for the auto-renewable subscription you will need to select one of the many different original_purchase_date(s) in the receipt. You can find that by selecting the individual IAP receipt that has the earliest date or by selecting the individual receipt that has a matching original_transaction_id and transaction_id.

>In auto renewable subscription, what is the significance of purchase_date and original_purchase_date??


From :

https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html


Purchase Date

The date and time that the item was purchased.

[clip]

In an auto-renewable subscription receipt, this is always the date when the subscription was purchased or renewed, regardless of whether the transaction has been restored.


Original Purchase Date

For a transaction that restores a previous transaction, the date of the original transaction.

[clip]

In an auto-renewable subscription receipt, this indicates the beginning of the subscription period, even if the subscription has been renewed.

-=-

Please be sure to listen to PBK's explanations otherwise - they freqently pick up where Apple leaves off, IMHO 😉


Ken

Difference between purchase_date and original_purchase_date??
 
 
Q