HomeAppVirality DocsAppVirality APIsRedeem Rewards

Redeem Rewards

This API call allows you to redeem or cash out the rewards for a particular user, allowing batch processing of rewards or to process by gross amount of rewards


Note

This service call helps to redeem the rewards of user in “In-store Credits” case i.e. Wallet is configured as the type of rewards. No need to call this method if the reward type is Coupons and coupon distribution methods are “By the order  I choose “or  “By the event I choose” since AppVirality will be distributing the coupons automatically .

In case of Coupons distribution method “User will Choose” ,this API helps to redeem the rewards of user.

 

This is the API call that you shall employ to credit balances into an influencer’s wallet or in-app credit pool. It is very well understood that a user can earn multiple rewards thanks to the fact that he can share the app to a big set of his acquaintances. For every conversion he would be eligible for a reward.

If you’d have some custom algorithm to initiate the transfer of rewards to the user’s account, just make this API call immediately after the algorithm finishes from your side.

NOTE
Rewards redemption can be achieved in 3 ways:

  • By Reward IDs declared
  • By Amount
  • By Coupon Pool allocation

Base URL  https://api.appvirality.com

 POST         /v2_0/redeemrewards

Content-Type application/json


Input i.e. Request

{
"apikey":"7b808b1f969048db8463a4c60091c49b",
"privatekey":"09726325ed71465191eda4ec006d601b",
"userKey":"",
"Emailid":"suryare1@gmail.com",
"UserIdInstore": "",
"poolId":"",
"rewarddtlids":[],
"amount":"20",
"campaignId":"2376",
"growthHack":"Word_of_Mouth"
}

Below sample inputs would be guides to how you can redeem rewards for a user, in all three methods mentioned above.
Note that the below methods are listed in decreasing order of preference, as treated by the AppVirality preference.

Input Params
Input Params Description
apikey API Key of the App 
Get it from Dashboard >> App Details
privatekey Private key for API requests 
Get it from: Dashboard >> App Details >> Click App Settings >> Scroll down to Advanced Settings
userkey
(conditional)
User Key of the App user, assigned by AppVirality – a unique identifier for every App User recorded
EmailId
(conditional)
Email of the User, updated to AppVirality
UserIdInstore
(conditional)
Store Id of the App user, updated to AppVirality – a unique identifier of the user in your App
Poolid Id of the coupon pool added in the reward configuration
rewarddtlids List of Unique Ids which you will get for each reward in webhooks
Amount Value of reward you want to redeem
campaignId
(optional)
Unique ID of a campaign (helps you filter rewards)
growthHack
(optional)
Type of Growth Hack (helps you filter rewards)
values: Word_of_Mouth or Loyalty_Program
conditional – One of the conditional parameters is mandatory to identify the user. Priority for user identification is userkey, UserIdInstore and EmailId


BY REWARD DETAIL IDS

You may redeem a large set of Rewards for a user, in the below mentioned manner.
This is applicable for the Wallet or InStore Credits scenario of coupon distribution.

{
"apikey":"50524c1812904217a638a41d00cfbe94",
"privatekey":"5392d14323884ea3aeb3a4d200b4238d",
"userKey":"176502556c624614b913a62400ab4d7e",
"EmailId": "",
"UserIdInstore": "",
// Declared Reward detail IDs would be redeemed for the User mentioned
"rewarddtlids":[
              "1110",
              "375",
              "668"
          ]
}

BY AMOUNT

This will redeem the stated amount of credits to the user mentioned, in his Wallet or InStore Credit.
As you may understand this would not work when the coupon distribution is set up for Coupons.

{
"apikey":"50524c1812904217a638a41d00cfbe94",
"privatekey":"5392d14323884ea3aeb3a4d200b4238d",
"userKey":"176502556c624614b913a62400ab4d7e",
"EmailId": "",
"UserIdInstore": "",
// declared amount would be updated to the Wallet of the user
"amount":"200",
"growthhack":"Word_of_Mouth",
"campaignID":"160"
}
Importance of ‘GrowthHack’ & ‘CampaignID’

GrowthHack notifies the system to redeem the credits of the user towards the mentioned GrowthHack type, i.e. Loyalty_Program or Referral (Word_of_Mouth in SDK terminology). In case you have missed adding the same, the credits would still be redeemed regardless of whatever growth hack it might be.

Similar to above, mentioning the CampaignID enables the system to lodge the earnings against a particular campaign. Failing to do this will simply redeem the rewards irrespective of campaign.

 

BY COUPON POOL

This method would disburse one unit of a coupon from a Coupon Pool, as declared in your input – to the user. This is applicable to only those campaigns wherein, the Coupon Distribution method is set to ‘User will choose

This would require you to send across the Pool ID from which the coupon is to be picked.

{
"apikey":"50524c1812904217a638a41d00cfbe94",
"privatekey":"5392d14323884ea3aeb3a4d200b4238d",
"userKey":"176502556c624614b913a62400ab4d7e",
"EmailId": "",
"UserIdInstore": "",
"poolId":"531"         // One Coupon shall be delivered to user from said Coupon Pool
}

Response

{
"success":true,
 "statuscode": 1,
  "message": success
}
Response Params
Output Params Description
success Response status
message Information regarding API call (if relevant)
status code code based on status of the API call

Status codes which you will see while using Redeem Rewards API

Status codes and description for API responses
Status Code Description
0 No data found for the search criteria
1 Success
2 Invalid User Key
3 Invalid GrowthHack
5 Invalid StoreID or EmailID
30 Invalid PoolID
43 No rewards for the user
49 There are no coupons in the coupon pool
57 Reward already redeemed
69 User is not Eligible to Participate in Campaign
Was this article helpful to you? Yes No