URL: collection_agent_fetch.php?line=main line
Method: GET
Headers: Authorization: Bearer [JWT_TOKEN]
Description: Fetches collection agents, line entries, and loan entries for a specific line with today's due date.
URL: collection_agent_auth.php?fetch_agent_data=1&line=main line
Method: GET
Headers: Authorization: Bearer [JWT_TOKEN]
Description: Same functionality but integrated into the existing routes system.
{
"status": "success",
"data": {
"agents": [
{
"id": "1",
"name": "baby",
"mobile_no": "7675675652",
"address": "komarapalayam",
"aadhar_no": "4850394580594",
"report_in": "2025-09-25 15:15:55",
"reporting_time": "2025-09-25 15:15:55",
"status": "active",
"line": "main area"
}
],
"line_entries": [
{
"id": "1",
"com_id": "9",
"area": "erode",
"line": "main line",
"created_on": "0000-00-00 00:00:00"
},
{
"id": "2",
"com_id": "9",
"area": "salem",
"line": "main line",
"created_on": "0000-00-00 00:00:00"
}
],
"loan_entries": [
{
"id": "5",
"loan_id": "DL2025002",
"com_id": "9",
"cus_name": "Raja",
"cust_mobile": "1234567890",
"area": "salem",
"loan_type": "Daily",
"loan_amt": "10000",
"next_due_date": "2025-09-23",
"per_due_amt": "167"
}
],
"query_info": {
"company_id": "9",
"line": "main line",
"today": "2025-09-23",
"areas_found": [
"erode",
"salem"
],
"total_agents": 1,
"total_line_entries": 2,
"total_loan_entries": 1
}
}
}curl -X GET 'http://your-domain.com/collection_agent_fetch.php?line=main%20line' \ -H 'Authorization: Bearer YOUR_JWT_TOKEN' \ -H 'Content-Type: application/json'
curl -X GET 'http://your-domain.com/collection_agent_auth.php?fetch_agent_data=1&line=main%20line' \ -H 'Authorization: Bearer YOUR_JWT_TOKEN' \ -H 'Content-Type: application/json'
The API performs the following queries:
SELECT * FROM collection_agent WHERE com_id = ? AND line = ?SELECT * FROM line_entry WHERE com_id = ? AND line = ?SELECT * FROM loan_entry WHERE com_id = ? AND area IN (areas) AND next_due_date = today