Access
Connect cross-platform accounts & identity management
AccelByte Cloud’s Rewards service is an effective way to increase player retention and brand loyalty by granting players special items or other entitlements in recognition of their achievements. Players who are rewarded for their progress will be more likely to engage with your game more frequently in order to obtain as many rewards as possible. Rewards can be categorized into several different types including: items, new maps, badges, and more.
AccelByte Cloud’s Rewards service works by integrating with our Statistics (opens new window) and Achievements (opens new window) services to define the benchmarks players must clear to earn rewards, and with our Entitlements (opens new window) and Fulfillment (opens new window) services to grant players the rewards they’ve earned.
Make sure you have already created the statistic (opens new window) or achievement (opens new window) you want to trigger the reward.
Permissions (opens new window) are used to grant access to specific resources within our services. Make sure your account has the following permissions before you attempt to manage rewards in the Admin Portal. For a full list of permissions that impact achievements management, see the Social tab of the permissions reference (opens new window).
Usage | Permission Tag | Action |
---|---|---|
Create a Reward | ADMIN:NAMESPACE:{namespace}:REWARD | Create |
Get a Reward | ADMIN:NAMESPACE:{namespace}:REWARD | Read |
Import Reward Configurations | ADMIN:NAMESPACE:{namespace}:REWARD | Create |
Export Reward Configurations | ADMIN:NAMESPACE:{namespace}:REWARD | Read |
Permissions work slightly differently depending on whether they are assigned to IAM Clients (opens new window) or to Roles (opens new window) which are assigned to users. For more information, see the Authentication and Authorization (opens new window) documentation.
In the publisher namespace of the Admin Portal, go to the E-Commerce section and open the Rewards menu.
On the Rewards page, click the Add Configuration button.
The Add Rewards form will appear, as shown below. Fill in the fields with the required information:
Enter a unique identifier for your reward in the Reward Code field. This code must follow the formatting rules provided.
Enter a description of the reward in the Description field.
Select the trigger for the reward from the Event Topic dropdown menu. You can choose either Statistic, Achievement, or User Account.
NOTE
Choose Statistic if you want your reward to be granted to players that achieve a certain statistic. For example, you could create a statistic to measure consecutive days logged in and use it to reward players for logging into your game for 7 days in a row.
Choose Achievement if you want the reward to be granted to a player when they earn a particular achievement.
Choose User Account if you want the reward to be granted to players after they make an account in your platform, using either their email address or an account from a 3rd party platform such as Steam.
Advanced Settings
Enter the specific condition that indicates the target User ID in the event payload in the UserID Expression field, using the JSON path format. This field is optional. If left blank, the default value is $.[0].userId. Format:
$.eventPayloadObject.userId
Enter the specific condition that indicates the target User ID in the event payload in the Namespace Expression field, using the JSON path format. This field is optional. If left blank, the default value is $.[0].namespace. Format:
$.eventPayloadObject.namespace
Enter the maximum number of times the reward can be earned in your game namespace in the Max Awarded field.
Enter the maximum number of times the reward can be earned by a single player in the Max Awarded Per User field.
Once you have completed the fields, click Add. Your new reward will be added to the Rewards list.
On the Rewards page of the Admin Portal, find the reward you wish to change and click View in the reward’s Action column.
Click Add Reward Condition.
The Add Reward Condition form will appear. Fill in the fields with the required information:
Event Topic | Event Name | Usage |
Statistics | statItemCreated | Use this event name if you want players to receive the reward upon creating a particular statistical value. |
Statistics | statItemUpdated | Use this event name if you want players to receive the reward upon reaching a particular statistical value. |
Achievement | userAchievementUnlocked | Use this event name if you want players to receive the reward upon earning a particular achievement. |
User Account | userAccountCreated | Use this event name if you want players to receive the reward upon creating an account in your platform, using the publisher namespace. |
User Account | gameUserAccountCreated | Use this event name if you want players to receive the reward upon creating an account in your platform, using the game namespace. |
User Account | userAccountVerified | Use this event name if you want players to receive the reward when their account is verified in your platform, using the game namespace |
User Account | userAccountLinked | Use this event name if you want players to receive the reward upon creating an account in your platform, using the game namespace |
User Account | userAccountUpgraded | Use this event name if you want players to receive the reward upon upgraing their account from a headless account to full account, using the game namespace |
User Account | thirdPartyAccountCreated | Use this event name if you want players to receive the reward upon creating an account on your platform from a third party platform. Both userAccountCreated and thirdPartyAccountCreated are contained within the User Account event topic. |
Enter a name for the specific event condition that triggers the reward in the Condition Name field.
Enter the specific condition that triggers the reward in JSON path format in the Condition field. The format for each event topic is given below.
Event Topic: Statistics To grant players the reward for reaching a certain statistic, use this JSON path format:
$.[?(@.statCode == "input-your-stat-code" && @.latestValue == x)]
In this example, the player will receive the reward once they reach 30 points in the serverstat3 statistic:
$.[?(@.statCode == "serverstat3" && @.latestValue == 30)]
Event Topic: Achievements To grant players the reward for earning a certain achievement, use this JSON path format:
$.[?(@.status == 2 && @.achievementCode == "input-your-achievement code")]
In this example, the player will receive the reward when they receive the achievement for killing 10 enemies:
$.[?(@.status == 2 && @.achievementCode == "kill-enemies-achievement")]
Event Topic: User Account To grant players the reward for creating an account in your platform, use this JSON path format:
$.[?(@.userId != null && @.emailAddress != null)]
Event Topic: User Account, 3rd-Party Login To grant players the reward upon creating an account on your platform from a 3rd-party platform such as Steam or Xbox, use this JSON path format:
$.[?(@.userId != null)]
Fill in the Reward Item fields with the required information:
When you’re done adding items, click Save. The new reward condition will be added to the list.
In the Rewards menu of the Admin Portal, open the dropdown menu next to the Add Configuration button and click Export Configuration.
The download will begin. Once it has finished, you can open the JSON file to see a list of your reward configurations.
In the Rewards menu of the Admin Portal, open the dropdown menu next to the Add Configuration button and click Import Configuration.
The Import Configuration form will appear. Fill in the fields with the required information:
Once completed, click Import. Confirm the import configuration by typing IMPORT into the pop-up form that appears and then click Import once more to confirm.
When the Rewards service successfully fulfills an item to a player, the game client will receive a notification through the Lobby service. The topic of the message sent to the game client is e-commerce/reward. You can retrieve notifications from the game by setting the delegate SetMessageNotifDelegate. This allows the player to see any missed notifications. The payload of the function below will be in JSON format.
You can retrieve information about a reward granted to a player by using the following function. This function uses the reward code to find the reward information.
You can retrieve information about a reward granted to a player by using the following function. This function uses the reward ID to find the reward information.
You can retrieve all rewards with a particular event topic, either Achievement, Statistic, or User Account. You can also sort the displayed data. For Unity, define your sorting method in the RewardSortBy field. For Unreal Engine, define your sorting method in the EAccelByteRewardListSortBy field. The possible sorting methods are:
Sort | Usage |
---|---|
NONE | This option uses the default sorting, which is to sort by namespace and then reward code in ascending order. |
NAMESPACE_ASC | Sort by namespace in ascending order. |
NAMESPACE_DESC | Sort by namespace in descending order. |
REWARDCODE_ASC | Sort by reward code in ascending order. |
REWARDCODE_DESC | Sort by reward code in descending order. |