Match user in my database with the User from a Server Notification

I just implemented server notifications for my app and I'm getting the response, but I don't know how can I match the data in the notification with one of my users in my database.

To relate notifications to users, you can store the original transaction IDs of users' purchases with their database entries. When you receive a server notification, you can then check the original_transaction_id in the unified_receipt and match it to that user.

https://developer.apple.com/documentation/appstorereceipts/original_transaction_id https://developer.apple.com/documentation/appstoreservernotifications/unified_receipt

Many of the new StoreKit 2 and Support-related server APIs coming this year also require you to provide an original transaction ID in the request. Storing it will ensure you can easily adopt these new APIs as they are released.

https://developer.apple.com/videos/play/wwdc2021/10174

https://developer.apple.com/videos/play/wwdc2021/10175

What about appAccountToken()? You can set token app account token in a app with your token containg user data. Then App Store Server will send you this token in transaction payload from notification. https://developer.apple.com/documentation/storekit/product/purchaseoption/3749440-appaccounttoken

Match user in my database with the User from a Server Notification
 
 
Q