HomeSaaS Referral Program GuideAPIsGet User Balance

Get User Balance

This API Call shall enable you to pull up earnings data for any user


Gets you the individual balance/earnings data for any User – Referrer/Friend

This API call shall help you obtain the complete earnings data of a user at any point in time. It is an important call when thinking from the perspective of personalizing the user experience in the app.

The call shall return individual detailed earnings data, i.e. it will list out rewards pooled together per campaign per growth hack, available to the user. Hence the rewards across multiple growth hacks shall reflect as multiple nested records in the response payload.

 Base URL  https://api.appvirality.com

 POST        /saas/v1_0/getuserbalance

Content-Type application/json


Input i.e. Request

{
"apikey":"7ffdda00fd5c4338a9c1a44e00663648",
"privatekey":"d1e881dc60fa4856be34a44f00d96c9a",
"userkey":"176502556c624614b913a62400ab4d7e",
"email":"user@mail.com",
"useraccountid":"34",
"campaignid":"1234",
"growthhack": "SaaS_Referrals"
}
Input Params
Input Params Description
apikey API Key of the Product
Get it from Dashboard >> App Details
privatekey Private key for API requests
Get it from: Dashboard >> App Details >> Click App Settings >> Advanced 
userkey User Key of the Product user, assigned by AppVirality – a unique identifier for every Product user recorded
email
 (optional)
Email of the user
useraccountid
 (optional)
ID of the user in your Account(helps to identify users on dashboard as you do in your product)
campaignid Unique ID of a campaign
growthHack
(optional)
Type of Growth Hack (helps you filter rewards) 
values: SaaS_Referrals

Response

{
  "userbalance": [
    {
      "rewardunit": "% Discount",
      "total": 60,     // Total earnings of user
      "claimed": 50,   // Amount marked rewarded to the user
      "pending": 10,  // Yet to be rewarded
      "approved": 0,  // Available to redeem
      "growthhacks": [
        {
          "growthhack": "SaaS_Referrals",  // growth hack name
          "rewardunit": "% Discount",
          "total": 60,  // Total earnings of user - for this growth hack
          "claimed": 50,  // Amount marked rewarded to the user - for this growth hack
          "pending": 10,  // Yet to be rewarded - for this growth hack
          "approved": 0,  // Available to redeem - for this growth hack
          "campaigns": [
            {
              "campaignid": 1234,
              "campaignname": "SaaS Referrals",
              "growthhack": "SaaS_Referrals",
              "rewardunit": "% Discount",
              "total": 60,  // Total earnings of user - for this campaign
              "claimed": 50,  // Amount marked rewarded to the user - for this campaign
              "pending": 10  // Yet to be rewarded - for this campaign
              "approved": 0,  // Available to redeem - for this campaign
            }
          ]
        }
      ]
    }
  ],
  "success": true,
  "message": null
}


NOTE

~ preceding a parameter e.g. ~ rewardunit, implies the param is a nested/subset of the most recent non-tilde param, i.e. in this case rewardunit is a sub/nested param under userpoints

Response Params
Output Params Description
success Response status
message Information regarding API call (if relevant)
userbalance Reward detail
~ total Total Earnings of the user
~ claimed Amount marked as rewarded
~ pending Amount yet to be rewarded
~ approved Amount available to redeem
~ growthhacks Collection of Rewards detail – per Growth Hack basis
~ campaigns Collection of Rewards detail – per Campaign basis
~ campaignId Unique ID of a campaign, generated by AppVirality
~ campaignname Campaign Name, given in AppVirality dashboard
~ rewardunit Reward Unit
Was this article helpful to you? Yes No