Skip to main content

Gamification: reward.won

The reward.won webhook: the payload Digia sends when a user wins a reward.

Digia sends reward.won when a user wins a reward, such as a coupon, in-app currency or a perk. Use it to give the reward, for example to credit a wallet or issue a voucher.

Setup, headers and signature check are on Webhooks.

Payload​

{
"event": "reward.won",
"test": false,
"grant": {
"grantId": "665f1c2e9a1b2c3d4e5f6a7b",
"rewardId": "665f1a0b9a1b2c3d4e5f6a01",
"userId": "user-123",
"campaignId": "665f1b7c9a1b2c3d4e5f6a40",
"campaignKey": "diwali-spin",
"type": "coupon",
"referenceKey": "partner-100-off",
"value": { "amountMinor": 10000, "currency": "INR" },
"expiresAt": "2026-12-20T10:15:00.000Z",
"code": "SAVE100"
},
"occurredAt": "2026-11-20T10:15:00.000Z"
}
FieldMeaning
testtrue for a test play.
grant.grantIdThe ID of the win. Use it for the reward used callback.
grant.rewardIdThe ID of the reward.
grant.userIdThe user ID your app set with setUserId.
grant.campaignIdThe ID of the campaign.
grant.campaignKeyThe campaign's key.
grant.typecoupon, currency or perk.
grant.referenceKeyThe reward's reference key. Match your own reward or SKU to it.
grant.valueThe reward's value. amountMinor is in minor units (paise, cents). currency is an ISO 4217 code.
grant.expiresAtWhen the reward expires, or null.
occurredAtWhen the user won.

Each type adds one more field:

grant.typeField
couponcode: the coupon code.
currencyamount and unit, for example 50 and coins.
perkdisplayText: the text the user sees.

Test plays send the same webhook with test set to true. Check it before you give anything real.