Skip to main content

Rewards

The Rewards API provides tools to manage and interact with game rewards efficiently.

Lifecycle

Key Features

Listing Rewards

const { rewards, cursor } = await rewardService.list({
gameId: 'GAME',
userId,
from: Timestamp.fromDate(new Date('01-01-2024')),
to: Timestamp.fromDate(new Date()),
cursor: prevCursor,
limit: 1000
});

Webhooks Integration

  • Reward data is automatically sent via webhooks, keeping your system updated in real time.

After processing rewards on your side:

await rewardService.accept({
rewardId: reward.id
});
  • Decline Rewards: Use RewardService#Decline if the reward cannot be applied due to errors or other reasons.
    • Please discuss the issue with us to resolve any problems.
await rewardService.decline({
rewardId: reward.id,
reason: "Any reason"
});
await rewardService.claim({
rewardId: reward.id
});