Last Updated: 9/6/2021, 8:19:04 AM

# Code Redemptions

# Overview

You can create code redemption where you distribute promotional codes that unlock items or other entitlements to your players. Codes can be redeemed in the Player Portal, Launcher, and in the game itself.

When you create a code redemption, you can choose how many codes to create, how many times each code can be redeemed, and how many times each player can redeem a code. After the code redemption has been launched, you can access the code redemption history in the Admin Portal.

Codes generated by 3rd party platforms such as Steam can also be listed for sale in your catalog.

# Prerequisites and Permissions

# Prerequisites

# Create a Code Redemption

You can create a Code Redemption in Admin Portal or use our Swagger. But, before creating a code redemption, make sure you are authorized and have registered your clients

# Permissions

Permissions are used to grant access to specific resources within our services. Make sure your account has the following permissions before you attempt to manage code redemptions in the Admin Portal. For a full list of permissions that impact code redemptions management, see the Platform/Commerce tab of the permissions reference

Usage Permission Tag Action
Create a Code Redemption ADMIN:NAMESPACE:{namespace}:CAMPAIGN Create
Add Item to a Code Redemption ADMIN:NAMESPACE:{namespace}:CAMPAIGN Update
Create a Code ADMIN:NAMESPACE:{namespace}:CAMPAIGN Create
Download Codes ADMIN:NAMESPACE:{namespace}:CAMPAIGN Read
Get Redeemed Code History ADMIN:NAMESPACE:{namespace}:CAMPAIGN Read

Permissions work slightly differently depending on whether they are assigned to IAM Clients or Roles assigned to users. For more information, read the Authentication and Authorization documentation.

# Managing Code Redemption in the Admin Portal

The Admin Portal gives community managers and game admins an easy way to manage code redemptions.

# Create a Code Redemption

  1. In the Admin Portal, choose Publisher Namespace.

campaign-management

  1. Go to the E-Commerce section and open the Code Redemption menu.

campaign-management

  1. In the Code Redemption menu, click the Add Code Redemption button to create a new code redemption.

campaign-management

  1. The Add Code Redemption form will appear. Here, fill all the fields with the following information as a reference.

campaign-management

  • Input the Code Redemption Name.
  • Select the Status of your code redemption.
  • Input the number of redemption for each code in the Max redeems per code field.
  • Input the number of redemptions for each Player in the Max redeems per user.
  • Choose the Redeem Type. The available Redemption type is Item.
  1. Once the code redemption is added, the next thing you have to do is to add items that will be redeemed by the player.

# Add Item to a Code Redemption

  1. In your code redemption, go to Basic Information & Items tab, and in the Items section, click the Add Item button to add an item into your code redemption.

campaign-management

  1. A modal will pop up and you need to choose the Item ID of the item you want to add from the dropdown menu. After clicking on the selected item, click Add to add the item into a code redemption.

campaign-management

  1. Once added, the item will appear in the item list.

campaign-management

# Create a Code

  1. In your code redemption, switch to the Codes tab and click the Add Codes button to add code to your code redemption.

campaign-management

  1. Input the Quantity of the code that you want to create and click Add to add the amount of code.

campaign-management

  1. Once your code is added, you can choose the Status of the code. If Enable is selected, the code can be redeemed by players, if it is Disable, the code will not be available for redeeming. For example, if you are going to start the code redemption, you need to Enable the status and when the code redemption is over, you can Disable the code.

campaign-management

# Download Codes

  1. In the Code Redemption sidebar menu, go to the Codes section and click Download Codes. Then, the download process will start immediately.

campaign-management

  1. After the download is complete, you can open the file and see the code list you have created. Here, the file will be in .csv format.

campaign-management

# Get Redeemed Code History

  1. In your Code Redemption, switch to the Redeem History tab, and you'll see the list of the redeem history. You can search the history by User ID to see the redeem history for a user or, you can search by Code to get the history based on the code.

campaign-management

# Managing Code Redemption using API

You can also use our API endpoints to manage code redemptions.

# Create a Code Redemption

  1. Use the Create Campaign: POST /admin/namespaces/{namespace}/campaigns endpoint.
  2. Input the Publisher Namespace.
  3. Fill out the Request Body.
  • Input the code redemption Type. The available type is Redemption.
  • Input the code redemption Name. For example, if you want to create a free coin redemption, you can input Free Coin May. This name will be visible to Players in the Player Portal and Launcher to show that in May there will be a free coin redemption.
  • Input the Description of the code redemption.
  • Input the Tags with contextual information about the code redemption.
  • Select the Status of the code redemption. Choose Active to make the code redemption active so players can participate and Inactive to deactivate the code redemption.
  • Input how many times each code can be redeemed in the maxRedeemCountPerCode field.
  • Input how many times each player can redeem a code in the maxRedeemCountPerCodePerUser field.
  • Input how many times each player will be able to redeem a code in the maxRedeemCountPerCampaignPerUser field.
  • Input the maxSaleCount to define how many codes can be sold in the store. For example, if you set 1000 and the code is already sold 1000 then the user can't purchase any more code.
  • Input the Redemption Type you want to create in the code redemption. The available redemption type is Item.

Fill in the information about the Items below.

  • Input the Item ID.
  • Input the Item Name.
  • Input the Quantity of the items you want to set in the code redemption.

Upon successful request, the campaign will be created. Here is an example of a response to a successful request:

# Add Item to a Code Redemption

  1. Use the Update Campaign: PUT /admin/namespaces/{namespace}/campaigns/{campaignId} endpoint.
  2. Input the Namespace with the Publisher Namespace.
  3. Input the Campaign ID. The campaign ID is automatically created when you create a campaign.
  4. Fill out the Item section in the Request Body.
  • Input the Item ID.
  • Input the Item Name.
  • Input the Quantity of the Item.

Upon successful request, the campaign will be created. Here is an example of a response to a successful request:

# Create a Code

  1. Use the Create Campaign Codes: POST /admin/namespaces/{namespace}/codes/campaigns/{campaignId} endpoint.
  2. Input the Namespace with the Publisher Namespace.
  3. Input the Campaign ID. The campaign ID is automatically created when you create a campaign.
  4. Fill out the Request Body.
  • Input the Quantity of the code, define how many code you want to generate in a Campaign.

Upon successful request, the campaign will be created. Here is an example of a response to a successful request:

# Download Codes

  1. Use the Download Codes: GET /admin/namespaces/{namespace}/codes/campaigns/{campaignId}/codes.csv endpoint.
  2. Input the Namespace.
  3. Input the Campaign ID.
  4. Input the Batch of the Campaign in the batchNo field. This field is optional.

Upon successful request, the campaign will be created. A successful request returns Code 200 OK and the downloaded codes, which indicates that the request was successful.

# Get Redeemed Code History

  1. Use the Query Redeem History: GET /admin/namespaces/{namespace}/codes/campaigns/{campaignId}/history endpoint.
  2. Input the Namespace with the Publisher Namespace.
  3. Input the Campaign ID, e.g. 63a635938ffc4560b5b23731150414a6.

These following fields are optional.

  1. Input the User ID if you want to get a list of Redeemed Code History of a specific Player.
  2. Input the Code if you want to get a record of Code Redeemed by Players.

You can fill it in if you want to display pagination.

  1. Input the Offset if you want to skip numbers of data before showing the records.
  2. Input the Limit of the displayed data.
  3. After a successful request, you can see the redeemed history.

Upon successful request, the campaign will be created. Here is an example of a response to a successful request: