Get players points balance

Allowing customers to view their points is an essential part of creating a top-notch redemption experience. By providing customers with easy access to their points balance, you can help them track their progress towards their desired rewards.

You can use the Player's points balance API to retrieve players current balance.

{
    "pointsBalance": 11500,
    "pointsValue": 115,
    "pendingPoints": 200,
    "pendingPointsValue": 2,
    "totalPositivePoints": 12500,
    "totalPositivePendingPoints": 135,
    "totalNegativePoints": 1000,
    "totalNegativePendingPoints": 20
    "currency": "USD",
    "pointsName": "Points"
}

use-case: validate player balance

You can use Player's points balance API to validate if the points the player tries to redeem is more than his pointsBalance or not.

var playerBalanceResponse = {
    "pointsBalance": 30,
    "pointsValue": 115,
    "pendingPoints": 200,
    "pendingPointsValue": 2,
    "totalPositivePoints": 230,
    "totalPositivePendingPoints": 135,
    "totalNegativePoints": 1000,
    "totalNegativePendingPoints": 20
    "currency": "USD",
    "pointsName": "Points"
}
var playerActualPoints = playerBalanceResponse["pointsBalance"]
var playerPointsToRedeem = 60 // points player tries to redeem 
if(playerPointsToRedeem >= playerActualPoints){
    //Display error to user that he can not redeem points he does not have
}

playerBalanceResponse variable is the response body after you call the API to display player's Player's points balance API and you check the pointsBalance against the number points choose to redeem in the UI.

Last updated