Show Customer Points Balance

In some scenarios, you may need to show the customer's points balance to your users with your experience. This will help them know their current points balance and its equivalent monetary value so that they are motivated to earn and collect more.

Generally the customer's point balance can be retrieved either by Customer Balance API or Customer Progress API. In this tutorial we will be discussing Customer Balance API.

Customer Balance API is a GET request that takes the playerUniqueId in its path as below

https://api.gameball.co/api/v3.0/integrations/player/{playerUnqiueId}/balance

The API is comprehensive and returns a full view of the current customer balance status. It return the the total points currently in the customer's balance in pointsBalance attribute and its monetary value in pointsValue attribute.

In case you have configure a return window for cashback pending points are also shown within the response in pendingPoints attribute and pendingPointsValue respectively.

{
    "pointsBalance": 11500,
    "pointsValue": 115,
    "pendingPoints": 200,
    "pendingPointsValue": 2,
    "currency": "USD",
    "pointsName": "Points"
}

The points that are available to use can be derived by

Total Points - Pending Points = Points available to be used

In addition to points balance information. The API returns the selected system currency and the configured name for points to easily rendered them in the UI element.

Last updated