question

davespacey avatar image
davespacey asked

Uniqueness of Purchase Token

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!
iap
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
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.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

davespacey avatar image
davespacey answered
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.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.