Allowing players to create coupons

Allowing customers to redeem points is a great way to promote points spending and boost engagement with your reward program. In the previous tutorial, we learned how to display players' points. However, for players to make use of these points, they should be able to redeem them to access the coupons and discounts created by redeeming his points.

In this tutorial, we will learn how to allow your players to redeem their points and in-exchange of these points, they can have discount coupons to use them at checkout. For example, if your player has accumulated 200 points over his purchasing journey at your system and want exchange his points to be redeemed, he will win a discount with monetary value of these points.

Make sure you did configure your coupon system settings to be able to create coupons successfully.

How to redeem players points with flat rate discount

The goal of this tutorial is to create a custom redemption page for your players to redeem their points from. By the end of this tutorial, you should have a similar UI page as the image above where your players can redeem their points from.

As a start, we will enable redemption using Flat rate redemption only in your redemption page, you can include other redemption options to reward your player with different types of rewards or prizes as we will see in the upcoming section.

Flat rate redemption is the default redemption type in Gameball, where you set in your dashboard an equivalent monetary value for every point your player wins. For example, If you set the point value in your dashboard to 1$ and your player has 30 points in his account, then your player can redeem his points and win a 30$ off coupon code.

To allow redemption with flat rate discount, you have to do the following steps :

  1. Create a page where the player can set the amount of points he would like to redeem, this typically would be redemption page.

To display player available points, and monetary value of available points, visit the previous tutorial.

  1. You should call CreateCoupon API to create discount with the monetary amount of the points to be redeemed.

For example, If one of your players visited your redemption page and decided to redeem 1000 of his points, which is equivalent to 100 USD, points and its monetary value is retrieved from Player's points balance, he will enter in number of points text field, the number of points he wants to redeem, and click on 'Redeem Now' button. In the backend you should calculate the monetary value of these point and pass it in the request body along with the attributes below:

{
    "value": 100,
    "playerUniqueId": "player@gmail.com"
}
  • value : The monetary value of the points your player tries to redeem.

  • playerUniqueId : The unique id of your player at Gameball.

This image shows an example of a UI that implements flat rate redemption. To display player available points and their monetary equivalent as the UI above you should call get point balance to display player available balance using pointsBalance and pointsValue in the request body attribute.

'Redeem Now' button in your UI should call CreateCoupon API in your system and pass the attributes in the request body as we explained earlier.

  1. Display generated discount coupon, after calling CreateCoupon API, you should display to your player his discount code.

After your player redeemed his 1000 points, typically, your system should display the discount code to your player a pop-up message as you will find below, so he can copy it and use it later at checkout page as we will see in the next tutorial.

{
    "code": "FreeShippingOFF"
    .....
}
  • code: Code attribute is the code of the coupon was created in exchange of the points the player redeemed.

How to redeem players points with other redemption options

There are other redemption options in Gameball, you can enable them to redeem your player's points with various rewards. For example, you can create a redemption option or rule for your players to redeem 600 of their points in exchange of a free shipping coupon or they can redeem 500 of his points for a free product(s)/item(s) in your system.

The other redemption options are custom rules should be created from your dashboard. The only redemption option created by default when joining Gameball is Flat rate which we discussed in the earlier section.

Various redemption options give the player, the freedom to choose how he redeems his points in exchange of different rewards or prizes. This freedom will lead to more points redemption and can increase engagement and loyalty among your player base.

Redeem points with free shipping coupon

One of these redemption options is free shipping, you can allow your players to exchange their points with free shipping discount code.

To redeem player points with free shipping, we will go through the same steps as Flat rate example but with one more additional step.

  1. Call Get RedemptionRules API in your rewards page section to display all your available redemption options.

One of your players visited your redemption page and want to check the available redemption options offered by your business, he can redeem his points with. In the backend call this API to fetch all your available redemption options and pass it to the frontend to render these options in your redemption page UI.

{
  "isRedemptionActive": true,
  "redemptionRules": [
      {
      "id": 1976,
      "valueOfPoint": 1,
      "ruleType": "general_settings",
      ...
      },
    {
      "id": 1977,
      "valueOfPoint": 0.0,
      "ruleType": "free_shipping",
    },
        ...
}

redemptionRules is json object that contains list of all your redemption options in your redemption page, it contains the following attributes about each redemption option :

  • id : Unique identifier for each redemption option, you will use it as a reference later on in step 2 using Create coupon API to identify which redemption rule your player choose.

  • valueOfPoint : The monetary value of one point, for example, if 1 point equals to 1$ then valueOfPoint is 1 USD.

valueOfPoint is only set in case of flat rate discount, whose ruleType isgeneral_settings.

  • ruleType : Type of each redemption rule.

The Id of each redemption option should be embedded in the html of your redemption page as hidden input, so when a player click redeem button in-front of a specific redemption option you can identify which option is selected.

<input type="hidden" name="ruleId" id="ruleId" value="{{redemptionRule.id}}"> 

Please note that id of each redemption option is an internal attribute and should not be displayed to your end-user.

To differentiate between various redemption option, you should use ruleType attribute to check for each rule type and based on its type you can display text or image that can describe each redemption option and its reward.

You can also display for your player the minimum points needed to redeem each option using pointsToRedeem attribute.

  1. If your player wants to redeem his points, you should call CreateCoupon API.

Your player selected one of the redemption option, in our example, he decided to redeem his points in exchange of free shipping option. In your backend, you should pass the following body to the CreateCoupon API.

{
    "value": ,
    "playerUniqueId": "player@gmail.com",
    "ruleId":1977
}
  1. The CreateCoupon call will create a new free shipping discount code, you should display this code to your player as a pop-message, so your player can use it during checkout as we will see in the next tutorial.

There are other redemption options you can create from your dashboard like :

nameruleType

Flat rate

general_settings

Free shipping discount

free_shipping_settings

Percentage discount

percentage_discount_settings

Free product discount

free_product_settings

Fixed rate discount

fixed_rate_settings

To know more about each discount type and its business use-cases visit our help center.

Last updated