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"
}
| Field | Meaning |
|---|---|
test | true for a test play. |
grant.grantId | The ID of the win. Use it for the reward used callback. |
grant.rewardId | The ID of the reward. |
grant.userId | The user ID your app set with setUserId. |
grant.campaignId | The ID of the campaign. |
grant.campaignKey | The campaign's key. |
grant.type | coupon, currency or perk. |
grant.referenceKey | The reward's reference key. Match your own reward or SKU to it. |
grant.value | The reward's value. amountMinor is in minor units (paise, cents). currency is an ISO 4217 code. |
grant.expiresAt | When the reward expires, or null. |
occurredAt | When the user won. |
Each type adds one more field:
grant.type | Field |
|---|---|
coupon | code: the coupon code. |
currency | amount and unit, for example 50 and coins. |
perk | displayText: the text the user sees. |
Test plays send the same webhook with test set to true. Check it before you give anything real.
Related
- Reward Used Callback: mark a reward as used.
- Reward Links: the
{{grantId}}and{{code}}placeholders.