IAP - Auto Renewing Subs + S2S Notifications

Greetings,
New to iOS App Store connect - not new to engineering. We have a SaaS offering that we are building an iOS app version of. We are supporting IAP Auto-Renewing Subscription for users that find us through the app store. I am trying to understand the flow of the notifications so that we can effectively maintain subscription state across Web & iOS.

Would be great if someone could validate or correct our understanding as follows:

  • User subscribes to monthly auto-renewing subscription.

  • Subscription information passed from app to server.

  • Receipt is validated and "transaction_id" is stored with the users account.

  • INITIAL_BUY s2s notification is received containing the corresponding "transaction_id"

At this point the subscription is active and we won't receive any other s2s notifications unless the subscription is cancelled / not renewed. At some point in the future, we may receive one of which would indicate that the subscription is inactive and needs attention:
  • CANCEL

  • DID_FAIL_TO_RENEW

In addition at the end of every subscription period (monthly) we will get a the following to alert us that the renewal was successful:
  • DID_RENEW

We cannot count on the fact that the mobile app will be consistently opened as it's possible the user subscribes through App Store and then proceeds to user our web based application. That being said, it's important for our servers to understand the state of the subscription without relying on the mobile app.

Are we on the right path here?
Thanks,
Geoff






The field you should use is original_transaction_id, not transaction_id. That's the value you should use when receiving notifications to search in your database in order to identify the user related to that original_transaction_id. When the use makes is initial purchase from the app, you have to send the user ID and the original_transaction_id to your server, and save that information in the database.

When the INITIAL_BUY happens "outside the app", you will not have the information about the user, so you'll have to go to the app to recover the receipt and its original_transaction_id to be able to make the relation between the user ID and the original_transaction_id.
IAP - Auto Renewing Subs + S2S Notifications
 
 
Q