How to identify users that resubscribe to an expired subscription

When a user first subscribes, they do it through our app. Sometimes they cancel, let the subscription expire, then later decide to resubscribe. If they resubscribe through our app, we just fulfill it like it is a new purchase. However, if they resubscribe outside of our app, the only way for us to know about it (and grant access to content) is to subscribe the App Store Server Notifications.

What are the specific App Store Server Notification messages we will receive in this situation and what are the values in the message that we need to look for? How can we tell, just from looking at the App Store Server Notification if the user resubscribe through our app or outside of our app?
Answered by oscaretu in 671684022
If the user reactivates a subscription, you'll receive a notification with the same original_transaction_id, that you should have store in your database related to the user that make the initial purchase using the app.

It the last subscrition happened long time ago, and the user reactivates his subscription from outside the app, I think it is posible that you receive a INITIAL_BUY notification, with a different initial_transaction_id, that you don't have in the database, so you don't know the user that made the purchase. You should tell the user to launch the app, where it should obtain the receipt, the original transaction_id and the user ID, and send it to he server. That way you can add the user ID to the database record that matches the original_transaction_id.

You can see videos from wwdc2020, wwdc2019 y wwdc2018 related to server to server notifications:

https://developer.apple.com/videos/play/wwdc2020/10661/?time=654

See Resources to find more information

Accepted Answer
If the user reactivates a subscription, you'll receive a notification with the same original_transaction_id, that you should have store in your database related to the user that make the initial purchase using the app.

It the last subscrition happened long time ago, and the user reactivates his subscription from outside the app, I think it is posible that you receive a INITIAL_BUY notification, with a different initial_transaction_id, that you don't have in the database, so you don't know the user that made the purchase. You should tell the user to launch the app, where it should obtain the receipt, the original transaction_id and the user ID, and send it to he server. That way you can add the user ID to the database record that matches the original_transaction_id.

You can see videos from wwdc2020, wwdc2019 y wwdc2018 related to server to server notifications:

https://developer.apple.com/videos/play/wwdc2020/10661/?time=654

See Resources to find more information

Hi, what if the user obtains a fresh subscription outside of the app and he has not been any registration to our apps, how to manage it? I did not see any user-specific data in apple notifications. if the user gets a subscription in our app, there is no problem because we can verify it first then store in our subscription database. Then all transactions continued with the original transaction id.

How to identify users that resubscribe to an expired subscription
 
 
Q