Overview
This endpoint provides comprehensive credit system analysis including current balance, usage breakdown, billable users calculation, and credit consumption projections. Only accessible to parent accounts with the new credit-based pricing system.
API Details
Authentication
Try It Out
Test the API using your JWT token:
Code Examples
curl -X GET https://api.authiqa.com/parent/credit-analysis \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
{
"creditBalance" : 58000 ,
"totalFreeUsers" : 6000 ,
"totalChildAccounts" : 3500 ,
"billableUsers" : 0 ,
"monthlyRetentionCredits" : 0 ,
"operationUsage" : {
"childSignups" : 150 ,
"signIns" : 2500 ,
"emailVerifications" : 75 ,
"socialSignIns" : {
"google" : 800 ,
"github" : 200 ,
"x" : 100 ,
"facebook" : 50 ,
"total" : 1150
}
},
"totalCreditsUsed" : 4625 ,
"projectedMonthlyUsage" : 1200 ,
"alerts" : {
"low" : false ,
"critical" : false ,
"depleted" : false
},
"packageHistory" : [
{
"packageType" : "GROWTH" ,
"purchaseDate" : 1640995200000 ,
"creditsAdded" : 55000 ,
"freeUsersAdded" : 5000 ,
"price" : 50 ,
"transactionId" : "pi_xxx"
}
]
}
Credit Operations
{
"childSignup" : 5 ,
"signIn" : 1 ,
"emailVerification" : 2 ,
"googleAuth" : 3 ,
"githubAuth" : 3 ,
"xAuth" : 3 ,
"facebookAuth" : 3 ,
"userRetention" : 1
}
Package Structure
STARTER
Price : $10
Credits : 10,000
Free Users : 1,000
Bonus : 0%
GROWTH
Price : $50
Credits : 55,000 (10% bonus)
Free Users : 5,000
Bonus : 10%
SCALE
Price : $100
Credits : 120,000 (20% bonus)
Free Users : 15,000
Bonus : 20%
Response Fields
Current available credits
Cumulative free user quota from packages
Total number of child accounts
Users above free tier (totalChildAccounts - totalFreeUsers)
Monthly retention cost (billableUsers × 1)
Breakdown of credit-consuming operations
Total credits consumed this month
Estimated monthly credit consumption
Credit balance alert status
History of package purchases
Error Codes
No authorization token
Invalid token
Non-parent account access attempt
USER_NOT_FOUND - Parent account not found
500 Internal Server Error
Failed to calculate credit analysis
Database operation errors
Credit Alert Thresholds
Low Credits 20% remaining
Warning notification
Recommend package purchase
Critical Credits 10% remaining
Urgent warning
Service interruption imminent
Depleted Credits 0 credits
Child access blocked
Parent access maintained
Calculation Details
Billable Users
Calculate users above free tier: billableUsers = Math . max ( 0 , totalChildAccounts - totalFreeUsers )
Monthly Retention
Calculate monthly retention cost: monthlyRetentionCredits = billableUsers × 1
Operation Credits
Sum all operation credit usage: totalCreditsUsed = ( childSignups × 5 ) + ( signIns × 1 ) + ( emailVerifications × 2 ) + ( socialSignIns × 3 )
Notes
This endpoint provides real-time credit analysis and is free to use (does not consume credits).
This endpoint is restricted to parent accounts only. Child accounts will receive a 401 Unauthorized response.