App Store API. Pair user with transactions

Hello I'm working on IAP with StoreKit2. In app is everything finished and OK, so I've started an implementation of server side. I'm using App Store Server Notifications API. If user subscribe something everything looks fine and I receive a notification with signedPayload body https://developer.apple.com/documentation/appstoreservernotifications/signedpayload. Payload contains field like transactionId, originalTransactioId... but there is missing some information about user. I have to pair "subscribed" transactions with user to know what he bought, because I have also web version of iOS app so I need to pair stuff paid by IAP with web version. For example if I buy premium version of account by IAP, so I want premium version of account on the web.

Do you have any idea how to solve this problem?

Answered by App Store Commerce Engineer in 761867022

We recommend using the appAccountToken field to assist with providing an id to transactions. https://developer.apple.com/documentation/storekit/product/purchaseoption/3749440-appaccounttoken Additionally, because the initial purchase happens on a device, you will receive an original transaction id that you can send to your server. Ir will be consistent for that user moving forwards, allowing you to link new transactions sharing that original transaction id to the existing user.

Accepted Answer

We recommend using the appAccountToken field to assist with providing an id to transactions. https://developer.apple.com/documentation/storekit/product/purchaseoption/3749440-appaccounttoken Additionally, because the initial purchase happens on a device, you will receive an original transaction id that you can send to your server. Ir will be consistent for that user moving forwards, allowing you to link new transactions sharing that original transaction id to the existing user.

App Store API. Pair user with transactions
 
 
Q