Skip to content

Loan Stat

Loan Request Statistics API - GET REQUEST

Test API Endpoint

GET http://apitest.fedacash.com/api/salaryadvance/test/v1/combined-analytics

Live API Endpoint

GET http://api.fedacash.com/api/salaryadvance/test/v1/combined-analytics

Request Headers

  • Authorization: Bearer your_secret_key
  • Content-Type: application/json

Sample Curl(Deacivate Staff) Request Body

curl -X GET "http://apitest.fedacash.com/api/salaryadvance/test/v1/combined-analytics" \
-H "Authorization: Bearer <your_access_token>" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"page_size": 10,
"page_num": 1,
"sort_by": "id",
"sort_type": "DESC",
"search": ""
}'

Success Response

{
"success": true,
"message": "Combined analytics retrieved successfully",
"data": {
"totalLoanRequests": 150,
"totalPendingLoanRequests": 40,
"totalApprovedLoanRequests": 80,
"totalDeclinedLoanRequests": 20,
"totalDisbursedLoans": 70,
"totalDisbursedAmount": 350000,
"totalRepaidAmount": 300000,
"employeeCount": 50,
"totalPendingRepaymentAmount": 50000,
"repaymentBarChartTransactionData": [
{ "month": "2023-06", "total_amount": 25000, "total_count": 15 },
{ "month": "2023-07", "total_amount": 30000, "total_count": 20 },
{ "month": "2023-08", "total_amount": 28000, "total_count": 18 }
// Add more data points as needed
],
"disbursedBarChartTransactionData": [
{ "month": "2023-06", "total_amount": 20000, "total_count": 10 },
{ "month": "2023-07", "total_amount": 25000, "total_count": 12 },
{ "month": "2023-08", "total_amount": 23000, "total_count": 11 }
// Add more data points as needed
]
}
}

Error Response

{
"error": true,
"message": "Unauthorized"
}
{
"error": true,
"message": "A system error occurred. Kindly contact the Administrator",
"errors": "something went wrong."
}