Linking Subscription Notification back to a unique AppleId / User

I'm currently using App Store Server Notifications which is fine I have an endpoint and i am receiving data. I can see that in the message the originalTransactionId looks to be a unique Id based on a subscription for a user. My issue is if the App is uninstalled and then reinstalled with the same Apple Account, then they subscribe to the App this will give me a different originalTransactionId, which I need to be able to link this to the same user somehow? Is there way this can be done? I need some sort of global unique Id for a apple user which will be the same no matter if they uninstall and reinstall.

thanks, James

Replies

If the user uninstalls and reinstalls the app, the original transaction id will not change. Additionally, if we imagine that your app has multiple subscription groups (which could have an original transaction per subscription), things like the App Store Server API's Get Transaction History endpoint https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history (server side) or Transactions.all (client side) https://developer.apple.com/documentation/storekit/transaction/3851203-all, will return all subscription transactions and original transaction ids for that user, for that user's entire history. Last, using https://developer.apple.com/documentation/storekit/skmutablepayment/1506088-applicationusername while performing a buy can allow you to apply an identifier for a user as well.

I hope this helps and please follow up with any further questions.