NAV
Credgenics Documentation
shell python javascript

Getting Started

Welcome to Credgenics API Documentation. This document will provide instructions on how to quickly integrate Credgenics APIs. Credgenics APIs are based on REST standards. In order to interact with our API, any HTTP client in any programming language can be used.

Authentication

All the API requests to Credgenics are authenticated via an authentication token.

You can request Credgenics for an authentication token. You need to replace {auth_token} in every request with the authentication token that you get from Credgenics.

Base URLs

For Production: https://apiprod.credgenics.com/recovery

For Testing: https://apiuat.credgenics.com/recovery

Lending APIs

Get Loan API

import requests

url = "{BASE_URL}/loan/{loan_id}?fields={fields}"

payload = {}
headers = {
  'authenticationtoken': '{auth_token}'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request GET '{BASE_URL}/loan/{loan_id}?fields={fields}' \
--header 'authenticationtoken: {auth_token}'
var myHeaders = new Headers();
myHeaders.append("authenticationtoken", "{auth_token}");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("{BASE_URL}/loan/{loan_id}?fields={fields}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The above command returns JSON structured like this:

{
  "loan_details": {
    "loan_id": "2954",
    "loan_type": "Business Loan",
    "product_type": "Arbitration",
    "applicant_name": "Keval Gor",
    "applicant_contact_number": "9706367068",
    "applicant_email": "",
    "applicant_gender": "Male",
    "business_name": "Sathiya Collection",
    "emi_amount": null,
    "loan_tenure": null,
    "applicant_language": "",
    "applicant_occupation": "",
    "applicant_pan_number": "",
    "applicant_cibil_score": null,
    "applicant_dob": null,
    "payment_link": "",
    "client_loan_sanction_date": "2018-02-22",
    "loan_end_date": null,
    "interest_on_loan": null,
    "merchant_name": "",
    "security_type": "",
    "total_loan_amount": 268500,
    "loan_nbfc_name": "HLPL",
    "loan_nbfc_cin": "",
    "tenure_finished": true,
    "backed_by_surety": false,
    "credit_bank_name": "",
    "applicant_address": [
      {
        "applicant_address_type": "Home",
        "applicant_address_text": "Shopno4, Sarpat Gate Bhuj, Bhuj, Gujarat, 370001",
        "applicant_city": "Bhuj",
        "applicant_state": "Gujarat",
        "applicant_landmark": "",
        "applicant_pincode": 370001
      }
    ],
    "defaults": [
      {
        "created": "2020-08-14 14:29:02.660409",
        "late_fee": null,
        "expected_emi": 127718,
        "other_penalty": null,
        "recovery_date": "2020-09-12 00:59:51.418571",
        "payment_method": "Online",
        "date_of_default": "2020-07-05",
        "dpd": "225",
        "dpd_bracket": "180+",
        "tags": [
          {
            "tag_name": "temporary",
            "active": true,
            "created": "2021-07-21 07:50:41"
          }
        ],
        "recovery_method": "",
        "allocation_month": "2020-8-01",
        "amount_recovered": 8500,
        "settlement_amount": 25000,
        "default_emi_number": null,
        "total_claim_amount": 127718,
        "allocation_dpd_value": 91,
        "actual_date_of_default": "2020-05-15",
        "allocation_dpd_bracket": "91-120",
        "client_amount_recovered": null,
        "expected_emi_interest_amount": null,
        "principal_outstanding_amount": null,
        "expected_emi_principal_amount": null,
        "calling_status": "Initiated",
        "fos_status": "Initiated",
        "recovery_status": "Fully Recovered"
      }
    ],
    "global_status": "Closed",
    "legal_status": "Initiated",
    "settlement_status": "Initiated",
    "document_details": [],
    "references": [
      {
        "relation_with_applicant": "Colleague",
        "name": "Abhishek Kumar",
        "contact_number": "8802913432"
    }
    ],
    "co_applicant": [
      {
        "co_applicant_name": "Naveen Shekhawat",
        "co_applicant_type": "Individual",
        "co_applicant_email": "pravinsingh@gmail.com",
        "co_applicant_gender": "Male",
        "co_applicant_contact_number": "9814274470",
        "co_applicant_dob": "1990-06-29",
        "co_applicant_address": [
          {
            "co_applicant_address_text": "",
            "co_applicant_address_type": "Home",
            "co_applicant_state": "Rajasthan",
            "co_applicant_city": "Alwar",
            "co_applicant_pincode": 301024
          }
        ]
      }
    ],
    "credit_account_number": "",
    "applicant_aadhar_number": "",
    "applicant_monthly_income": null,
    "credit_account_holder_name": "",
    "credit_account_holder_type": "",
    "archive": false
  },
  "communication_details": [
    {
      "communication_id": 63426,
      "type_of_comm": "call",
      "comm_dict": {
        "to": "9706367068",
        "from": "8178041121",
        "duration": "0 : 0 : 34",
        "called_to": "applicant",
        "call_start_time": "2020-11-04 17:16:32",
        "call_end_time": "2020-11-04 17:17:06",
        "call_response": "Will pay tomorrow",
        "recording_url": "",
        "applicant_type": "applicant"
      }
    },
    {
      "communication_id": 2357,
      "type_of_comm": "sms",
      "comm_dict": {
        "sms_body": "Hi Keval,\n\nPFA legal notice for the non payment of your outstanding dues to Credgenics as per the terms of the loan agreement. \n\nKindly ignore if the matter has already been settled.\n\nhttps://credgenics.com/notices/930b9ecfee7e?t=64bbec02\n\nThanks and Regards,\n\nAdvocates for HLPL\nAR - Abhishek Gupta\nEmail id: abhishek.gupta1@udaan.com\nPhone number: 9513231633  ",
        "sms_mobile": "9706367068",
        "notice_link": "930b9ecfee7e",
        "delivered_time": "2020-08-15 16:57:31",
        "clicked_time": "2020-08-18 10:55:04.839459",
        "sms_language": "en",
        "message_count": 3,
        "template_name": "Legal Notice Template",
        "character_count": 362,
        "notice_click_count": 2
      }
    }
  ],
  "payment_history": [
    {
      "payment_id": 123,
      "amount_recovered": 2000,
      "recovery_method": "Communications",
      "allocation_month": "2021-4-01",
      "payment_method": "Online",
      "payment_mode": "",
      "payment_reference_number": "",
      "author": "demo.admin@credgenics.com",
      "created": "2021-05-15 18:44:15"
    },
    {
      "payment_id": 1234,
      "amount_recovered": 1000,
      "recovery_method": "Communications",
      "allocation_month": "2021-4-01",
      "payment_method": "Online",
      "payment_mode": "",
      "payment_reference_number": "",
      "author": "demo.admin@credgenics.com",
      "created": "2021-04-15 06:43:50"
    }
  ],
  "notice_tracking_details": [
    {
      "notice_id": 125792,
      "case_type": "lrn",
      "document_type": "Notice",
      "s3_link": "https://s3-ap-south-1.amazonaws.com/credgenics-cases/production/notice_links/930b9ecfee7e.pdf",
      "created": "2021-04-15 06:43:50",
      "data": {}
    },
    {
      "notice_id": 12543,
      "case_type": "lrn",
      "document_type": "Speedpost",
      "created": "2021-05-15 18:44:15",
      "data": {
        "events": [
          {
            "date": "05/10/2020",
            "time": "15:27:17",
            "office": "Bhuj HO",
            "description": "Item Delivery Confirmed"
          },
          {
            "date": "05/10/2020",
            "time": "09:17:46",
            "office": "Bhuj HO",
            "description": "Out for Delivery"
          },
          {
            "date": "05/10/2020",
            "time": "08:22:29",
            "office": "Bhuj HO",
            "description": "Item Received"
          },
          {
            "date": "04/10/2020",
            "time": "10:57:04",
            "office": "Bhuj ICH",
            "description": "Item Dispatched"
          },
          {
            "date": "04/10/2020",
            "time": "09:18:22",
            "office": "Bhuj ICH",
            "description": "Item Bagged"
          },
          {
            "date": "04/10/2020",
            "time": "06:17:52",
            "office": "Bhuj ICH",
            "description": "Item Received"
          },
          {
            "date": "03/10/2020",
            "time": "12:30:43",
            "office": "Ahmedabad NSH",
            "description": "Item Dispatched"
          },
          {
            "date": "03/10/2020",
            "time": "11:26:43",
            "office": "Ahmedabad NSH",
            "description": "Item Bagged"
          },
          {
            "date": "03/10/2020",
            "time": "08:40:56",
            "office": "Ahmedabad NSH",
            "description": "Item Received"
          },
          {
            "date": "29/09/2020",
            "time": "17:52:17",
            "office": "Rohini Sector7 SO",
            "description": "Item Dispatched"
          },
          {
            "date": "29/09/2020",
            "time": "17:18:27",
            "office": "Rohini Sector7 SO",
            "description": "Item Bagged"
          },
          {
            "date": "29/09/2020",
            "time": "16:17:42",
            "office": "Rohini Sector7 SO",
            "description": "Item Booked"
          }
        ],
        "booked_at": "Rohini Sector7 SO",
        "article_type": "Inland Speed Post",
        "speedpost_id": "ED670494304IN",
        "applicant_type": "applicant",
        "speedpost_tarrif": "41.30",
        "delivery_location": "Sonipat HO",
        "speedpost_s3_link": "",
        "speedpost_booked_on": "29/09/2020 16:17:42",
        "applicant_address_type": "home",
        "applicant_address_index": 0,
        "speedpost_delivery_status": "Delivered",
        "co_applicant_address_index": -1,
        "speedpost_undelivered_reason": "",
        "speedpost_destination_pincode": "131001",
        "speedpost_delivery_confirmed_on": "05/10/2020 15:27:17"
      }
    }
  ],
  "remarks": [
    {
      "remark_id": 5237,
      "remarks": "(Legal Notice Template ) SMS Sent",
      "created": "2020-11-15 16:57:26",
      "author": "ssingh@credgenics.com"
    },
    {
      "remark_id": 9544,
      "remarks": "Will pay settlement amount tomorrow: Call response , Promise to Pay: Call status , 2020-11-24 - Reminder date",
      "created": "2020-11-23 12:43:11",
      "author": "ssingh@credgenics.com"
    }
  ]
}

Use this API to get all the data for a particular loan.

HTTP Request - GET

GET {BASE_URL}/loan/{loan_id}?fields={fields}

Path Parameters

Parameter Description
loan_id Loan id of the loan
fields Name of the fields of which you want to get the details of in the response.
Eg: fields=loan,payment or fields=notice
fieldsvalue
loan_detailsloan
communication_detailscommunication
payment_historypayment
notice_tracking_detailsnotice
remarksremark
start_date / start_time Specify unix timestamp to retrieve loan details from that date.
end_date / end_time Specify unix timestamp to retrieve loan details up to that date.

Request Headers

Parameter Description
authenticationtoken Auth token given by Credgenics

Response Structure

Key Description
loan_details JSON object containing information provided at the time of loan insertion and payment related details. For all keys included in this, refer the loan upload API parameters.
communication_details JSON object containing information about all the communications that are performed on the loan. Communication includes call, sms, email and voice messaging.
payment_history JSON object containing information about all the payment that are recovered on the loan.
notice_tracking_details JSON object containing information about the legal activities performed on the loan account. It includes legal notice and physical notice tracking.
remarks JSON object containing all the activities that are performed on the loan account. It provides a snapshot view of the loan account.

Response Status Code

200 OK for a successful request.

401 Unauthorized if authentication failed. API credentials are incorrect.

400 Bad Request if the request payload had some error. Specific error is provided in the response.

Upload Loan API

import requests

url = "{BASE_URL}/loan/{loan_id}"

payload = "{\n    \"loan_id\": \"283921\",\n    \"loan_type\": \"Personal Loan\",\n    \"applicant_name\": \"Shri Ram\",\n    \"applicant_dob\": \"1992-03-23\",\n    \"applicant_email\": \"shriram@gmail.com\",\n    \"applicant_gender\": \"Male\",\n    \"applicant_contact_number\": \"9805265926\",\n    \"applicant_monthly_income\": 40000,\n    \"applicant_cibil_score\": 820,\n    \"applicant_occupation\": \"Job\",\n    \"applicant_aadhar_number\": \"235498671293\",\n    \"applicant_language\": \"hi\",\n    \"applicant_pan_number\": \"ADJIY-3516-D\",\n    \"total_loan_amount\": 50000,\n    \"loan_tenure\": 12,\n    \"client_loan_sanction_date\": \"2018-04-06\",\n    \"loan_end_date\": \"2019-04-06\",\n    \"interest_on_loan\": 18,\n    \"tenure_finished\": true,\n    \"security_type\": \"Secured immovable\",\n    \"backed_by_surety\": false,\n    \"loan_nbfc_name\": \"AKARA CAPITAL ADVISORS PVT. LTD.\",\n    \"loan_nbfc_cin\": \"U65191TN1994PLC079235\",\n    \"emi_amount\": 6000,\n    \"product_type\": \"\",\n    \"credit_account_number\": \"11271000005809\",\n    \"credit_account_holder_name\": \"Sri Ram\",\n    \"credit_bank_name\": \"HDFC Bank\",\n    \"credit_account_holder_type\": \"Current\",\n    \"credit_bank_ifsc_code\": \"HDFC0G45B4W\",\n    \"tags\": \"tag1,tag2\",\n    \"agent_email\": \"demoagent@email.com\",\n      \"document_details\": [\n        {\n            \"security_mode\": \"NACH\",\n            \"document_number\": \"757493\",\n            \"document_bank_name\": \"HDFC Bank\",\n            \"document_bank_ifsc_code\": \"\",\n            \"document_amount\": 50000,\n            \"document_date\": \"2018-04-10\",\n            \"document_dishonour_date\": \"2018-04-12\",\n            \"document_signature_name\": \"\",\n            \"document_bounce_bank_account_number\": \"\",\n            \"document_bounce_bank_ifsc_code\": \"\",\n            \"document_bounce_charges\": null,\n            \"document_bounce_bank_name\": \"Yes Bank\",\n            \"document_bounce_bank_address\": \"\",\n            \"document_bounce_memo_date\": null,\n            \"reason_of_document_bounce\": \"\"\n            \"document_bounce_memo_reference_number\": \"\",\n            \"document_sequence_number\": \"\"\n        \"document_bounce_memo_return_date\": \"2019-06-23\"\n        }\n    ],\n    \"business_name\": \"\",\n    \"applicant_address\": [\n        {\n            \"applicant_address_type\": \"Home\",\n            \"applicant_address_text\": \" 395/13 veer dua colony baldev nager\",\n            \"applicant_state\": \"Rajasthan\",\n            \"applicant_city\": \"Jodhpur\",\n    \"applicant_landmark\": \"\",\n            \"applicant_pincode\": 342001\n        }\n    ],\n    \"defaults\": [\n        {\n    \"allocation_month\":\"2021-7-01\",\n            \"total_claim_amount\": 113000,\n            \"late_fee\": 59443,\n            \"date_of_default\": \"2019-04-07\",\n            \"expected_emi\": 54000,\n            \"default_emi_number\": 12,\n            \"settlement_amount\": 45000,\n            \"client_amount_recovered\": 0,\n            \"principal_outstanding_amount\": 45000,\n            \"expected_emi_interest_amount\": null,\n            \"expected_emi_principal_amount\": 45000,\n            \"other_penalty\": null\n        }\n    ],\n    \"co_applicant\": [\n        {\n            \"co_applicant_name\": \"Naveen Shekhawat\",\n            \"co_applicant_type\": \"Individual\",\n        \"co_applicant_email\": \"pravinsingh@gmail.com\",\n            \"co_applicant_gender\": \"Male\",\n            \"co_applicant_contact_number\": \"9814274470\",\n            \"co_applicant_dob\": \"1990-06-29\",\n            \"co_applicant_address\": [\n        {\n        \"co_applicant_address_text\": \"\",\n        \"co_applicant_address_type\": \"Home\",\n        \"co_applicant_state\": \"Rajasthan\",\n        \"co_applicant_city\": \"Alwar\",\n        \"co_applicant_pincode\": 301024\n        }\n    ],\n    \"references\": [\n        {\n            \"relation_with_applicant\": \"Colleague\",\n            \"name\": \"Abhishek Kumar\",\n            \"contact_number\": \"8802913432\"\n        }\n    ],\n    \"merchant_name\": \"Intellipaat\",\n    \"payment_link\": \"https://rzp.io/i/itKAy2q\",\n \"payment_link_expiry\": 1627390971\n}"
headers = {
  'authenticationtoken': '{auth_token}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request POST '{BASE_URL}/loan/{loan_id}' \
--header 'authenticationtoken: {auth_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "loan_id": "283921",
  "loan_type": "Personal Loan",
  "applicant_name": "Shri Ram",
  "applicant_dob": "1992-03-23",
  "applicant_email": "shriram@gmail.com",
  "applicant_gender": "Male",
  "applicant_contact_number": "9805265926",
  "applicant_monthly_income": 40000,
  "applicant_cibil_score": 820,
  "applicant_occupation": "Job",
  "applicant_aadhar_number": "235498671293",
  "applicant_language": "hi",
  "applicant_pan_number": "ADJIY-3516-D",
  "total_loan_amount": 50000,
  "loan_tenure": 12,
  "client_loan_sanction_date": "2018-04-06",
  "loan_end_date": "2019-04-06",
  "interest_on_loan": 18,
  "tenure_finished": true,
  "security_type": "Secured immovable",
  "backed_by_surety": false,
  "loan_nbfc_name": "AKARA CAPITAL ADVISORS PVT. LTD.",
  "loan_nbfc_cin": "U65191TN1994PLC079235",
  "emi_amount": 6000,
  "product_type": "",
  "credit_account_number": "11271000005809",
  "credit_account_holder_name": "Sri Ram",
  "credit_bank_name": "HDFC Bank",
  "credit_account_holder_type": "Current",
  "credit_bank_ifsc_code": "HDFC0G45B4W",
  "tags": "tag1,tag2",
  "agent_email": "demoagent@email.com,demoagent2@email.com",
  "document_details": [
    {
      "security_mode": "NACH",
      "document_number": "757493",
      "document_bank_name": "HDFC Bank",
      "document_bank_ifsc_code": "",
      "document_amount": 50000,
      "document_date": "2018-04-10",
      "document_dishonour_date": "2018-04-12",
      "document_signature_name": "",
      "document_bounce_bank_account_number": "",
      "document_bounce_bank_ifsc_code": "",
      "document_bounce_charges": null,
      "document_bounce_bank_name": "Yes Bank",
      "document_bounce_bank_address": "",
      "document_bounce_memo_date": null,
      "reason_of_document_bounce": "",
      "document_bounce_memo_reference_number": "",
      "document_sequence_number": "",
      "document_bounce_memo_return_date": "2019-06-23"
    }
  ],
  "business_name": "",
  "applicant_address": [
    {
      "applicant_address_type": "Home",
      "applicant_address_text": " 395/13 veer dua colony baldev nager",
      "applicant_state": "Rajasthan",
      "applicant_city": "Jodhpur",
      "applicant_landmark": "",
      "applicant_address_latitude":"",
      "applicant_address_longitude":"",
      "applicant_pincode": 342001
    }
  ],
  "defaults": [
    {
      "allocation_month": "2021-7-01",
      "total_claim_amount": 113000,
      "late_fee": 59443,
      "date_of_default": "2019-04-07",
      "expected_emi": 54000,
      "default_emi_number": 12,
      "settlement_amount": 45000,
      "client_amount_recovered": 0,
      "principal_outstanding_amount": 45000,
      "expected_emi_interest_amount": null,
      "expected_emi_principal_amount": 45000,
      "other_penalty": null
    }
  ],
  "co_applicant": [
    {
      "co_applicant_name": "Naveen Shekhawat",
      "co_applicant_type": "Individual",
      "co_applicant_email": "pravinsingh@gmail.com",
      "co_applicant_gender": "Male",
      "co_applicant_contact_number": "9814274470",
      "co_applicant_dob": "1990-06-29",
      "co_applicant_address": [
        {
          "co_applicant_address_text": "",
          "co_applicant_address_type": "Home",
          "co_applicant_state": "Rajasthan",
          "co_applicant_city": "Alwar",
          "co_applicant_pincode": 301024
        }
      ]
    }
  ],
  "references": [
    {
      "relation_with_applicant": "Colleague",
      "name": "Abhishek Kumar",
      "contact_number": "8802913432"
    }
  ],
  "merchant_name": "Intellipaat",
  "payment_link": "https://rzp.io/i/itKAy2q",
  "payment_link_expiry": 1627390971
}'
var myHeaders = new Headers();
myHeaders.append("authenticationtoken", "{auth_token}");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({"loan_id":"283921","loan_type":"Personal Loan","applicant_name":"Shri Ram","applicant_dob":"1992-03-23","applicant_email":"shriram@gmail.com","applicant_gender":"Male","applicant_contact_number":"9805265926","applicant_monthly_income":40000,"applicant_cibil_score":820,"applicant_occupation":"Job","applicant_aadhar_number":"235498671293","applicant_language":"hi","applicant_pan_number":"ADJIY-3516-D","total_loan_amount":50000,"loan_tenure":12,"client_loan_sanction_date":"2018-04-06","loan_end_date":"2019-04-06","interest_on_loan":18,"tenure_finished":true,"security_type":"Secured immovable","backed_by_surety":false,"loan_nbfc_name":"AKARA CAPITAL ADVISORS PVT. LTD.","loan_nbfc_cin":"U65191TN1994PLC079235","emi_amount":6000,"product_type":"","credit_account_number":"11271000005809","credit_account_holder_name":"Sri Ram","credit_bank_name":"HDFC Bank","credit_account_holder_type":"Current","credit_bank_ifsc_code":"HDFC0G45B4W","tags":"tag1,tag2","agent_email":"demoagent@email.com","document_details":[{"security_mode":"NACH","document_number":"757493","document_bank_name":"HDFC Bank","document_bank_ifsc_code":"","document_amount":50000,"document_date":"2018-04-10","document_dishonour_date":"2018-04-12","document_signature_name":"","document_bounce_bank_account_number":"","document_bounce_bank_ifsc_code":"","document_bounce_charges":null,"document_bounce_bank_name":"Yes Bank","document_bounce_bank_address":"","document_bounce_memo_date":null,"reason_of_document_bounce":"","document_bounce_memo_reference_number":"","document_seqeunce_number":"","document_bounce_memo_return_date": "2019-06-23"}],"business_name":"","applicant_address":[{"applicant_address_type":"Home","applicant_address_text":" 395/13 veer dua colony baldev nager","applicant_state":"Rajasthan","applicant_city":"Jodhpur","applicant_landmark": "","applicant_pincode":342001}],"defaults":[{"allocation_month":"2021-7-01","total_claim_amount":113000,"late_fee":59443,"date_of_default":"2019-04-07","expected_emi":54000,"default_emi_number":12,"settlement_amount":45000,"client_amount_recovered":0,"principal_outstanding_amount":45000,"expected_emi_interest_amount":null,"expected_emi_principal_amount":45000,"other_penalty":null}],"co_applicant":[{"co_applicant_name":"Naveen Shekhawat","co_applicant_type":"Individual","co_applicant_email":"pravinsingh@gmail.com","co_applicant_gender":"Male","co_applicant_contact_number":"9814274470","co_applicant_dob":"1990-06-29","co_applicant_address": [{"co_applicant_address_text": "","co_applicant_address_type": "Home","co_applicant_state": "Rajasthan","co_applicant_city": "Alwar","co_applicant_pincode": 301024}]}],"references":[{"relation_with_applicant":"Colleague","name":"Abhishek Kumar","contact_number":"8802913432"}],"merchant_name":"Intellipaat","payment_link":"https://rzp.io/i/itKAy2q","payment_link_expiry": 1627390971});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{BASE_URL}/loan/{loan_id}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The above code returns JSON structured like this:

Sample Success Response

{
  "message": "Data uploaded successfully"
}

Sample Failure Response

{
  "message": "Data Validation Failed",
  "output": {
    "errors": {
      "applicant_contact_number": "Invalid Mobile numbers, [83849879]",
      "applicant_dob": "Value must be of type date with format YYYY-MM-DD",
      "applicant_language": "Invalid languages, [feger]",
      "co_applicant": {
        "0": {
          "co_applicant_email": "Invalid Emails, [tempgmail.com]"
        }
      },
      "defaults": {
        "0": {
          "default_emi_number": "Value must be a number"
        }
      }
    }
  }
}

Use this API to add new Loan / EMI to the data. Goes without saying your data is secure with us. :)

HTTP Request - POST

POST {BASE_URL}/loan/{loan_id}

Path Parameters

Parameter Description
loan_id Loan id of the loan

Request Headers

Parameter Description
authenticationtoken Auth token assigned by Credgenics

Request Body Parameters

Key name Variable Type Data Type Description
loan_id text string The loan_id of the loan provided by the lender
client_customer_id text string A unique ID provided by the client which uniquely maps to a borrower who may or may not have multiple loans with the client
loan_type text string The type of loan loan based on the function it serves e.g. - Personal Loan, Business Loan, Vehicle Loan, etc.
applicant_name text string Full name of the applicant
applicant_email email address string Email ID of the applicant (should be separated by comma in case of multiple emails, ordering is important)
applicant_contact_number mobile_number string Contact number of borrower (should be separated by comma in case of multiple contact numbers, ordering is important)
applicant_gender gender string Gender of the applicant (Options: Male, Female, Non-Binary)
applicant_dob date date Date of birth of the applicant in the format "YYYY-MM-DD"
applicant_monthly_income decimal float Last updated monthly income of the applicant
applicant_cibil_score number integer Last updated bureau score of the borrower
applicant_aadhar_number text string The Aadhar number of the applicant
applicant_pan_number text string PAN number of the applicant
applicant_photo_link url string URL of the profile photo uploaded for the loan applicant
applicant_notice_reference_number text string Notice reference number of the Applicant
applicant_occupation text string Last updated occupation of the applicant
applicant_language language string Language of the applicant as per ISO 639-1 Code standards (Link: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (Options:English,Hindi,Tamil,Punjabi,Telugu,Marathi,Gujarati,Kannada,Bengali,Malayalam,Oriya,Assamese)
total_loan_amount amount float Total amount that was disbursed by the bank for the given loan account
vehicle_registration_number text string The vehicle registration number for the vehicle linked to the loan at the time of approval
loan_tenure number integer Tenure of the loan in months
client_loan_sanction_date date date The sanction date of the loan in the format 'YYYY-MM-DD'
loan_end_date date date The date on which the loan was supposed to end as per the amortisation schedule e.g. "YYYY-MM-DD"
interest_on_loan percentage float The total interest amount that was determined at the time of loan disbursal as per the amortisation schedule
tenure_finished bool boolean Boolean indicator showing wheher the tenure of the loan is finished or not. (Options: True/False)
security_type text string The type of security against the loan in case the loan is an secured loan (Options: Secured/Secured Movable/Secured Immovable) otherwise the value will be 'Unsecured'
backed_by_security bool boolean Boolean variable providing information of whether the loan has a guarantor or not (Options: True/False)
chassis_number text string Chassis number of vehicle linked to the loan
loan_nbfc_name text string The name of the NBFC linked to the loan (if applicable)
loan_nbfc_cin text string The CIN of the NBFC linked to the loan (if applicable)
tags text string List of tags that need to be applied to the loan at the time of upload [multiple values should be comma separated, order not important]
agent_email email address string Email of the user to which loan should be allocated to at the time of loan data upload
emi_amount amount float The amount of a single EMI that was determined at the time of loan disbursal as per the amortisation schedule
engine_number text string The engine number of the vehicle linked to the loan
group_id text string The group_id assigned to the linked loan by lender
product_type text string The financial product type in which the loan falls in, a further classification of loan type e.g. - 4-wheeler loan, 2-wheeler Loan, Overdraft loan, Term Loan etc.
credit_account_number number integer The account number of the borrower in which he/she recieved the loan amount. Eg - "0000012835"
credit_account_holder_name text string Full name of the credit account holder e.g - "Ramesh Singh"
credit_account_holder_type text string The account type of the credit bank account holder e.g - Savings, Current, etc
credit_bank_name text string The name of the bank in which credit account holder (borrower) received the loan amount
credit_bank_ifsc_code text string The IFSC code of the bank in which borrower received the loan amount
business_name text string Last updated name of the business of the applicant
make_and_model text string The make and model of the vehicle linked to the loan (Applicable in case of vehicle/auto loans)
merchant_name text string Name of the merchant linked to the loan e.g. the merchant to which
notice_date date date The date that is to be printed on the draft PDF
notice_delivery_partner text string The name of the delivery partner merchant that was used to deliver the notice
payment_link url string The URL corresponding to the given allocation month and loan to send to the borrower through various communications in order to get them to pay through it
payment_link_expiry number integer The expiry time for the payment link (seconds)
channel_partner text string Channel partner name of the applicant
loan_region text string Geographical Region to which the loan belongs to
loan_regional_manager_name text string Name of the regional manager assigned by the client to the loan
loan_regional_manager_contact_number mobile number string Contact number of the regional manager assigned by the client to the loan
loan_regional_manager_contact_email email address string Contact email of the regional manager assigned by the client to the loan
loan_source_branch_address text string Address of the physical branch which disbured the loan (if applicable)
Document Keys
document_details list list List of variable containing all the details corresponding to the document that has been uploaded
security_mode text string The security mode for the loan provided by the borrower at the time of loan approval e.g. - NACH, ECS, ENACH, PDC, Others (Two wheeler, Four wheeler, house) etc.
document_number text string Document number of the security document e.g. Cheque Number, ECS number etc.
document_bank_name text string The name of bank/lender that issued the security document e.g. cheque bank name
document_bank_ifsc_code text string The IFSC code of the bank that has issued the security document
document_amount amount float The amount mentioned on the security document. Eg. cheque amount
document_date date date The execution date of the security document submitted by borrower e.g. cheque date
document_dishonour_date date date The dishonour date of the security document e.g. Cheque dishonour date
document_signature_name text string The name of the signee on the security document. Eg. Signee name on the Cheque
document_bounce_bank_account_number number integer The account number of the bank account in which document was bounced
document_bounce_charges decimal float The charges associated with the document bounce processing
document_bounce_bank_name text string Bank name in which the security_mode document was bounced
document_bounce_bank_ifsc_code text string IFSC code of the bank in which document was bounced
document_bounce_bank_address text string Address of the bank in which document was bounced
document_bounce_memo_date date date Date of document bounce memo
reason_of_document_bounce text string Reason behind the security_mode document bounce. Eg. Insufficient balance
document_micr text string 9 digit Document MICR Code of the document
document_presented_in_account text string Account in which document is presented
document_presented_zone text string Zone in which document is presented
document_bounce_memo_branch_address text string Address of the document bounce memo branch
document_signature_address_text text string Document signature address
document_signature_city text string Document signature city
document_signature_state text string Document signature state
document_signature_pincode postal code integer Document signature pincode
document_bounce_memo_reference_number text string Reference number of document bounce memo
document_sequence_number text string Sequence number of document
document_bounce_memo_return_date date date Document bounce memo return date
document_umrn text string Document Unique Mandate Reference Number
Address Keys
applicant_address list list List of Variable containing all the sub-variables corresponding to the address of the applicant
applicant_address_type text string The type of address that has been provided for applicant address [Options - Home, Business, Office]
applicant_address_text text string Entire text body of address of applicant including lane, street, house number, colony etc.
applicant_state text string State provided in the applicant address
applicant_city text string City provided in the applicant address
applicant_landmark text string Nearby Landmark provided in the applicant address
applicant_pincode postal code integer Pincode provided in the applicant address
applicant_address_latitude text string The latitude of the location this applicant address points to, this will get used at the time of allocation
applicant_address_longitude text string The longitude of the location this applicant address points to, this will get used at the time of allocation
Default Keys
defaults list list List of variable containing all the different allocation month level variables that provide information about the different amounts that are due, recovered and general details of the EMI or allocation in question
allocation_month date date The month and year for which the loan has been allocated on the CG Platform
allocation_dpd_value number integer The DPD value of the borrower at the time of allocation of loan onto the CG Platform
allocation_dpd_bracket text string The DPD bracket of the borrower at the time of allocation of loan onto the CG Platform
total_claim_amount amount float The DPD bracket of the borrower at the time of allocation of loan onto the CG Platform
late_fee amount float Late fee that needs to be paid by the borrower
date_of_default date date Date on which the borrower defaulted on the loan (first default)
expected_emi amount float The EMI amount without late fees and penalties that is to be recovered for the given month from the borrower
default_emi_number number integer The serial number of the EMI that the borrower defaulted on as per the amortization schedule created at the time of loan disbursal by the lender
settlement_amount amount float The settlement amount that is to be recovered from the borrower to in order to generate the settlement NOC by lender
client_amount_recovered amount float The amount that was already recovered by the client/lender before allocating the loan on CG Platform
principal_outstanding_amount amount float The principal outstanding amount corresponding to the loan at the time of allocation to CG
expected_emi_interest_amount amount float The interest amount corresponding to the EMI that is to be recovered for the given month from the borrower
expected_emi_principal_amount amount float The principal amount corresponding to the EMI that is to be recovered for the given month from the borrower
other_penalty decimal float The penalty amount corresponding to the EMI that is to be recovered for the given month from the borrower
Reference Keys
references list list List of Variable containing all the details of the person who has served as a reference for the borrower
relation_with_applicant text string The relation of the reference to the applicant
name text string The full name of the reference
contact_number mobile number string The contact number of the reference
reference_gender gender string The gender of the reference
reference_pan_number text string The PAN card number of the reference
reference_address list list List of Variable containing all the address details of the reference
reference_address_type text string The address type of the reference
reference_address_text text string The full address text of the reference
reference_city text string The city of residence of the reference
reference_state text string The state of residence of the reference
reference_pincode postal code integer The pincode of residence of the refernece
Coapplicant Keys
co_applicant list list List of Variable containing all the sub-variables regarding the details of the co-applicant
co_applicant_name text string Full name of the co-applicant
co_applicant_type text string The type of the co-applicant
co_applicant_language language string The language used by the co-applicant
co_applicant_email email address string Email ID of the co-applicant [should be separated by comma in case of multiple emails, ordering is important]
co_applicant_contact_number mobile number string Contact number of borrower [should be separated by comma in case of multiple contact numbers, ordering is important]
co_applicant_gender gender string Gender of the co-applicant [Options: Male, Female, Other]
co_applicant_dob date date Date of birth of the co-applicant in the format "YYYY-MM-DD"
co_applicant_notice_reference_number text string Notice reference number of co-applicant
co_applicant_photo_link url string URL of the profile photo uploaded for the loan co-applicant
co_applicant_address list list List of Variable containing all the sub-variables corresponding to the address of the co-applicant
co_applicant_address_text text string Entire text body of address of co-applicant including lane, street, house number, colony etc.
co_applicant_address_type text string The type of address that has been provided for co-applicant address [Options - Home, Business, Office]
co_applicant_state text string State provided in the co-applicant address
co_applicant_city text string City provided in the co-applicant address
co_applicant_pincode postal code integer Pincode provided in the co-applicant address
co_applicant_address_latitude text string The latitude of the location this co-applicant address points to, this will get used at the time of allocation
co_applicant_address_longitude text string The longitude of the location this co-applicant address points to, this will get used at the time of allocation

Response Status Code

201 OK for a successful request.

401 Unauthorized if authentication failed. API credentials are incorrect.

400 Bad Request if the request payload had some error. Specific error is provided in the response.

Update Loan API

import requests

url = "{BASE_URL}/loan/{loan_id}"

payload = "{\n    \"total_loan_amount\": 60000\n}"
headers = {
  'authenticationtoken': '{auth_token}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request PATCH '{BASE_URL}/loan/{loan_id}' \
--header 'authenticationtoken: {auth_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "total_loan_amount": 60000
}'
var myHeaders = new Headers();
myHeaders.append("authenticationtoken", "{auth_token}");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({"total_loan_amount":60000});

var requestOptions = {
  method: 'PATCH',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{BASE_URL}/loan/{loan_id}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The above code returns JSON structured like this:

{
  "output": "Loan successfully updated",
  "message": "success",
  "headers": {
    "Content-Type": "application/json"
  }
}

Use this API to update the details of a particular loan.

HTTP Request - PATCH

PATCH {BASE_URL}/loan/{loan_id}

Path Parameters

Parameter Description
loan_id Loan id of the loan

Request Headers

Parameter Description
authenticationtoken Auth token given by Credgenics

Response Status Code

200 OK for a successful request.

401 Unauthorized if authentication failed. API credentials are incorrect.

400 Bad Request if the request payload had some error. Specific error is provided in the response.

Update Payment API

import requests
import json
url = "{BASE_URL}/payments/{loan_id}?allocation_month={allocation_month}"

payload = json.dumps({
  "amount_recovered": 1000,
  "recovery_date": "2022-01-08",
  "recovery_method": "Communications",
  "recovered_by": "shriram@gmail.com",
  "payment_method": "Cheque",
  "closure_with": "NOC",
  "payment_mode": "cash",
  "payment_reference_number": "RFN123456",
  "payment_received_date" : "2022-01-12"
})

headers = {
  'authenticationtoken': '{auth_token}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request PATCH '{BASE_URL}/payments/{loan_id}?allocation_month={allocation_month}' \
--header 'authenticationtoken: {auth_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount_recovered": 1000,
    "recovery_date": "2022-01-08",
    "recovery_method": "Communications",
    "recovered_by": "shriram@gmail.com",
    "payment_method": "Cheque",
    "closure_with": "NOC",
    "payment_mode": "cash",
    "payment_reference_number": "RFN123456",
    "payment_received_date" : "2022-01-12",
}'
var myHeaders = new Headers();
myHeaders.append("authenticationtoken", "{auth_token}");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "amount_recovered": 1000,
  "recovery_date": "2022-01-08",
  "recovery_method": "Communications",
  "recovered_by": "shriram@gmail.com",
  "payment_method": "Cheque",
  "closure_with": "NOC",
  "payment_mode": "cash",
  "payment_reference_number": "RFN123456",
  "payment_received_date" : "2022-01-12"
});

var requestOptions = {
  method: 'PATCH',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{BASE_URL}/payments/{loan_id}?allocation_month={allocation_month}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The above code returns JSON structured like this:

{
  "output": "Data updated successfully",
  "message": "success",
  "headers": {
    "Content-Type": "application/json"
  }
}

Use this API to update the payment details of a customer. This API will create a new entry corresponding to a loan_id.

HTTP Requests - PATCH

PATCH {BASE_URL}/payments/{loan_id}?allocation_month={allocation_month}

Path Parameters

Parameter Description
loan_id Loan id of the recovered loan
allocation_month Allocation month of the recovered loan. Eg - "2021-2-01"

Example Json for Recovery Amount Bifurcation

{
    "amount_recovered": 2200,
    "date_of_default": "2022-05-07",
    "recovery_date": "2022-06-02 09:30:00",
    "recovery_method": "Field collection",
    "payment_method": "Cash",
    "recovered_expected_emi": 2000, //recovery amount bifurcation key
    "recovered_late_fee": 100, //recovery amount bifurcation key
    "recovered_penalty": 100 //recovery amount bifurcation key
}

Enabling Recovery Amount Bifurcation can be achieved through Company Details tab on Setting page.

Steps:

  1. Log in to the platform
  2. Navigate to the Company details tab in settings page
  3. Select Variable tab in Company details
  4. Under Recovery Variables, enable Recovered Amount Bifurcation.

After enabling recovery amount bifurcation, you can add the desired bifurcation variables using Add variable option.

Once the variables are added, you need to add recovered_ as a prefix to all bifurcation variables and add them in the payload at the top-level keys.

For example: if you add late_fee as a bifurcation variable, then the payload key format will be recovered_late_fee

Request Headers

Parameter Description
authenticationtoken The authentication token assigned to you by Credgenics
Content-Type "application/json"

Request Body Parameters

Key Name Type Required Description
amount_recovered integer True Total amount received in a given payment
recovery_method string False The recovery method that was used to recover a given payment from the borrower (Options: Field Collection, Communication, Legal)
payment_method string True The method of payment that was used to complete the transfer of money (Options: Online, Cash, Cheque, Bank Account Transfer, Application, Payment Link)
payment_received_date date False The date on which the payment was actually received in the lenders account after processing of payment by the payment processor
closure_with string False In cases where the recovery status is 'Closed', it needs to be specified whether the loan was settled or a complete recovery was made (Options: NOC, Settlement)
payment_reference_number string False The unique reference number generated by the payment processor at the time of execution of payment e.g. UPI transaction ID
payment_mode string False The mode of payment that was used to complete the transfer of money e.g. UPI, NEFT, RTGS etc.
recovered_by string False The name of the user that collected the payment, in case of agent it will be the name, otherwise it will be name of the API
recovery_date datetime False This is the date on which the recovery was made by the agent/channel i.e. it has been updated on CG system that the recovery has been done. This date might differ from the actual date on which the payment was received from the borrower.

Response Status Code

200 OK for a successful request.

401 Unauthorized if authentication failed. API credentials are incorrect.

400 Bad Request if the request payload had some error. Specific error is provided in the response.

Credit Line APIs

Get Customer API

import requests

url = "{BASE_URL}/loan/{client_customer_id}?fields={fields}"

payload = {}
headers = {
  'authenticationtoken': '{auth_token}',
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request GET '{BASE_URL}/loan/{client_customer_id}?fields={fields}' \
--header 'authenticationtoken: {auth_token}'
var myHeaders = new Headers();
myHeaders.append("authenticationtoken", "{auth_token}");

var requestOptions = {
  method: "GET",
  headers: myHeaders,
  redirect: "follow",
};

fetch(
  "{BASE_URL}/loan/{client_customer_id}?fields={fields}",
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log("error", error));

The above command returns JSON structured like this:

{
  "output": {
    "applicant_details": {
      "client_customer_id": "189004",
      "defaults": [
        {
          "allocation_month": "2021-1-01",
          "amount_recovered": 0,
          "settlement_amount": null,
          "tags": [
                {
                  "tag_name": "temporary",
                  "active": true,
                  "created": "2021-07-21 07:50:41"
                },
                {
                  "tag_name": "temporary-tag",
                  "active": true,
                  "created": "2021-07-21 09:50:41"
                }
              ]
        },
        {
          "allocation_month": "2021-2-01",
          "amount_recovered": 3550,
          "settlement_amount": 45000,
          "tags": [
                {
                  "tag_name": "demo",
                  "active": true,
                  "created": "2021-07-21 10:50:41"
                }
              ],
        }
      ],
      "loan_type": "Personal Loan",
      "references": [
        {
          "name": "Shri Ram",
          "contact_number": "9999999999",
          "relation_with_applicant": "Colleague"
        }
      ],
      "co_applicant": [
        {
          "co_applicant_name": "Naveen Shekhawat",
          "co_applicant_type": "Individual",
          "co_applicant_email": "pravinsingh@gmail.com",
          "co_applicant_gender": "Male",
          "co_applicant_contact_number": "9814274470",
          "co_applicant_dob": "1990-06-29",
          "co_applicant_address": [
            {
              "co_applicant_address_text": "",
              "co_applicant_address_type": "Home",
              "co_applicant_state": "Rajasthan",
              "co_applicant_city": "Alwar",
              "co_applicant_pincode": 301024
            }
          ]
        }
      ],
      "payment_link": "",
      "product_type": "Payday personal",
      "applicant_dob": "1992-03-23",
      "business_name": "ABC PVT. LTd.",
      "engine_number": "",
      "loan_end_date": "2019-04-06",
      "loan_nbfc_cin": "U65191TN1994PLC078035",
      "merchant_name": "Intellipaat",
      "security_type": "Secured immovable",
      "applicant_name": "Sri Ram",
      "chassis_number": "",
      "loan_nbfc_name": "AKARA CAPITAL ADVISORS PVT. LTD.",
      "make_and_model": "",
      "applicant_email": "shriram@gmail.com",
      "applicant_gender": "Male",
      "backed_by_surety": false,
      "credit_bank_name": "HDFC Bank",
      "document_details": [
        {
            "security_mode": "NACH",
            "document_number": "757493",
            "document_bank_name": "HDFC Bank",
            "document_bank_ifsc_code": "",
            "document_amount": 50000,
            "document_date": "2018-04-10",
            "document_dishonour_date": "2018-04-12",
            "document_signature_name": "",
            "document_bounce_bank_account_number": "",
            "document_bounce_bank_ifsc_code": "",
            "document_bounce_charges": null,
            "document_bounce_bank_name": "Yes Bank",
            "document_bounce_bank_address": "",
            "document_bounce_memo_date": null,
            "reason_of_document_bounce": "",
            "document_bounce_memo_reference_number": "",
            "document_sequence_number": "",
        }
      ],
      "applicant_address": [
        {
          "applicant_city": "Jodhpur",
          "applicant_state": "Rajasthan",
          "applicant_pincode": 342001,
          "applicant_landmark": "",
          "applicant_address_text": "395/13 Veer Dua Colony Baldev Nager",
          "applicant_address_type": "Home"
        }
      ],
      "applicant_language": "hi",
      "applicant_occupation": "Job",
      "applicant_pan_number": "",
      "applicant_cibil_score": 820,
      "credit_account_number": "",
      "credit_bank_ifsc_code": "HDFC0G45B4W",
      "applicant_aadhar_number": "",
      "applicant_contact_number": "9999999999",
      "applicant_monthly_income": 40000,
      "credit_account_holder_name": "Sri Ram",
      "credit_account_holder_type": "Current",
      "loan_regional_manager_name": "",
      "vehicle_registration_number": "",
      "loan_regional_manager_contact_email": "",
      "loan_regional_manager_contact_number": "",
      "archive": false
    },
    "transactions_details": [
      {
        "transaction_id": "283921",
        "data": {
          "defaults": [
            {
              "created": "2021-02-14 20:22:41.889461",
              "late_fee": 59443,
              "upload_date": null,
              "closure_with": "",
              "expected_emi": 54000,
              "payment_mode": "",
              "other_penalty": null,
              "recovery_date": "2021-02-26 13:07:22.248235",
              "payment_method": "Online",
              "date_of_default": "2020-01-23",
              "dpd": "30",
              "dpd_bracket": "30+",
              "recovery_method": "",
              "allocation_month": "2021-2-01",
              "amount_recovered": 3450,
              "payment_reference_number": "",
              "default_emi_number": 12,
              "total_claim_amount": 113000,
              "allocation_dpd_value": 679,
              "actual_date_of_default": "2019-04-07",
              "allocation_dpd_bracket": "180+",
              "client_amount_recovered": 0,
              "expected_emi_interest_amount": null,
              "principal_outstanding_amount": 45000,
              "expected_emi_principal_amount": 45000,
              "recovery_status": "Not Recovered"
            }
          ],
          "emi_amount": 6000,
          "loan_tenure": 12,
          "loan_end_date": "2019-04-06",
          "transaction_id": "283921",
          "tenure_finished": true,
          "interest_on_loan": 18,
          "total_loan_amount": 50000,
          "client_loan_sanction_date": "2018-04-06"
        }
      },
      {
        "transaction_id": "18372",
        "data": {
          "defaults": [
            {
              "created": "2021-01-27 18:57:11.514467",
              "late_fee": 1000,
              "upload_date": "",
              "expected_emi": 10001,
              "other_penalty": null,
              "date_of_default": "2020-03-02",
              "dpd": "225",
              "dpd_bracket": "180+",
              "allocation_month": "2021-1-01",
              "amount_recovered": 0,
              "default_emi_number": 4,
              "total_claim_amount": 9000,
              "allocation_dpd_value": 331,
              "actual_date_of_default": "2020-03-02",
              "allocation_dpd_bracket": "180+",
              "client_amount_recovered": null,
              "expected_emi_interest_amount": 2000,
              "principal_outstanding_amount": 1000,
              "expected_emi_principal_amount": 9000,
               "recovery_status": "Not Recovered"
            }
          ],
          "emi_amount": 1000,
          "loan_tenure": 11,
          "loan_end_date": "2020-03-02",
          "transaction_id": "283920",
          "tenure_finished": true,
          "interest_on_loan": 12,
          "total_loan_amount": 902929,
          "client_loan_sanction_date": "2020-01-29"
        }
      }
    ],
    "global_status": "Initiated",
    "legal_status": "Initiated",
    "settlement_status": "Initiated",
    "payment_history": [
    {
      "payment_id": 235,
      "client_customer_id": "189004",
      "amount_recovered": 1000,
      "recovery_method": "Communications",
      "allocation_month": "2021-4-01",
      "payment_method": "Online",
      "payment_mode": "",
      "payment_reference_number": "",
      "author": "demo.admin@credgenics.com",
      "created": "2021-04-15 06:43:50"
    },
    {
      "payment_id": 32432,
      "client_customer_id": "189004",
      "amount_recovered": 1000,
      "recovery_method": "Communications",
      "allocation_month": "2021-4-01",
      "payment_method": "Online",
      "payment_mode": "",
      "payment_reference_number": "",
      "author": "demo.admin@credgenics.com",
      "created": "2021-05-15 18:44:15"
    },
  ],
    "communication_details": [
    {
      "communication_id": 23,
      "type_of_comm": "call",
      "comm_dict": {
        "to": "9706367068",
        "from": "8178041121",
        "duration": "0 : 0 : 34",
        "called_to": "applicant",
        "call_start_time": "2020-11-04 17:16:32",
        "call_end_time": "2020-11-04 17:17:06",
        "call_response": "Will pay tomorrow",
        "recording_url": "",
        "applicant_type": "applicant"
      }
    },
    {
      "communication_id": 23555,
      "type_of_comm": "sms",
      "comm_dict": {
        "sms_body": "Hi Keval,\n\nPFA legal notice for the non payment of your outstanding dues to Credgenics as per the terms of the loan agreement. \n\nKindly ignore if the matter has already been settled.\n\nhttps://credgenics.com/notices/930b9ecfee7e?t=64bbec02\n\nThanks and Regards,\n\nAdvocates for HLPL\nAR - Abhishek Gupta\nEmail id: abhishek.gupta1@udaan.com\nPhone number: 9513231633  ",
        "sms_mobile": "9706367068",
        "notice_link": "930b9ecfee7e",
        "delivered_time": "2020-08-15 16:57:31",
        "clicked_time": "2020-08-18 10:55:04.839459",
        "sms_language": "en",
        "message_count": 3,
        "template_name": "Legal Notice Template",
        "character_count": 362,
        "notice_click_count": 2
      }
    }
  ],
    "notice_tracking_details": [
    {
      "notice_id": 4332,
      "case_type": "lrn",
      "document_type": "Notice",
      "s3_link": "https://s3-ap-south-1.amazonaws.com/credgenics-cases/production/notice_links/930b9ecfee7e.pdf",
      "created": "2020-08-18 10:55:04",
      "data": {}
    },
    {
      "notice_id": 3563,
      "case_type": "lrn",
      "document_type": "Speedpost",
      "created": "2020-08-18 10:55:04",
      "data": {
        "events": [
          {
            "date": "05/10/2020",
            "time": "15:27:17",
            "office": "Bhuj HO",
            "description": "Item Delivery Confirmed"
          },
          {
            "date": "05/10/2020",
            "time": "09:17:46",
            "office": "Bhuj HO",
            "description": "Out for Delivery"
          },
          {
            "date": "05/10/2020",
            "time": "08:22:29",
            "office": "Bhuj HO",
            "description": "Item Received"
          },
          {
            "date": "04/10/2020",
            "time": "10:57:04",
            "office": "Bhuj ICH",
            "description": "Item Dispatched"
          },
          {
            "date": "04/10/2020",
            "time": "09:18:22",
            "office": "Bhuj ICH",
            "description": "Item Bagged"
          },
          {
            "date": "04/10/2020",
            "time": "06:17:52",
            "office": "Bhuj ICH",
            "description": "Item Received"
          },
          {
            "date": "03/10/2020",
            "time": "12:30:43",
            "office": "Ahmedabad NSH",
            "description": "Item Dispatched"
          },
          {
            "date": "03/10/2020",
            "time": "11:26:43",
            "office": "Ahmedabad NSH",
            "description": "Item Bagged"
          },
          {
            "date": "03/10/2020",
            "time": "08:40:56",
            "office": "Ahmedabad NSH",
            "description": "Item Received"
          },
          {
            "date": "29/09/2020",
            "time": "17:52:17",
            "office": "Rohini Sector7 SO",
            "description": "Item Dispatched"
          },
          {
            "date": "29/09/2020",
            "time": "17:18:27",
            "office": "Rohini Sector7 SO",
            "description": "Item Bagged"
          },
          {
            "date": "29/09/2020",
            "time": "16:17:42",
            "office": "Rohini Sector7 SO",
            "description": "Item Booked"
          }
        ],
        "booked_at": "Rohini Sector7 SO",
        "article_type": "Inland Speed Post",
        "speedpost_id": "ED670494304IN",
        "applicant_type": "applicant",
        "speedpost_tarrif": "41.30",
        "delivery_location": "Sonipat HO",
        "speedpost_s3_link": "",
        "speedpost_booked_on": "29/09/2020 16:17:42",
        "applicant_address_type": "home",
        "applicant_address_index": 0,
        "speedpost_delivery_status": "Delivered",
        "co_applicant_address_index": -1,
        "speedpost_undelivered_reason": "",
        "speedpost_destination_pincode": "131001",
        "speedpost_delivery_confirmed_on": "05/10/2020 15:27:17"
      }
    }
  ],
  "remarks": [
    {
      "remark_id": 4234,
      "remarks": "(Legal Notice Template ) SMS Sent",
      "created": "2020-11-15 16:57:26",
      "author": "ssingh@credgenics.com"
    },
    {
      "remarks_id": 254,
      "remarks": "Will pay settlement amount tomorrow: Call response , Promise to Pay: Call status , 2020-11-24 - Reminder date",
      "created": "2020-11-23 12:43:11",
      "author": "ssingh@credgenics.com"
    }
  ]
  },
  "message": "success",
  "headers": {
    "Content-Type": "application/json"
  }
}

Use this API to retrieve all details of a particular customer

HTTP Request - GET

GET {BASE_URL}/loan/{client_customer_id}?fields={fields}

Path Parameters

Parameter Description
client_customer_id Customer id of the customer
fields Name of the fields of which you want to get the details of in the response.
Eg: fields=loan,payment or fields=notice
By default, the api will send all the fields in the response.
fieldsvalue
Show all fieldsall (Default)
applicant_details and transaction_detailsloan
communication_detailscommunication
payment_historypayment
notice_tracking_detailsnotice
remarksremark
start_date / start_time Specify unix timestamp to retrieve customer details from that date.
end_date / end_time Specify unix timestamp to retrieve customer details up to that date.

Request Headers

Parameter Description
authenticationtoken Auth token given by Credgenics

Response Status Code

200 OK for a successful request.

401 Unauthorized if authentication failed. API credentials are incorrect.

400 Bad Request if the request payload had some error. Specific error is provided in the response.

Upload Transaction API

import requests

url = "{BASE_URL}/loan/{transaction_id}"

payload = "{\n    \"client_customer_id\": \"189004\",\n    \"transaction_id\": \"283921\",\n    \"loan_type\": \"Personal Loan\",\n    \"applicant_name\": \"Shri Ram\",\n    \"applicant_dob\": \"1992-03-23\",\n    \"applicant_email\": \"shriram@gmail.com\",\n    \"applicant_gender\": \"Male\",\n    \"applicant_contact_number\": \"9805265926\",\n    \"applicant_monthly_income\": 40000,\n    \"applicant_cibil_score\": 820,\n    \"applicant_occupation\": \"Job\",\n    \"applicant_aadhar_number\": \"235498671293\",\n    \"applicant_language\": \"hi\",\n    \"applicant_pan_number\": \"ADJIY-3516-D\",\n    \"total_loan_amount\": 50000,\n    \"loan_tenure\": 12,\n    \"client_loan_sanction_date\": \"2018-04-06\",\n    \"loan_end_date\": \"2019-04-06\",\n    \"interest_on_loan\": 18,\n    \"tenure_finished\": true,\n    \"security_type\": \"Secured immovable\",\n    \"backed_by_surety\": false,\n    \"loan_nbfc_name\": \"AKARA CAPITAL ADVISORS PVT. LTD.\",\n    \"loan_nbfc_cin\": \"U65191TN1994PLC079235\",\n    \"emi_amount\": 6000,\n    \"product_type\": \"\",\n    \"credit_account_number\": \"11271000005809\",\n    \"credit_account_holder_name\": \"Sri Ram\",\n    \"credit_bank_name\": \"HDFC Bank\",\n    \"credit_account_holder_type\": \"Current\",\n    \"credit_bank_ifsc_code\": \"HDFC0G45B4W\",\n    \"tags\": \"tag1,tag2\",\n    \"agent_email\":\"demoagent@email.com\",\n    \"document_details\": [\n        {\n            \"security_mode\": \"NACH\",\n            \"document_number\": \"757493\",\n            \"document_bank_name\": \"HDFC Bank\",\n            \"document_bank_ifsc_code\": \"\",\n            \"document_amount\": 50000,\n            \"document_date\": \"2018-04-10\",\n            \"document_dishonour_date\": \"2018-04-12\",\n            \"document_signature_name\": \"\",\n            \"document_bounce_bank_account_number\": \"\",\n            \"document_bounce_bank_ifsc_code\": \"\",\n            \"document_bounce_charges\": null,\n            \"document_bounce_bank_name\": \"Yes Bank\",\n            \"document_bounce_bank_address\": \"\",\n            \"document_bounce_memo_date\": null,\n            \"reason_of_document_bounce\": \"\"\n            \"document_bounce_memo_reference_number\": \"\",\n            \"document_sequence_number\": \"\"\n        \"document_bounce_memo_return_date\": \"2018-02-21\"\n        }\n    ],\n    \"business_name\": \"\",\n    \"applicant_address\": [\n        {\n            \"applicant_address_type\": \"Home\",\n            \"applicant_address_text\": \" 395/13 veer dua colony baldev nager\",\n            \"applicant_state\": \"Rajasthan\",\n            \"applicant_landmark\": \"\",\n            \"applicant_city\": \"Jodhpur\",\n            \"applicant_pincode\": 342001\n        }\n    ],\n    \"defaults\": [\n        {\n    \"allocation_month\":\"2021-7-01\",\n            \"total_claim_amount\": 113000,\n            \"late_fee\": 59443,\n            \"date_of_default\": \"2019-04-07\",\n            \"expected_emi\": 54000,\n            \"default_emi_number\": 12,\n            \"settlement_amount\": 45000,\n            \"client_amount_recovered\": 0,\n            \"principal_outstanding_amount\": 45000,\n            \"expected_emi_interest_amount\": null,\n            \"expected_emi_principal_amount\": 45000,\n            \"other_penalty\": null\n        }\n    ],\n    \"co_applicant\": [\n        {\n            \"co_applicant_name\": \"Naveen Shekhawat\",\n            \"co_applicant_type\": \"Individual\",\n        \"co_applicant_email\": \"pravinsingh@gmail.com\",\n            \"co_applicant_gender\": \"Male\",\n            \"co_applicant_contact_number\": \"9814274470\",\n            \"co_applicant_dob\": \"1990-06-29\",\n            \"co_applicant_address\": [\n        {\n        \"co_applicant_address_text\": \"\",\n        \"co_applicant_address_type\": \"Home\",\n        \"co_applicant_state\": \"Rajasthan\",\n        \"co_applicant_city\": \"Alwar\",\n        \"co_applicant_pincode\": 301024\n        }\n    ],\n    \"references\": [\n        {\n            \"relation_with_applicant\": \"Colleague\",\n            \"name\": \"Abhishek Kumar\",\n            \"contact_number\": \"8802913432\"\n        }\n    ],\n    \"merchant_name\": \"Intellipaat\",\n    \"payment_link\": \"https://rzp.io/i/itKAy2q\",\n \"payment_link_expiry\": 1627390971\n}"
headers = {
  'authenticationtoken': '{auth_token}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request POST '{BASE_URL}/loan/{transaction_id}' \
--header 'authenticationtoken: {auth_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "client_customer_id": "189004",
  "transaction_id": "283921",
  "loan_type": "Personal Loan",
  "applicant_name": "Shri Ram",
  "applicant_dob": "1992-03-23",
  "applicant_email": "shriram@gmail.com",
  "applicant_gender": "Male",
  "applicant_contact_number": "9805265926",
  "applicant_monthly_income": 40000,
  "applicant_cibil_score": 820,
  "applicant_occupation": "Job",
  "applicant_aadhar_number": "235498671293",
  "applicant_language": "hi",
  "applicant_pan_number": "ADJIY-3516-D",
  "total_loan_amount": 50000,
  "loan_tenure": 12,
  "client_loan_sanction_date": "2018-04-06",
  "loan_end_date": "2019-04-06",
  "interest_on_loan": 18,
  "tenure_finished": true,
  "security_type": "Secured immovable",
  "backed_by_surety": false,
  "loan_nbfc_name": "AKARA CAPITAL ADVISORS PVT. LTD.",
  "loan_nbfc_cin": "U65191TN1994PLC079235",
  "emi_amount": 6000,
  "product_type": "",
  "credit_account_number": "11271000005809",
  "credit_account_holder_name": "Sri Ram",
  "credit_bank_name": "HDFC Bank",
  "credit_account_holder_type": "Current",
  "credit_bank_ifsc_code": "HDFC0G45B4W",
  "tags": "tag1,tag2",
  "agent_email": "demoagent@email.com,demoagent2@email.com",
  "document_details": [
    {
      "security_mode": "NACH",
      "document_number": "757493",
      "document_bank_name": "HDFC Bank",
      "document_bank_ifsc_code": "",
      "document_amount": 50000,
      "document_date": "2018-04-10",
      "document_dishonour_date": "2018-04-12",
      "document_signature_name": "",
      "document_bounce_bank_account_number": "",
      "document_bounce_bank_ifsc_code": "",
      "document_bounce_charges": null,
      "document_bounce_bank_name": "Yes Bank",
      "document_bounce_bank_address": "",
      "document_bounce_memo_date": null,
      "reason_of_document_bounce": "",
      "document_bounce_memo_reference_number": "",
      "document_sequence_number": "",
      "document_bounce_memo_return_date": "2019-06-23"
    }
  ],
  "business_name": "",
  "applicant_address": [
    {
      "applicant_address_type": "Home",
      "applicant_address_text": " 395/13 veer dua colony baldev nager",
      "applicant_state": "Rajasthan",
      "applicant_city": "Jodhpur",
      "applicant_landmark": "",
      "applicant_pincode": 342001
    }
  ],
  "defaults": [
    {
      "allocation_month": "2021-7-01",
      "total_claim_amount": 113000,
      "late_fee": 59443,
      "date_of_default": "2019-04-07",
      "expected_emi": 54000,
      "default_emi_number": 12,
      "settlement_amount": 45000,
      "client_amount_recovered": 0,
      "principal_outstanding_amount": 45000,
      "expected_emi_interest_amount": null,
      "expected_emi_principal_amount": 45000,
      "other_penalty": null
    }
  ],
  "co_applicant": [
    {
      "co_applicant_name": "Naveen Shekhawat",
      "co_applicant_type": "Individual",
      "co_applicant_email": "pravinsingh@gmail.com",
      "co_applicant_gender": "Male",
      "co_applicant_contact_number": "9814274470",
      "co_applicant_dob": "1990-06-29",
      "co_applicant_address": [
        {
          "co_applicant_address_text": "",
          "co_applicant_address_type": "Home",
          "co_applicant_state": "Rajasthan",
          "co_applicant_city": "Alwar",
          "co_applicant_pincode": 301024
        }
      ]
    }
  ],
  "references": [
    {
        "relation_with_applicant": "Colleague",
        "name": "Abhishek Kumar",
        "contact_number": "8802913432"
    }
  ],
  "merchant_name": "Intellipaat",
  "payment_link": "https://rzp.io/i/itKAy2q",
  "payment_link_expiry": 1627390971
}'
var myHeaders = new Headers();
myHeaders.append("authenticationtoken", "{auth_token}");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({"client_customer_id":"189004","transaction_id":"283921","loan_type":"Personal Loan","applicant_name":"Shri Ram","applicant_dob":"1992-03-23","applicant_email":"shriram@gmail.com","applicant_gender":"Male","applicant_contact_number":"9805265926","applicant_monthly_income":40000,"applicant_cibil_score":820,"applicant_occupation":"Job","applicant_aadhar_number":"235498671293","applicant_language":"hi","applicant_pan_number":"ADJIY-3516-D","total_loan_amount":50000,"loan_tenure":12,"client_loan_sanction_date":"2018-04-06","loan_end_date":"2019-04-06","interest_on_loan":18,"tenure_finished":true,"security_type":"Secured immovable","backed_by_surety":false,"loan_nbfc_name":"AKARA CAPITAL ADVISORS PVT. LTD.","loan_nbfc_cin":"U65191TN1994PLC079235","emi_amount":6000,"product_type":"","credit_account_number":"11271000005809","credit_account_holder_name":"Sri Ram","credit_bank_name":"HDFC Bank","credit_account_holder_type":"Current","credit_bank_ifsc_code":"HDFC0G45B4W","tags":"tag1,tag2","agent_email":"demoagent@email.com","document_details":[{"security_mode":"NACH","document_number":"757493","document_bank_name":"HDFC Bank","document_bank_ifsc_code":"","document_amount":50000,"document_date":"2018-04-10","document_dishonour_date":"2018-04-12","document_signature_name":"","document_bounce_bank_account_number":"","document_bounce_bank_ifsc_code":"","document_bounce_charges":null,"document_bounce_bank_name":"Yes Bank","document_bounce_bank_address":"","document_bounce_memo_date":null,"reason_of_document_bounce":"","document_bounce_memo_reference_number":"","document_seqeunce_number":"","document_bounce_memo_return_date": "2019-06-23"}],"business_name":"","applicant_address":[{"applicant_address_type":"Home","applicant_address_text":" 395/13 veer dua colony baldev nager","applicant_state":"Rajasthan","applicant_city":"Jodhpur","applicant_landmark": "","applicant_pincode":342001}],"defaults":[{"allocation_month":"2021-7-01","total_claim_amount":113000,"late_fee":59443,"date_of_default":"2019-04-07","expected_emi":54000,"default_emi_number":12,"settlement_amount":45000,"client_amount_recovered":0,"principal_outstanding_amount":45000,"expected_emi_interest_amount":null,"expected_emi_principal_amount":45000,"other_penalty":null}],"co_applicant":[{"co_applicant_name":"Naveen Shekhawat","co_applicant_type":"Individual","co_applicant_email":"pravinsingh@gmail.com","co_applicant_gender":"Male","co_applicant_contact_number":"9814274470","co_applicant_dob":"1990-06-29","co_applicant_address": [{"co_applicant_address_text": "","co_applicant_address_type": "Home","co_applicant_state": "Rajasthan","co_applicant_city": "Alwar","co_applicant_pincode": 301024}]}],"references":[{"relation_with_applicant":"Colleague","name":"Abhishek Kumar","contact_number":"8802913432"}],"merchant_name":"Intellipaat","payment_link":"https://rzp.io/i/itKAy2q", "payment_link_expiry": 1627390971});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{BASE_URL}/loan/{transaction_id}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The above command returns JSON structured like this:

{
  "output": "Transaction added successfully",
  "message": "success",
  "headers": {
    "Content-Type": "application/json"
  }
}

Use this API to add new transaction / EMI of any customer.

HTTP Request - POST

POST {BASE_URL}/loan/{transaction_id}

Path Parameters

Parameter Description
transaction_id Transaction id of the transaction to upload

Request Headers

Parameter Description
authenticationtoken Auth token given by Credgenics
Content-Type application/json

Response Status Code

201 OK for a successful request.

401 Unauthorized if authentication failed. API credentials are incorrect.

400 Bad Request if the request payload had some error. Specific error is provided in the response.

Update Transaction API

import requests

url = "{BASE_URL}/transaction/{client_customer_id}/{transaction_id}"

payload = "{\n    \"total_loan_amount\": 60000\n}"
headers = {
  'authenticationtoken': '{auth_token}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request PATCH '{BASE_URL}/transaction/{client_customer_id}/{transaction_id}' \
--header 'authenticationtoken: {auth_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "total_loan_amount": 60000
}'
var myHeaders = new Headers();
myHeaders.append("authenticationtoken", "{auth_token}");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({"total_loan_amount":60000});

var requestOptions = {
  method: 'PATCH',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{BASE_URL}/transaction/{client_customer_id}/{transaction_id}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The above code returns JSON structured like this:

{
  "output": "Transaction updated successfully",
  "message": "success",
  "headers": {
    "Content-Type": "application/json"
  }
}

Use this API to update the details of any transaction of a customer.

HTTP Request - PATCH

PATCH {BASE_URL}/transaction/{client_customer_id}/{transaction_id}

Path Parameters

Parameter Description
client_customer_id Customer id of the customer
transaction_id Transaction_id of the transaction to update

Request Headers

Parameter Description
authenticationtoken Auth token given by Credgenics
Content-Type application/json

Response Status Code

200 OK for a successful request.

401 Unauthorized if authentication failed. API credentials are incorrect.

400 Bad Request if the request payload had some error. Specific error is provided in the response.

Update Payment API

import requests
import json
url = "{BASE_URL}/payments/{transaction_id}?allocation_month={allocation_month}"

payload=json.dumps({
  "client_customer_id":"189004",
  "amount_recovered": 1000,
  "recovery_date": "2022-01-08",
  "recovery_method": "Communications",
  "recovered_by": "shriram@gmail.com",
  "payment_method": "Cheque",
  "closure_with": "NOC",
  "payment_mode": "cash",
  "payment_reference_number": "RFN123456",
  "payment_received_date" : "2022-01-12"
})
headers = {
  'authenticationtoken': '{auth_token}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request PATCH '{BASE_URL}/payments/{transaction_id}?allocation_month={allocation_month}' \
--header 'authenticationtoken: {auth_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "client_customer_id": "189004",
    "amount_recovered": 1000,
    "recovery_date": "2022-01-08",
    "recovery_method": "Communications",
    "recovered_by": "shriram@gmail.com",
    "payment_method": "Cheque",
    "closure_with": "NOC",
    "payment_mode": "cash",
    "payment_reference_number": "RFN123456",
    "payment_received_date" : "2022-01-12"
}'
var myHeaders = new Headers();
myHeaders.append("authenticationtoken", "{auth_token}");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "client_customer_id":"189004",
  "amount_recovered": 1000,
  "recovery_date": "2022-01-08",
  "recovery_method": "Communications",
  "recovered_by": "shriram@gmail.com",
  "payment_method": "Cheque",
  "closure_with": "NOC",
  "payment_mode": "cash",
  "payment_reference_number": "RFN123456",
  "payment_received_date" : "2022-01-12"
});

var requestOptions = {
  method: 'PATCH',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{BASE_URL}/payments/{transaction_id}?allocation_month={allocation_month}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The above code returns JSON structured like this:

{
  "output": "Data updated successfully",
  "message": "success",
  "headers": {
    "Content-Type": "application/json"
  }
}

Use this API to update the payment details of a customer. This API will create a new entry corresponding to transaction_id.

HTTP Requests - PATCH

PATCH {BASE_URL}/payments/{transaction_id}?allocation_month={allocation_month}

Path Parameters

Parameter Description
transaction_id Transaction id of the recovered transaction
allocation_month Allocation month of the recovered loan. Eg - "2021-2-01"

Example Json for Recovery Amount Bifurcation

{ 
    "client_customer_id": "189004",
    "amount_recovered": 2200,
    "date_of_default": "2022-05-07",
    "recovery_date": "2022-06-02 09:30:00",
    "recovery_method": "Field collection",
    "payment_method": "Cash",
    "recovered_expected_emi": 2000, //recovery amount bifurcation key
    "recovered_late_fee": 100, //recovery amount bifurcation key
    "recovered_penalty": 100 //recovery amount bifurcation key
}

Enabling Recovery Amount Bifurcation can be achieved through Company Details tab on Setting page.

Steps:

  1. Log in to the platform
  2. Navigate to the Company details tab in settings page
  3. Select Variable tab in Company details
  4. Under Recovery Variables, enable Recovered Amount Bifurcation.

After enabling recovery amount bifurcation, you can add the desired bifurcation variables using Add variable option.

Once the variables are added, you need to add recovered_ as a prefix to all bifurcation variables and add them in the payload at the top-level keys.

For example: if you add late_fee as a bifurcation variable, then the payload key format will be recovered_late_fee

Request Headers

Parameter Description
authenticationtoken The authentication token assigned to you by Credgenics
Content-Type "application/json"

Request Body Parameters

Key Name Type Required Description
client_customer_id string True Client customer id of the customer.
amount_recovered integer True Total amount received in a given payment
recovery_method string False The recovery method that was used to recover a given payment from the borrower (Options: Field Collection, Communication, Legal)
payment_method string True The method of payment that was used to complete the transfer of money (Options: Online, Cash, Cheque, Bank Account Transfer, Application, Payment Link)
payment_received_date date False The date on which the payment was actually received in the lenders account after processing of payment by the payment processor
closure_with string False In cases where the recovery status is 'Closed', it needs to be specified whether the loan was settled or a complete recovery was made (Options: NOC, Settlement)
payment_reference_number string False The unique reference number generated by the payment processor at the time of execution of payment e.g. UPI transaction ID
payment_mode string False The mode of payment that was used to complete the transfer of money e.g. UPI, NEFT, RTGS etc.
recovered_by string False The name of the user that collected the payment, in case of agent it will be the name, otherwise it will be name of the API
recovery_date datetime False This is the date on which the recovery was made by the agent/channel i.e. it has been updated on CG system that the recovery has been done. This date might differ from the actual date on which the payment was received from the borrower.

Response Status Code

200 OK for a successful request.

401 Unauthorized if authentication failed. API credentials are incorrect.

400 Bad Request if the request payload had some error. Specific error is provided in the response.

Webhook

A webhook (also called a web callback or HTTP push API) is a way for an application to provide other applications with real-time information. Credgenics webhook delivers data to your applications as soon as an event occurs, meaning you get data immediately. Unlike typical APIs where you would need to poll for data very frequently in order to get it real-time. This makes webhooks much more efficient for both Credgenics and Clients.

This documentation will detail configuring webhooks, as well as information about events, retry mechanism and response format.

Starting up with Webhook

When a specified event occurs, Credgenics's Webhook will notify a URL of your choice via HTTP POST with information about the event that occured on our platform, so you can take action and keep your business running smoothly.

Webhook Setup

Setting up a Webhook can be achieved through Event Webhook page on Settings Navigation Bar in the portfolio.

Steps are:

  1. Log in to the platform
  2. Navigate to Event webhook tab on the left sidebar.
  3. Configure the HTTP POST API and select the event on which you want to trigger the Webhook
  4. Save the details

Webhook Events

Event webhooks can be triggered by several types of events:

Digital Communications

Json response structure

{
  "loan_id": "1137",
  "event": "email",
  "data": {
    "response": [
      {
        "error": null,
        "shoot_id": "9018f9bcab894a7f8e36143eb90acc72",
        "to": "prasad@yopmail.com",
        "applicant_type": "applicant",
        "transaction_id": null,
        "success": true,
        "status_code": 200,
        "cc": "sagciusdy@yopmail.com",
        "from": "Analog Fintech Credgenics Trademarks <info@credgenics.com>",
        "email_reply_to": "info@credgenics.com",
        "email_body": "test email<br/>",
        "email_subject": "1137_test",
        "template_name": "test",
        "triggered_time": "2022-12-29 17:38:54.572208"
      }
    ],
    "allocation_month": "2022-12-01",
    "author": "test@credgenics.com"
  },
  "event_id": "3a18f534edf3498eb79c9447d8e7466b"
}

KEYS TYPE DESCRIPTION
loan_id String Loan id of the loan
allocation_month String Month in which loan was allocated
author String Email address of the sender of the email
triggered_time Integer Time when email was triggered
Communication keys
from String The 'From' email address used to deliver the message.
to String The intended recipient's email address.
cc String Recipients who will receives a copy of the email.
email_subject String The Subject of the email
email_body String Content of the email
email_reply_to String Recipients who will receive replies and/or bounces.
template_name String Template selected for the email.
applicant_type String Type of the applicant
error Object
error String Specific error if email failed
notice_link String Notice Link
notice_type String Type of notice sent
notice_type_map Object Object of notice types sent in the email

Json response structure

{
  "loan_id": "1137",
  "event": "sms",
  "data": {
    "response": [
      {
        "applicant_type": "applicant",
        "transaction_id": null,
        "to": "9999999999",
        "error": null,
        "success": true,
        "status_code": 200,
        "shoot_id": "fd80b0c1824b41808fe2e95b2a85d3d7",
        "sms_body": "Test sms",
        "sms_language": "en",
        "template_name": "LRN-DLT",
        "client_template_id": "1107161827754551896",
        "triggered_time": "2022-12-29 17:36:14.374311"
      }
    ],
    "allocation_month": "2022-12-01",
    "author": "test@credgenics.com"
  },
  "event_id": "2cf0e0c61ee449b4b1c13cb206f8afcf"
}
KEYS TYPE DESCRIPTION
loan_id String Loan id of the loan
allocation_month String Month in which loan was allocated
author String Sender of the sms
triggered_time Integer Time when sms was triggered
Communication keys
to String Mobile number of receiver
sms_body String Text of the message that will be sent.
sms_language String Language of sms selected while triggering sms
applicant_type String Type of the applicant
client_template_id String Template ID of the client
template_name String Name of the selected sms template
error Object
error_code String Specific error code if sms failed

Json response structure

{
  "loan_id": "1137",
  "event": "voice",
  "data": {
    "response": [
      {
        "applicant_type": "applicant",
        "transaction_id": null,
        "to": "9999999999",
        "error": null,
        "success": true,
        "status_code": 200,
        "shoot_id": "e15ae043d1a242479d4c24d5e2df34e9",
        "voice_body": "test message",
        "voice_language": "en-in",
        "voice_gender": "female",
          "template_name": "English Language",
        "triggered_time": "2022-12-29 17:40:35.081658"
      },
      {
        "applicant_type": "co_applicant",
        "transaction_id": null,
        "to": "8888888888",
        "error": null,
        "success": true,
        "status_code": 200,
        "shoot_id": "01cf64e7e530460bbac4d23cf1d7caef",
        "voice_body": "test message",
        "voice_language": "en-in",
        "voice_gender": "female",
        "template_name": "English Language",
        "triggered_time": "2022-12-29 17:40:35.082180"
      }
    ],
    "allocation_month": "2022-12-01",
    "author": "test@credgenics.com"
  },
  "event_id": "93996126a3db4065bb58f220e6c738ba"
}
KEYS TYPE DESCRIPTION
loan_id String Loan id of the loan
allocation_month String Month in which loan was allocated
author String Sender of the voice message
triggered_time Integer Time when voice message was triggered
Communication keys
to String Mobile number of receiver
voice_body String Body of the voice message
voice_language String Language selected while triggering the voice message
voice_gender String Gender selected for voice message
template_name String Name of the selected voice message template
applicant_type String Type of the applicant

Json response structure

{
  "loan_id": "1137",
  "event": "whatsapp",
  "data": {
    "response": [
      {
        "applicant_type": "applicant",
        "transaction_id": null,
        "to": "9999999999",
        "error": null,
        "success": true,
        "status_code": 200,
        "shoot_id": "db9a14653c6448b3b16e0ff71a9f8624",
        "whatsapp_body": "Hi, this is test message",
        "client_template_id": "6416443",
        "template_name": "Test Template",
        "triggered_time": "2022-12-29 18:04:19.772659"
      },
      {
        "applicant_type": "co_applicant",
        "transaction_id": null,
        "to": "8888888888",
        "error": null,
        "success": true,
        "status_code": 200,
        "shoot_id": "9bda951889364bfc9fb5725d9fb56080",
        "whatsapp_body": "Hi, this is test message",
        "client_template_id": "6416443",
        "template_name": "Test Template",
        "triggered_time": "2022-12-29 18:04:19.773291"
      }
    ],
    "allocation_month": "2022-12-01",
    "author": "test@credgenics.com"
  },
  "event_id": "f59a7c4897ca4741958684851601f34a"
}

Json response structure

{
  "loan_id": "1070",
  "event": "calling",
  "data": {
    "Campaign Name": "CN800",
    "Campaign ID": "f545eaac-d296-4831-9002-055e90f2ded1",
    "Loan ID": "1070",
    "DPD Bucket": null,
    "Allocation Month": "2023-5-01",
    "call type": "manual",
    "Agent Name": "prk38",
    "Agent Email ID": "Agent@gmail.com",
    "DID Number": "65752148",
    "Shoot ID": "fe2cebdb-422b-4c25-aedd-62bd284e21fe",
    "Call Start Time": "2023-05-15 17:43:08",
    "Customer Leg Ringing Start Time": "2023-05-15 17:43:09",
    "Customer Leg Ringing End Time": "2023-05-15 17:43:17",
    "Agent Leg Ringing Start Time": "2023-05-15 17:43:09",
    "Agent Leg Ringing End Time": "2023-05-15 17:43:09",
    "Total Ringing Time Duration": "00:00:08",
    "Customer Call Pickup Time": "2023-05-15 17:43:17",
    "Agent Call Pickup Time": "2023-05-15 17:43:09",
    "Call End Time": "2023-05-15 17:43:21",
    "Total Talk Time Duration": "00:00:03",
    "Total Call Duration": "00:00:13",
    "Customer Wait Duration": "00:00:03",
    "Wrapup Start Time": "2023-05-15 17:43:21",
    "Wrapup End Time": "2023-05-15 17:43:25",
    "Wrapup Duration": "00:00:04",
    "Call Disconnected By": "customer",
    "Call Disconnection Stage": "After Customer Picked",
    "Call Status": "Answered",
    "Disposition": "Confirmation Pending",
    "Sub Disposition 1": "",
    "Sub Disposition 2": "",
    "Dialer Disposition": "Normal Clearing",
    "Call Transfer From": null,
    "Call Transfer To": null,
    "Call Transfer Type": null,
    "Call Response": "",
    "Reminder Date": null,
    "Committed Amount": 0,
    "Role": "calling",
    "recording_link": "https://app.credgenics.com/dialer/recording?id=fe2cebdb-422b-4c25-aedd-62bd284e21fe",
    "Due Date": null,
    "Allocation Date": null,
    "Account Id": "Shiva_70"
  },
  "event_id": "PfsySX37tyLeYrGU"
}
KEYS TYPE DESCRIPTION
Loan ID String Loan ID to which the contacted number was associated to
Campaign Name String Name of the campaign in which the call was made.
Campaign ID String Unique ID of the campaign in which the call was made.
DPD Bucket String Allocated DPD bucket of the loan to which the call was made.
Allocation Month String Allocation month of the loan in which call was made.
call type String Type of call includes the following call types:
1. autodialer
2. autodialer_dialpad
3. autodialer_dialpad_redial
4. autodialer_manual
5. autodialer_manual_redial
6. autodialer_redial
7. autodialer_tpd
8. click_to_call
9. gsm
10. manual
11. predictive
12. predictive_manual
13. reminder
Agent Name String Name of the agent that attended the call.
Agent Email ID String Email of the agent that attended the call.
DID Number String DID number through which the call was dialed to the customer.
Shoot ID String Unique ID for the call.
Call Start Time String Date/time at which call was placed/received
YYYY-MM-DD HH:MM:SS
Customer Leg Ringing Start Time String Time at which customer ringing started
YYYY-MM-DD HH:MM:SS
Customer Leg Ringing End Time String Time at which customer ringing ended
YYYY-MM-DD HH:MM:SS
Agent Leg Ringing Start Time String Time at which agent ringing started
YYYY-MM-DD HH:MM:SS
Agent Leg Ringing End Time String Time at which agent ringing ended
YYYY-MM-DD HH:MM:SS
Call End Time String Time at which customer/agent cut the call or ring timeout happened
YYYY-MM-DD HH:MM:SS
Total Talk Time Duration String Total time for which the customer and the agent were connected over call
HH:MM:SS
Total Call Duration String Customer leg ring start time - Call end time
HH:MM:SS
Customer Wait Duration String Customer leg ring end time - Agent leg ring end time
HH:MM:SS
Wrapup Start Time String Call end time
YYYY-MM-DD HH:MM:SS
Wrapup End Time String Timestamp at which the disposition was submitted
YYYY-MM-DD HH:MM:SS
Wrapup Duration String Wrapup Start Time - Wrapup End Time
HH:MM:SS
Call Disconnected By String Reason due to which the call was disconnected:
1. agent
2. agent_refresh
3. conference
4. customer
5. network
6. send_cancel
7. system
Call Disconnection Stage String Call stage when the call was disconnected. It contains the following values:
1. Before customer picked the call
2. After customer picked the call
3. After agent picked the call
Call Status String Call status defines what happened with that call. It contains the following values:
1. Failed Calls - Calls where the customer side ring did not happen, number was switched off or invalid number, etc.
2. Connected Calls - Calls where customer side ring happened
3. Answered Calls - When a customer pick up the call and it is redirected back to the agent, if the agent also picks the call and both parties are connected then it is an answered call.
4. Missed Calls - When a customer is already online and they disconnect the call before the agent picks it up, then it is missed call.
5. Abandoned Calls - If Customer is already on line and no agent is available to take the call and the customer disconnects, then it is an abandoned call.
Disposition String Disposition submitted by the agent user.
Sub Disposition 1 String Sub Disposition 1 if any submitted by the agent user.
Sub Disposition 2 String Sub Disposition 2 if any submitted by the agent user.
Dialer Disposition String Dialer disposition is received from telco that tells the further bifurcation after the call status. Values and explanations can be accessed at the link attached.
https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Troubleshooting-Debugging/Hangup-Cause-Code-Table_3964945/
Call Transfer From String If Call transfer was triggered, then the user from which the call was transferred.
Call Transfer To String If Call transfer was triggered, then the user to which call was transferred.
Call Transfer Type String Call transfer type includes transfer or conference option selected while transferring the call.
Call Response String Call response submitted by the agent in the disposition form.
Reminder Date String Reminder timestamp submitted by the agent in the disposition form.
YYYY-MM-DD HH:MM:SS
Committed Amount Integer The committed amount submitted by the agent in the disposition form.
Role String Role of the agent who took the call.
Due Date String Due date added to the loan.
recording_link String CG link to access the call recording.
Allocation Date String Allocation date of the loan.
Account Id String Customer ID associated to the loan

Payments

Json response structure for payments

{
 "event": "payment",
 "data": {
      "loan_id": "2954",
      "amount_recovered": 2000,
      "recovery_status": "Partially Recovered",
      "source": "manual",
      "recovery_method": "Field collection",
      "payment_method": "Online",
      "payment_mode": "Paytm",
      "reference_number": "RIO2390",
      "closure_with": "",
      "recovery_date": "2021-09-12 00:59:51",
      "allocation_month": "2021-6-01",
      "author": "demo.admin@credgenics.com"
    },
 "created": "2021-05-15 18:44:15"
}

Payment event webhook is triggered when any amount gets recovered against a loan.

KEYS TYPE DESCRIPTION
loan_id string Loan ID of the loan
amount_recovered integer Amount recovered from the customer.
recovery_status string The recovery status is calculated automatically on the basis of ‘total_claim_amount’ and ‘total_recovered_amount’. It can have 3 values, which can be either 'Not Recovered', 'Partially Recovered' or 'Fully Recovered'.
recovery_method string Recovery method of the loan.
source string Used to identify which all sources the payment came from i.e. 'api' , 'manual' or 'excel'.
payment_method string Method by which the payment has been made.
payment_mode string Mode of payment used.
closure_with string Choice of closure - NOC, Settlement
recovery_date date Date of recovery
allocation_month date Month in which loan was uploaded Eg : "2021-7-01"
reference_number string Reference number of the payment
author string Email of the Author of the payment

FOS

Json response structure for collections

{
  "event": "fos_collection",
  "data": {
    "loan_id": "saumya5",
    "allocation_month": "2023-3-01",
    "visit_id": "3gQeOIezoJ2L",
    "agent_email": "saumya1234@yopmail.com",
    "agent_name": "saumya",
    "agent_mobile": "9879879876",
    "visit_date": "2023-04-11",
    "visit_purpose": "Surprise Visit",
    "is_visit_done": true,
    "is_customer_met": true,
    "is_recovery_done": true,
    "agent_marked_status": "Partially Recovered by Agent",
    "amount_recovered": 15.0,
    "collection_receipt_url": "https://urlshortner.dev.credgenics.com/a9DZAtsu",
    "payment_method": "Cash",
    "payment_reference_number": "eQUwuvJJIXKJ",
    "payment_proof_url": "https://dev-credgenics-cases.s3.ap-south-1.amazonaws.com/loan_documents/707ed0de-d8e4-4af4-bfab-687c0d1025a4/XTH2feqvylZx_2023-04-11 12:54:25.971570.jpeg",
    "amount_bifurcation": {},
    "visit_coordinates": {
      "latitude": 28.5779155,
      "longitude": 77.3182631
    },
    "borrower_address": "Captain Vijyant Thapar Marg, Noida Sector 18, Pocket E, Sector 27",
    "comment": "1234",
    "is_manual": false,
    "source_app": "CG_Collect",
    "employee_id": null,
    "payment_details": {}
  },
  "created": "2023-04-11 12:54:26",
  "company_id": "707ed0de-d8e4-4af4-bfab-687c0d1025a4",
  "company_trademark": "Status FOS test",
  "event_id": "3rUmOz3x"
}
KEYS TYPE DESCRIPTION
loan_id String Loan id of the loan
allocation_month String Month in which loan was allocated
visit_id String Unique id of the visit
agent_email String Email id of the agent
agent_name String Name of the agent
visit_date String Date of visit
visit_purpose String Purpose of the visit (Surprise or Promise to Pay)
is_visit_done Boolean True if visit was completed. Else,false.
is_customer_met Boolean True if customer was met. Else,false.
is_recovery_done Boolean True if recovery was done. Else,false.
agent_marked_status String Status of loan marked by agent
amount_recovered Float Amount recovered during the visit
collection_receipt_url String Link to collection receipt
payment_method String Mode of payment used for collection
payment_reference_number String Unique id of the payment
payment_proof_url String URL of the payment proof
amount_bifurcation Object Bifurcation of the amount recovered
visit_coordinates Object Coordinates of the visit location
borrower_address String Address of the borrower
comment String Comment added by the agent
source_app String Source application for the Webhook event("CG_Collect")
employee_id String Employee ID of the agent
is_manual String Flag indicating whether the bifurcation was done manually
payment_details Object Extra details of the payment

Json response structure for FOS deposits where Branch Type is 'bank'

{
  "event": "fos_deposit",
  "data": {
    "deposit_id": "qDz4kjlkCd8b",
    "agent_email": "saumya1234@yopmail.com",
    "agent_name": "saumya",
    "agent_mobile": "9879879876",
    "total_amount": 15.0,
    "deposit_method": "cash",
    "recovery_method": "cash",
    "employee_id": null,
    "branch_type": "bank",
    "branch_details": {
      "bank_code": "SBIBNK007",
      "bank_name": "SBI BANK",
      "ifsc_code": "SBIN0005943",
      "branch_name": "Sector 12",
      "account_name": "Saumya Bhatnagar",
      "account_type": "Current",
      "account_number": "816293528202"
    },
    "deposit_receipt_no": "6282893",
    "deposit_proof_url": "https://dev-credgenics-cases.s3.ap-south-1.amazonaws.com/fos_deposit_proofs/fkkntJeJ85NQ.jpeg",
    "loan_data": [
      {
        "loan_id": "saumya5",
        "amount": 15.0,
        "visit_id": "3gQeOIezoJ2L",
        "payment_reference_number": "eQUwuvJJIXKJ"
      }
    ],
    "branch_manager_details": {

    }
  },
  "created": "2023-04-11 12:55:38",
  "company_id": "707ed0de-d8e4-4af4-bfab-687c0d1025a4",
  "company_trademark": "Status FOS test",
  "event_id": "2iaObWdZ"
}

Json response structure for FOS deposits where Branch Type is 'company'

{
  "event": "fos_deposit",
  "data": {
    "deposit_id": "GJq0ea5duTQU",
    "agent_email": "saumya1234@yopmail.com",
    "agent_name": "saumya",
    "agent_mobile": "9879879876",
    "total_amount": 101.0,
    "deposit_method": "cash",
    "recovery_method": "cash",
    "employee_id": null,
    "branch_type": "company",
    "branch_details": {
      "branch_address": "SBI delhi",
      "branch_code": "AMN123",
      "branch_contact_number": "1234567890",
      "branch_name": "SBIIN1212",
      "branch_manager_id": "xcd1234opkq5"
    },
    "deposit_receipt_no": "123456890",
    "deposit_proof_url": "https://dev-credgenics-cases.s3.ap-south-1.amazonaws.com/fos_deposit_proofs/OxGHcldqmD1h.jpeg",
    "loan_data": [
      {
        "loan_id": "saumya5",
        "amount": 101.0,
        "visit_id": "7i3J8k0RHrOZ",
        "payment_reference_number": "u8TEB2tso8CX"
      }
    ],
    "branch_manager_details": {
      "branch_code": "AMN123",
      "client_employee_id": "1234599",
      "name": "yashpal",
      "email": "saumya123@yopmail.com",
      "mobile": "90123121212",
      "department": "bank5"
    }
  },
  "created": "2023-04-12 18:05:11",
  "company_id": "707ed0de-d8e4-4af4-bfab-687c0d1025a4",
  "company_trademark": "Status FOS test",
  "event_id": "8Pxwh3WS"
}
KEYS TYPE DESCRIPTION
deposit_id String Unique id of the deposit
agent_email String Email id of the agent
agent_name String Name of the agent
total_amount Float Amount deposited by agent
deposit_method String Method used for deposit (e.g., Cash, Cheque, Online )
recovery_method String Method used for recovering the deposit (e.g., Cash, Cheque, Online )
branch_type String Type of branch where deposit was made (e.g.,airtel, company,bank)
employee_id String Identifier for the client employee, if applicable
branch_details Object Details of branch in which deposit was made
deposit_receipt_no String Unique id of the deposit receipt
deposit_proof_url String Link to deposit proof
loan_data Object Details of loans on which deposit was made
branch_manager_details Object Details of the branch manager (if applicable)

Json response structure for FOS Deposit Verification

{
  "event": "fos_deposit_verification",
  "data": {
    "deposit_id": "cAPe2O8erBYi",
    "agent_email": "saumya1234@yopmail.com",
    "agent_name": "saumya ",
    "total_amount": 1,
    "deposit_method": "cash",
    "recovery_method": "cash",
    "branch_type": "bank",
    "branch_details": {
      "bank_code": "SBIBNK007",
      "bank_name": "SBI BANK",
      "ifsc_code": "SBIN0005943",
      "branch_name": "Sector 12",
      "account_name": "Saumya Bhatnagar",
      "account_type": "Current",
      "account_number": "816293528202"
    },
    "deposit_receipt_no": "Drisi tn",
    "deposit_proof_url": "https://dev-credgenics-cases.s3.ap-south-1.amazonaws.com/fos_deposit_proofs/2VOcjebxmghz.jpeg",
    "loan_data": [
      {
        "loan_id": "saumya2",
        "recovery_date": "2023-04-11 12:30:49",
        "allocation_month": "2023-3-01",
        "amount_recovered": -1.0,
        "payment_reference_number": "V6WEqGDYNYOQ",
        "payment_method": "Cash",
        "visit_id": "srTjd4ASs2hP",
        "agent_marked_status": "Partially Recovered by Agent"
      }
    ],
    "verification_remark": "hiiiiii",
    "verification_status": "rejected"
  },
  "created": "2023-04-11 17:04:55",
  "company_id": "707ed0de-d8e4-4af4-bfab-687c0d1025a4",
  "company_trademark": "Status FOS test",
  "event_id": "xn2Kd0jM"
}
KEYS TYPE DESCRIPTION
deposit_id String Unique id of the deposit
agent_email String Email id of the agent
agent_name String Name of the agent
total_amount Float Amount deposited by agent
deposit_method String Method used for deposit (e.g., Cash, Cheque, Online )
recovery_method String Method used for recovering the deposit (e.g., Cash, Cheque, Online )
branch_type String Type of branch where deposit was made (e.g.,airtel, company,bank)
employee_id String Identifier for the client employee, if applicable
branch_details Object Details of branch in which deposit was made
deposit_receipt_no String Unique id of the deposit receipt
deposit_proof_url String Link to deposit proof
loan_data Object Details of loans on which deposit was made
verification_remark String Remarks added for verification
verification_status String Status of Verification(approved,rejected)

Json response structure for FOS Online Deposit Verification

{
  "event": "fos_online_deposit_verification",
  "data": {
    "agent_name": "saumya",
    "loan_id": "saumya5",
    "visit_id": "1PSRb9RPHgrb",
    "amount_recovered": 1,
    "allocation_month": "2023-3-01",
    "verification_status": "approved",
    "verification_remark": "hguih",
    "payment_reference_number": "FGyAyywvsPOs",
    "verified_by": "mahipal",
    "payment_date": ""
  },
  "created": "2023-04-11 18:42:53",
  "company_id": "707ed0de-d8e4-4af4-bfab-687c0d1025a4",
  "company_trademark": "Status FOS test",
  "event_id": "jbhZzkqp"
}
KEYS TYPE DESCRIPTION
agent_name String Name of the agent
amount_recovered Float Amount recovered during the visit
deposit_method String Method used for deposit (e.g., Cash, Cheque, Online )
allocation_month String Month in which loan was allocated
verification_remark String Remarks added for verification
verification_status String Status of Verification(approved,rejected)
payment_reference_number String Payment reference number
verified_by String Name of person who has verified
payment_date String Date of payment

Json response structure for FOS Deposit Cancel(Airtel)

{
  "event": "fos_deposit_cancel",
  "data": {
    "deposit_id": "YZRHqCJLQvHJ",
    "agent_email": "testuser1@yopmail.com",
    "agent_name": "test user",
    "agent_mobile": "9879879876",
    "total_amount": 1,
    "deposit_method": "cash",
    "recovery_method": "cash",
    "employee_id": null,
    "branch_type": "airtel",
    "branch_details": {},
    "deposit_receipt_no": "1342",
    "deposit_proof_url": "",
    "loan_data": [
      {
        "loan_id": "saumya2",
        "amount": 1,
        "visit_id": "SRFpAdTbXcOY",
        "payment_reference_number": "ChhEAMV0S0R3"
      }
    ],
    "branch_manager_details": {}
  },
  "created": "2023-04-12 15:55:38",
  "company_id": "707ed0de-d8e4-4af4-bfab-687c0d1025a4",
  "company_trademark": "Status FOS test",
  "event_id": "XH63Fjcu"
}
KEYS TYPE DESCRIPTION
deposit_id String Unique id of the deposit
agent_email String Email id of the agent
agent_name String Name of the agent
agent_mobile String Mobile number of the agent
total_amount Float Amount deposited by agent
deposit_method String Method used for deposit (e.g., Cash, Cheque, Online )
recovery_method String Method used for recovering the deposit (e.g., Cash, Cheque, Online )
branch_type String Type of branch where deposit was made (e.g.,airtel, company,bank)
employee_id String Identifier for the client employee, if applicable
branch_details Object Details of branch in which deposit was made
deposit_receipt_no String Unique id of the deposit receipt
deposit_proof_url String Link to deposit proof
loan_data Object Details of loans on which deposit was made
verification_remark String Remarks added for verification
verification_status String Status of Verification(approved,rejected)

Universal communication API

Use this API to trigger communication event for a particular loan.

API authentication

Universal communication API is authenticated via a combination of authentication token and the role of that particular user who is trying to access the API.

You can request Credgenics for an authentication token. You need to replace {auth_token} in every request with the authentication token that you get from Credgenics.

API Base URL

For Production: https://apiprod.credgenics.com

For Testing: https://apiuat.credgenics.com

API HTTP Request - POST

POST {API_BASE_URL}/communication/trigger/event

API Request Headers

Parameter Description
authenticationtoken Auth token assigned by Credgenics
role Role of the user

API Request Body Parameters

import requests

url = "{API_BASE_URL}/communication/trigger/event"

payload = "{\n    \"allocation_month\": {allocation_month},\n    \"loan_id\": {loan_id},\n    \"company_id\": {company_id},\n    \"communication_level\": {communication_level},\n    \"source\" : {source},\n    \"event_name\": {event_name},\n    \"inbound_bot_id\": {inbound_bot_id},\n    \"send_to\" : {send_to},\n    “co_app_upto” : {co_app_upto} //optional field\n    “send_to_closed_acc” : {send_to_closed_acc} //optional field\n}"
headers = {
  'authenticationtoken': '{auth_token}',
  'role': '{role}',
  'content-type': 'application/json',
  'accept': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
curl --location --request POST '{API_BASE_URL}/communication/trigger/event' \
--header 'authenticationtoken: {auth_token}' \
--header 'role: {role}' \
--header 'content-type: application/json' \
--header 'accept: application/json' \
--data-raw '{
    "allocation_month": {allocation_month},
    "loan_id": {loan_id},
    "company_id": {company_id},
    "communication_level": {communication_level},
    "source" : {source},
    "event_name": {event_name},
    "inbound_bot_id": {inbound_bot_id},
    "send_to" : {send_to},
    “co_app_upto” : {co_app_upto} //optional field
    “send_to_closed_acc” : {send_to_closed_acc} //optional field
}'
var myHeaders = new Headers();
myHeaders.append("authenticationtoken", "{auth_token}");
myHeaders.append("role", "{role}");
myHeaders.append("content-type", "application/json");
myHeaders.append("accept", "application/json");

var raw = "{\n    \"allocation_month\": {allocation_month},\n    \"loan_id\": {loan_id},\n    \"company_id\": {company_id},\n    \"communication_level\": {communication_level},\n    \"source\" : {source},\n    \"event_name\": {event_name},\n    \"inbound_bot_id\": {inbound_bot_id},\n    \"send_to\" : {send_to},\n    “co_app_upto” : {co_app_upto} //optional field\n    “send_to_closed_acc” : {send_to_closed_acc} //optional field\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{API_BASE_URL}/communication/trigger/event", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The above code returns JSON structured like this:

{
    "message": "success",
    "output": "Successfully triggered  communication for event Test",
    "data": {
        "sms": "Successfully created sms communication",
        "email": "Successfully created email communication",
        "whatsapp": "Successfully created whatsapp communication"
    }
}
Key name Type Required Description
loan_id string True Loan id of the loan to which communication will be sent.
company_id string True Company_id of the loan corresponding to which communication will be sent.
inbound_bot_id string True Unique ID of the Bot from which the event is triggered.
allocation_month string True Date information of the loan where date is fixed to be “01”. Default value is “current_year -current_month-01” eg: "2021-8-01"
source string True Source of event.
event_name string True Name of event corresponding to which communication to be sent
send_to string True To whom communication needs to be sent.
Values Available:
valuedescription
applicantsend to only applicant
co_applicantsend to only co_applicant
bothsend to both applicant and co_applicant
communication_level String True “customer” for loan companies and “transaction” for creditline companies
co_app_upto integer False Used to define to how many co_applicants we need to send communication
send_to_closed_acc boolean False value can be either true or false. Used to define whether to send communication on closed loans or not.

API Response Status Code

201 OK for a successful request.

401 Unauthorized if authentication failed. API credentials are incorrect.

400 Bad Request if the request payload had some error. Specific error is provided in the response.

Errors

The Credgenics API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Authentication failed. API credentials are incorrect.
403 Forbidden -- You do not have permission to perform this action.
404 Not Found
405 Method Not Allowed -- You tried to access an endpoint with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.