My understanding is that we are supposed to use the original transaction ID to link to a user, but that's not a one-to-one mapping.
Let's say I work for ACME Inc and we offer an in-app subscription to content. A customer downloads our app. Inside the app, they create an ACME account (A). Then they purchase the subscription within the app. During verification and fulfillment, we save the user's ACME account ID and the original transaction ID from the Apple receipt. Great!
At some point, the user cancels the subscription and doesn't use the service for some time. When they decide they want to use it again, they open the ACME app and can't remember their login for ACME account (A). So, instead of recovering the account, they create a new account (B). Then they purchase a subscription. We save the user's ACME account ID and the original transaction ID from the Apple receipt.
The original transaction ID will be the same in both cases, but the ACME account is different.
Now, when I get an App Store Server Notification, I use the original transaction ID to lookup which ACME user it affects. How do I decide which of the two ACME accounts (A or B) it pertains to?
Let's say I work for ACME Inc and we offer an in-app subscription to content. A customer downloads our app. Inside the app, they create an ACME account (A). Then they purchase the subscription within the app. During verification and fulfillment, we save the user's ACME account ID and the original transaction ID from the Apple receipt. Great!
At some point, the user cancels the subscription and doesn't use the service for some time. When they decide they want to use it again, they open the ACME app and can't remember their login for ACME account (A). So, instead of recovering the account, they create a new account (B). Then they purchase a subscription. We save the user's ACME account ID and the original transaction ID from the Apple receipt.
The original transaction ID will be the same in both cases, but the ACME account is different.
Now, when I get an App Store Server Notification, I use the original transaction ID to lookup which ACME user it affects. How do I decide which of the two ACME accounts (A or B) it pertains to?
If you want that one user only have one account in ACME, you can detect that the original_transaction_id is being used by another account, and inform the user that he has another account.
If you decide to allow a user have different accounts in ACME, then that shouldn't be a problem because the user is the same with two accounts. If the user is the same, it shouldn't matter what account he used to log in.
To share subscription between members of a family, Apple has now Family Sharing:
https://developer.apple.com/documentation/appstoreservernotifications/notification_type#3733656
If you decide to allow a user have different accounts in ACME, then that shouldn't be a problem because the user is the same with two accounts. If the user is the same, it shouldn't matter what account he used to log in.
To share subscription between members of a family, Apple has now Family Sharing:
https://developer.apple.com/documentation/appstoreservernotifications/notification_type#3733656