Get Student Wallet Details
Returns a user's wallet (EdCredits) balance, referral code and credit history: credits earned from referrals and other activities, and credits spent on purchases.
GET
/users/edcreditsGet Student Wallet Details
curl --request GET \
--url 'https://<your-api-host>/nuSource/api/v1/users/edcredits?user_id=49531' \
--header 'APIKEY: <your-api-key>' \
--header 'ORGID: <your-org-id>'{
"code": 200,
"message": "Success",
"history": [
{
"id": 74930,
"user_id": 92443490,
"create_date": 1759840187,
"transaction_type": 1,
"transaction_id": 72951,
"credits_changed": 500,
"credits_before": 500,
"credits_after": 1000,
"work_type": 74,
"purchase_type": null,
"label": "Friend Joined",
"referee_id": 92443846,
"referee_name": "Lakshit Bagrecha",
"referrer_id": -1,
"referrer_name": ""
},
{
"id": 74921,
"user_id": 92443490,
"create_date": 1759835999,
"transaction_type": 1,
"transaction_id": 72942,
"credits_changed": 500,
"credits_before": 0,
"credits_after": 500,
"work_type": 6,
"purchase_type": null,
"label": "Sign Up",
"referee_id": -1,
"referee_name": "",
"referrer_id": -1,
"referrer_name": ""
}
],
"credits": 1000,
"referral_code": "mqu2wXgS"
}Access: Any signed-in user for their own wallet. Admins and custom roles can pass user_id to see a learner's wallet.
Query parameters
user_idinteger
Whose wallet to show. Only used when an admin or custom role calls it; must be a user of your organization. Everyone else always gets their own.
Response
codeinteger
Example:
200messagestring
Example:
Successhistoryobject[]
Show child attributesHide child attributes
history.idinteger
Example:
74930history.user_idinteger
Example:
92443490history.transaction_typeinteger
1 earned through an activity, 2 used in a payment, 3 purchaseExample:
1history.transaction_idinteger
Example:
72951history.credits_changedinteger
Example:
500history.credits_beforeinteger
Example:
500history.credits_afterinteger
Example:
1000history.work_typeinteger
Example:
74What the credits were for
history.referee_idinteger
Example:
92443846history.referrer_idinteger
Example:
-1history.referrer_namestring
Who referred this user;
-1 and empty when noneNotes: Error "User not found in organization." when user_id isn't in your organization. Rate limit: 30 requests per minute; going over locks you out for 30 minutes.