I had a question regarding the uniqueness of purchase tokens. When using the SDK Tester, IAP purchases generate the same purchase token when purchasing the same item (ex. consumables). When an application is live to the public, is the combination of a user's IAP user_id and purchase token guaranteed to be unique? I plan on storing this combination to ensure that the same purchase is not rewarded more than once, but if it is not guaranteed then there will be obvious problems with this. Thank you in advance!
Hi Davespacey, The PurchaseToken is dynamically generated each time Receipt data is returned and is not a unique order identifier. The PurchaseToken of a Receipt returned in a PurchaseResponse will be different than the PurchaseToken of a Receipt for the same user and sku returned in a PurchaseUpdatesResponse. We do not recommend it for using it as a transaction identifier.
Thank you Sujoy for your quick response. If the purchase token cannot be used as a unique order identifier, do you have any other suggestions to prevent duplicate rewarding of consumable purchases? Entitlements and subscriptions are not too much of an issue as I can check internally if someone already owns the item.