question

andel kan avatar image
andel kan asked

cards game and redeem code

Hello i want to know if its possible to know who redeem the coupon code
if a player redeemed already that code he will get a message "u already redeemed this code"
and if he didnt but someone else already redeem it they the player will get "someone else already redeemed that code"
also another question can i make a player to unclaim that redeem code to let other players redeem it ?
(im trying to make card game with qr codes , that are coupons codes printed as qr codes.
so when a player redeem a code he will get an item and he can trade this item, with the coupon code.
as if the trade the coupon code itself with another user.
lets say i have a card item "sword" i want the player to scan it redeem the sword.
later on upgrade that sword ,and each time the user wants to use that item he must scan it
if he already scanned this code and the sword is in his inventory then he can use this sword.
so if he trade it with someone else i want the other player to be able to use the coupon code too
cuz its part of this item the coupon code and the item are always together.
(item instance id and the coupon code always together).

data
10 |1200

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

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

>> Hello i want to know if its possible to know who redeem the coupon code? if a player redeemed already that code he will get a message "u already redeemed this code" and if he didnt but someone else already redeem it they the player will get "someone else already redeemed that code".

RedeemCoupon API won’t divide the above two situations. If the coupon has been redeemed already, this API would only return the error “Coupon already redeemed.” If you want to record that who redeemed the coupon, you need to implement your own data warehouse. In PlayFab, the player's redemption record of the coupon will be recorded to the PlayStream Events. Every time when a player redeems the coupon, the event "player_redeemed_coupon" would be generated. You can use Webhooks to pass the event Json to your custom endpoint. Then you can retrieve the players who redeemed the coupon by querying the data you collected.

>> Also another question can i make a player to unclaim that redeem code to let other players redeem it?

PlayFab doesn’t provide such features to revoke the coupon. One coupon only can be redeemed one-time and can’t be revoked. If you want to implement such features, the workaround is to revoke the player A’s corresponding item, then generate a new coupon for the player B. You can write such custom functions on CloudScript.

10 |1200

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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