php ruby python

Introduction

Welcome to the lending API for HomeCapital! You can use our API to automate your lending process with our API endpoints.

We have language bindings in Ruby, Python, and Php You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

For getting developer keys for UAT and Production environments, please drop an email to prasad@homecapital.in.

Authentication

# With shell, you can just pass the correct header with each request
 curl -k -X POST https://dev-open-api.homecapital.in/oauth2/token -d "grant_type=client_credentials"
-H "Authorization: Basic Base64(consumer-key:consumer-secret)"

HTTPS Request

Auth URL:

https://dev-open-api.homecapital.in/oauth2/token

All HomeCapital APIs are authorized using Basic Authorization. Basic authorization requires the following:

Query Parameters

Parameter Required
customer-key Required
customer-secret Required

Request URL:

https://dev-open-api.homecapital.in/api/sourcing/v1

If you don't have these already please contact Homecapital Support.

Master APIs

State Master

require "uri"
require "net/http"

url = URI("{{Req_URL}}/locations/states")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer {{token}}"
request["x-api-key"] = "{{x-api-key}}"

response = http.request(request)
puts response.read_body

import http.client

conn = http.client.HTTPSConnection("{{Req_URL}}")
payload = ''
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{token}}',
  'x-api-key': '{{x-api-key}}'
}
conn.request("GET", "/locations/states", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/locations/states',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer {{token}}',
    'x-api-key: {{x-api-key}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

The above command returns JSON structured like this:

{
  "status": "success",
  "data": [
    {
      "location_id": 17277,
      "location_type": "state",
      "location_name": "Andaman and Nicobar Islands"
    },
    {
      "location_id": 17282,
      "location_type": "state",
      "location_name": "Andhra Pradesh"
    },
    ....
  ]
}

Fetches all states in the system. Map this against the locations in your system

HTTP Request

GET {{Req_URL}}/locations/states

City Master

require "uri"
require "net/http"

url = URI("{{Req_URL}}/locations/city/{{state_id}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer {{token}}"
request["x-api-key"] = "{{x-api-key}}"

response = http.request(request)
puts response.read_body

import http.client

conn = http.client.HTTPSConnection("{{Req_URL}}")
payload = ''
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{token}}',
  'x-api-key': '{{x-api-key}}'
}
conn.request("GET", "/locations/city/{{state_id}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))



$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/locations/city/{{state_id}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer {{token}}',
    'x-api-key: {{x-api-key}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

The above command returns JSON structured like this:

{
  "status": "success",
  "data": [
    {
      "location_id": 17287,
      "location_type": "city",
      "location_name": "Mumbai"
    },
    ....
  ]
}

Fetches all cities in the system. Map this against the locations in your system

HTTP Request

GET {{Req_URL}}/locations/city/{state_id}

Qualification Master

require "uri"
require "net/http"

url = URI("{{Req_URL}}/data-table/qualifications")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer {{token}}"
request["x-api-key"] = "{{x-api-key}}"

response = http.request(request)
puts response.read_body

import http.client

conn = http.client.HTTPSConnection("{{Req_URL}}")
payload = ''
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{token}}',
  'x-api-key': '{{x-api-key}}'
}
conn.request("GET", "/data-table/qualifications", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/data-table/qualifications',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer {{token}}',
    'x-api-key: {{x-api-key}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

The above command returns JSON structured like this:

{
  "status": "success",
  "data": [
    {
      "id": 17,
      "name": "10+2 or equivalent",
      "type": "qualification"
    },
    {
      "id": 18,
      "name": "Bachelor's Degree",
      "type": "qualification"
    }
    ...
  ]
}

HTTP Request

GET {{Req_URL}}/data-table/qualifications

Bank Master

require "uri"
require "net/http"

url = URI("{{Req_URL}}/data-table/banks")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer {{token}}"
request["x-api-key"] = "{{x-api-key}}"

response = http.request(request)
puts response.read_body

import http.client

conn = http.client.HTTPSConnection("{{Req_URL}}")
payload = ''
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{token}}',
  'x-api-key': '{{x-api-key}}'
}
conn.request("GET", "/data-table/banks", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/data-table/banks',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer {{token}}',
    'x-api-key: {{x-api-key}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

The above command returns JSON structured like this:

{
  "status": "success",
  "data": [
    {
      "bank_id": 1,
      "bank_name": "HDFC Bank"
    },
    {
      "bank_id": 2,
      "bank_name": "State Bank of India"
    }
    ...
  ]
}

HTTP Request

GET {{Req_URL}}/data-table/banks

Developer List

require "uri"
require "net/http"

url = URI("{{Req_URL}}/data-table/developer-list")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["x-api-key"] = "{{x-api-key}}"
request["Authorization"] = "Bearer {{token}}"

response = http.request(request)
puts response.read_body

import http.client

conn = http.client.HTTPSConnection("{{Req_URL}}/data-table/developer-list")
payload = ''
headers = {
  'x-api-key': '{{x-api-key}}',
  'Authorization': 'Bearer {{token}}'
}
conn.request("GET", "/developer-list", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/data-table/developer-list',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: ',
    'Authorization: Bearer '
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Sample output parameters.

{
  "status": "success",
  "data": [
    {
      "developer_id": 1,
      "developer_name": "Sanghvi S3 Group"
    },
    {
      "developer_id": 2,
      "developer_name": "Lodha"
    }

  ]
}

HTTP Request

GET {{Req_URL}}/data-table/developer-list

Project List

import http.client

conn = http.client.HTTPSConnection("{{Req_URL}}/data-table/project-list/{{developer_id}}")
payload = ''
headers = {
  'x-api-key': '{{x-api-key}}',
  'Authorization': 'Bearer {{token}}'

}
conn.request("GET", "/project-list/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require "uri"
require "net/http"

url = URI("{{Req_URL}}/data-table/project-list/{{developer_id}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["x-api-key"] = "{{x-api-key}}"
request["Authorization"] = "Bearer {{token}}"

response = http.request(request)
puts response.read_body

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/data-table/project-list/{{developer_id}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'x-api-key': '{{x-api-key}}',
    'Authorization': 'Bearer {{token}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Sample output parameters.

{
  "status": "success",
  "data": [
    {
      "project_id": 1,
      "project_name":"Palava City"

    },
    {
      "project_id": 2,
      "project_name":"Crown Phase 1"
    }

  ]
}

HTTP Request

GET {{Req_URL}}/data-table/project-list/{{developer_id}}

DPA API

Update Profile

Sample Input parameters.

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/update-profile/{{reference_id}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "personal_information": {
    "pan": "ATVPH7238B",
    "first_name": "Vinay",
    "middle_name": "Rajesh",
    "last_name": "Maurya",
    "date_of_birth": "1999-10-28",
    "gender": "male",
    "email_id": "vinay@gmail.com",
    "marital_status": "single",
    "aadhaar_number": "876688635014",
    "mobile_number": "9022723652"
  },
  "address": {
    "current_address": {
      "line1": "17/2, Carter No: 7",
      "line2": "Borivali - East",
      "landmark": "Opposite Railway Station",
      "pincode": 400066,
      "type_of_residence": "permanent",
      "duration_of_residence_in_months": 35
    },
    "permanent_address": {
            "line1": "17/2, Carter No: 7",
            "line2": "Borivali - East",
            "landmark": "Opposite Railway Station",
            "pincode": 400066,
            "type_of_residence": "permanent",
            "duration_of_residence_in_months": 35
    }
  },
  "employment": {
    "employment_type": "salaried",
    "company": "Home Capital",
    "designation": "Developer",
    "total_experience_in_months": 1,
    "work_email": "vinay@homecapital.in",
    "office_address": {
      "line1": "16th Floor, D Wing, Trade World",
      "line2": "Kamala Mills, Lower Parel",
      "pincode": 400013
    }
  },
  "education_info": {
    "degree": "MCA",
    "college": "Thakur Institue of Management Studies Career Development and Research"
  },
  "financial_information": {
    "salary_per_month": 15000,
    "other_emi": 0
  }
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key': '{{x-api-key}}',
    'Authorization': 'Bearer {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

require "uri"
require "json"
require "net/http"

url = URI("{{Req_URL}}/update-profile/{{reference_id}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["x-api-key"] = "{{x-api-key}}"
request["Authorization"] = "Bearer {{token}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "personal_information": {
    "pan": "ATVPH7238B",
    "first_name": "Vinay",
    "middle_name": "Rajesh",
    "last_name": "Maurya",
    "date_of_birth": "1999-10-28",
    "gender": "Male",
    "email_id": "vinay@gmail.com",
    "marital_status": "single",
    "aadhaar_number": "876688635014",
    "mobile_number": "9022723652"
  },
  "address": {
    "current_address": {
      "line1": "17/2, Carter No: 7",
      "line2": "Borivali - East",
      "landmark": "Opposite Railway Station",
      "pincode": 400066,
      "type_of_residence": "permanent",
      "duration_of_residence_in_months": 35
    },
    "permanent_address": {
      "line1": "17/2, Carter No: 7",
      "line2": "Borivali - East",
      "landmark": "Opposite Railway Station",
      "pincode": 400066,
      "type_of_residence": "permanent",
      "duration_of_residence_in_months": 35
    }
  },
  "employment": {
    "employment_type": "salaried",
    "company": "Home Capital",
    "designation": "Developer",
    "total_experience_in_months": 1,
    "work_email": "vinay@homecapital.in",
    "office_address": {
      "line1": "16th Floor, D Wing, Trade World",
      "line2": "Kamala Mills, Lower Parel",
      "pincode": 400013
    }
  },
  "education_info": {
    "degree": "MCA",
    "college": "Thakur Institue of Management Studies Career Development and Research"
  },
  "financial_information": {
    "salary_per_month": 15000,
    "other_emi": 0
  }
})

response = http.request(request)
puts response.read_body

import http.client
import json

conn = http.client.HTTPSConnection("{{Req_URL}}/update-profile/{{reference_id}}")
payload = json.dumps({
  "personal_information": {
    "pan": "ATVPH7238B",
    "first_name": "Vinay",
    "middle_name": "Rajesh",
    "last_name": "Maurya",
    "date_of_birth": "1999-10-28",
    "gender": "male",
    "email_id": "vinay@gmail.com",
    "marital_status": "single",
    "aadhaar_number": "876688635014",
    "mobile_number": "9022723652"
  },
  "address": {
    "current_address": {
      "line1": "17/2, Carter No: 7",
      "line2": "Borivali - East",
      "landmark": "Opposite Railway Station",
      "pincode": 400066,
      "type_of_residence": "permanent",
      "duration_of_residence_in_months": 35
    },
    "permanent_address": {
      "line1": "17/2, Carter No: 7",
      "line2": "Borivali - East",
      "landmark": "Opposite Railway Station",
      "pincode": 400066,
      "type_of_residence": "permanent",
      "duration_of_residence_in_months": 35
    }
  },
  "employment": {
    "employment_type": "Salaried",
    "company": "Home Capital",
    "designation": "Developer",
    "total_experience_in_months": 1,
    "work_email": "vinay@homecapital.in",
    "office_address": {
      "line1": "16th Floor, D Wing, Trade World",
      "line2": "Kamala Mills, Lower Parel",
      "pincode": 400013
    }
  },
  "education_info": {
    "degree": "MCA",
    "college": "Thakur Institue of Management Studies Career Development and Research"
  },
  "financial_information": {
    "salary_per_month": 15000,
    "other_emi": 0
  }
})
headers = {
  'x-api-key': '{{x-api-key}}',
  'Authorization': 'Bearer {{token}}',
  'Content-Type': 'application/json'
}
conn.request("POST", "/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sample output parameters.

  {
    "status": "success",
    "message": "Successfully Updated "
  }

Use this endpoint to update the user's profile.

HTTPS Request

POST {{Req_URL}}/update-profile/{{reference_id}}

Input Parameter

Parameter Type Required
personal_information Personal Information Required
address Current & Permanent Address Required
employment Employment Required
education_info Education Information Required
financial_info Financial Information Required

Personal information is structured as:

Parameter Type Required Description
pan Type Required
first_name String Required
middle_name String Optional
last_name String Required
date_of_birth String Required In the ISO calendar dates format. Example: 1992-09-12 for a date of birth of 12th September 1992.
gender String Required Possible values are male and female.
email_id String Required
marital_status String Required Possible values are married,single,divorced.
aadhar_number Integer Required
mobile_number Integer Required

Address structure:

Current Address structure:

Parameter Type Required Description
line1 String Required
line2 String Optional
landmark String Optional
pincode Integer Required
type_of_residence String Required Possible values rented & permanent
duration_of_residence String Required

Permenant Address : [optional]

Company information is structured as:

Parameter Type Required Description
employeement_type String Required Possible values are salaried and self-employed.
company String Required
designation String Required
total_experience_in_months Integer Required
work_email String Optional
office_address Address Required

Comapany Address is structured as:

Parameter Type Required Description
line1 String Required
line2 String Optional
pincode String Required

Educational information:

Parameter Type Required Description
degree String Required Value should be selected from qualification table.
college String Required

Financial information:

Parameter Type Required Description
salary_per_month Integer Required Salary per month, min requirement 30K
other_emi Integer Optional Any other EMI that the user pays out every month.

Respone

Parameter Type Description
message String

Update Bank Info

Sample input parameters.

import http.client
import json

conn = http.client.HTTPSConnection("{{Req_URL}}/update-bank-detail/{{reference_id}}")
payload = json.dumps({
  "account_holder_name": "Pradeepkumar",
  "account_number": "34347220623",
  "ifsc": "icici0001766"
})
headers = {
  'x-api-key': '{{x-api-key}}',
  'Authorization': 'Bearer {{token}}',
  'Content-Type': 'application/json'
}
conn.request("POST", "/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/update-bank-detail/{{reference_id}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "account_holder_name":"Pradeepkumar",
    "account_number":"34347220623",
    "ifsc":"IFSC"
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key': '{{x-api-key}}',
    'Authorization': 'Bearer {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

require "uri"
require "json"
require "net/http"

url = URI("{{Req_URL}}/update-bank-detail/{{reference_id}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["x-api-key"] = "{{x-api-key}}"
request["Authorization"] = "Bearer {{token}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "account_holder_name": "Pradeepkumar",
  "account_number": "34347220623",
  "ifsc": "IFSC"
})

response = http.request(request)
puts response.read_body

Sample output parameters.

{
  "status": "success",
  "data": [],
  "message": "Successfully Updated"
}

Updates the bank information of the user.

HTTPS Request

POST {{Req_URL}}/update-bank-details/{{reference_id}}

Query Parameters

Parameter Type Required Description
account_no String Required The bank account number.
ifsc String Required The IFSC (code) of the bank branch.

Response

Parameter Type Description
message String

Upload Document

Sample input parameters.

import http.client
import json

conn = http.client.HTTPSConnection("{{Req_URL}}/upload-document/{{reference_id}}")
payload = json.dumps({
  "photo_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ],
  "pan_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ],
  "address_proof_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ],
  "salary_slip_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ],
  "bank_statement_url": [
    {
      "url": "https://cdn.homecapital.in/website2.0/home-impact/person_1.png",
      "password": "srtc23"
    }
  ]
})
headers = {
  'x-api-key': '{{x-api-key}}',
  'Authorization': 'Bearer {{token}}',
  'Content-Type': 'application/json'
}
conn.request("POST", "/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/upload-document/{{reference_id}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "photo_url": [
        "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
    ],
    "pan_url": [
        "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
    ],
    "address_proof_url": [
        "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
    ],
    "salary_slip_url": [
        "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
    ],
    "bank_statement_url": [
        {
            "url": "https://cdn.homecapital.in/website2.0/home-impact/person_1.png",
            "password": "srtc23"
        }
    ]
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key': '{{x-api-key}}',
    'Authorization': 'Bearer {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
require "uri"
require "json"
require "net/http"

url = URI("{{Req_URL}}/upload-document/{{refrence_id}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["x-api-key"] = "{{x-api-key}}"
request["Authorization"] = "Bearer {{token}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "photo_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ],
  "pan_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ],
  "address_proof_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ],
  "salary_slip_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ],
  "bank_statement_url": [
    {
      "url": "https://cdn.homecapital.in/website2.0/home-impact/person_1.png",
      "password": "srtc23"
    }
  ]
})

response = http.request(request)
puts response.read_body

Sample output parameters.

{
  "status": "success",
  "message": "Successfully Uploaded"
}

This endpoint uploads documents of a user.

HTTPS Request

POST {{Req_URL}}/upload-document/{{reference_id}}

Query Parameters

Parameter Type Required Description
photo_url Array Required URL of the user photo.
pan_url Array Required
address_proof_url Array Required
salary_slip_url_month Array Optional List of URL for salary slips for 3 months
bank_statement_url Array Required URL of single e-statement containing latest 3 months transactions, or individual e-statements for each month.

Response

Parameter Type Description
message String

Apply Loan

Sample input parameters.

import http.client
import json

conn = http.client.HTTPSConnection("{{Req_URL}}/apply-loan/{{reference_id}}")
payload = json.dumps({
  "tenure_months": 12,
  "loan_amount": 100000,
  "loan_product": "HCDPA",
  "developer_id": "",
  "project_id": ""
})
headers = {
  'x-api-key': '{{x-api-key}}',
  'Authorization': 'Bearer {{token}}',
  'Content-Type': 'application/json'
}
conn.request("POST", "/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/apply-loan/{{reference_id}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "tenure_months": 12,
  "loan_amount": 100000,
  "loan_product": "HCDPA",
  "developer_id": "",
  "project_id": ""
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key': '{{x-api-key}}',
    'Authorization': 'Bearer {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

require "uri"
require "json"
require "net/http"

url = URI("{{Req_URL}}/apply-loan/{{refrence_id}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["x-api-key"] = "{{x-api-key}}"
request["Authorization"] = "Bearer {{token}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "tenure_months": 12,
  "loan_amount": 100000,
  "loan_product": "HCDPA",
  "developer_id": "",
  "project_id": ""
})

response = http.request(request)
puts response.read_body

Sample output parameters.


{
  "status": "success",
  "message": "Successfully Applied"
}

This endpoint results in a loan application creation.

HTTPS Request

POST {{Req_URL}}/apply-loan/{{reference_id}}

Loan Details

loan_product Tenure Description
HCDPA 3 Home Capital Down Payment Assistances.
HCDPA 6 Home Capital Down Payment Assistances.
HCDPA 12 Home Capital Down Payment Assistances. 𝐃𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫 𝐈𝐝 𝐚𝐧𝐝 𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝐈𝐝 𝐑𝐞𝐪𝐮𝐢𝐫𝐞𝐝.
HCPL 12 Home Capital Personal Loan
HCDPL 24 Home Capital Personal Loan
HCDPL 36 Home Capital Personal Loan

Query Parameters

Parameter Type Required Description
tenure_months Integer Required Possible values are 3 and 6.
loan_amount Integer Required Loan amount in rupees.
loan_product String Required Name of loan program.
developer_id Integer Optional
project_id Integer Optional

Response

Parameter Type Description
message String

The status of loan application will be comunicate using the callback Loan Decision

Upload Disbursal Documents

Sample input parameters.

import http.client
import json

conn = http.client.HTTPSConnection("{{Req_URL}}/upload-disbursal-documents/{{reference_id}}")
payload = json.dumps({
  "loan_agreement_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ]
})
headers = {
  'x-api-key': '{{x-api-key}}',
  'Authorization': 'Bearer {{token}}',
  'Content-Type': 'application/json'
}
conn.request("POST", "/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/upload-disbursal-documents/{{reference_id}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "loan_agreement_url": [
        "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
    ]
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key': '{{x-api-key}}',
    'Authorization': 'Bearer {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

require "uri"
require "json"
require "net/http"

url = URI("{{Req_URL}}/upload-disbursal-documents/{{refrence_id}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["x-api-key"] = "{{x-api-key}}"
request["Authorization"] = "Bearer {{token}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "loan_agreement_url": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ]
})

response = http.request(request)
puts response.read_body

Sample output parameters.

{
  "status": "success",
  "data": [],
  "message": "Successfully Uploaded"
}

This endpoint results of Upload Disbursal document od user.

HTTPS Request

POST {{Req_URL}}/upload-disbursal-documents/{reference_id}

Query Parameters

Parameter Type Required Description
loan_agreement_url Array Required URL of signed loan agreement.

Response

Parameter Type Description
message String

Disburse Loan

This endpoint results in a loan disbursal.

Sample input parameters.

import http.client
import json

conn = http.client.HTTPSConnection("{{Req_URL}}/disbursal-request/{{reference_id}}")
payload = json.dumps({
  "user_accepted_terms_and_conditions": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ]
})
headers = {
  'x-api-key': '{{x-api-key}}',
  'Authorization': 'Bearer {{token}}',
  'Content-Type': 'application/json'
}
conn.request("POST", "/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/disbursal-request/{{reference_id}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "user_accepted_terms_and_conditions": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key': '{{x-api-key}}',
    'Authorization': 'Bearer {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

require "uri"
require "json"
require "net/http"

url = URI("{{Req_URL}}/disbursal-request/{{reference_id}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["x-api-key"] = "{{x-api-key}}"
request["Authorization"] = "Bearer {{token}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "user_accepted_terms_and_conditions": [
    "https://cdn.homecapital.in/website2.0/home-impact/person_1.png"
  ]
})

response = http.request(request)
puts response.read_body

Sample output parameters.

{
  "status": "success",
  "message": "Successfully accepted for disbursement"
}

HTTPS Request

POST {{Req_URL}}/disbursal-request/{{reference_id}}

Query Parameters

Parameter Type Required Description
user_accepted_terms_and_conditions String Required The only possible value is Yes.

Response

Parameter Type Description
message String

DPA Eligibility

Check Eligibility

Sample Input parameters.

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dev-open-api.homecapital.in/api/sourcing/v1/check-eligibility',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
     "first_name":"Pradeep",
    "last_name": "Kori",
    "dob":"",
    "email_id":"pradeep@homecapital.in",
    "mobile_number":"9022723652",
    "monthly_income":"",
    "pan_no":"",
    "gender":"",
    "pincode":"",
    "home_loan_required": 1,
    "employment_type": ""
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key': '{{x-api-key}}',
    'Authorization': 'Bearer {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

require "uri"
require "json"
require "net/http"

url = URI("https://dev-open-api.homecapital.in/api/sourcing/v1/check-eligibility")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "{{x-api-key}}"
request["Authorization"] = "Bearer {{token}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
   "first_name":"Pradeep",
    "last_name": "Kori",
    "dob":"",
    "email_id":"pradeep@homecapital.in",
    "mobile_number":"9022723652",
    "monthly_income":"",
    "pan_no":"",
    "gender":"",
    "pincode":"",
    "home_loan_required": 1,
    "employment_type": ""
})

response = https.request(request)
puts response.read_body

import http.client
import json

conn = http.client.HTTPSConnection("dev-open-api.homecapital.in")
payload = json.dumps({
   "first_name":"Pradeep",
    "last_name": "Kori",
    "dob":"",
    "email_id":"pradeep@homecapital.in",
    "mobile_number":"9022723652",
    "monthly_income":"",
    "pan_no":"",
    "gender":"",
    "pincode":"",
    "home_loan_required": 1,
    "employment_type": ""
})
headers = {
  'x-api-key': '{{x-api-key}}',
  'Authorization': 'Bearer {{token}}',
  'Content-Type': 'application/json'
}
conn.request("POST", "/api/sourcing/v1/check-eligibility", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sample output parameters.

  {
    "status": "success",
    "data": {
        "eligibility": true,
        "emi_pans": [
            {
                "tenure": 3,
                "total_number_repayments": 3,
                "total_interest_payable": 0,
                "max_dpa": 97500,
                "total_amount_payable": 97500,
                "processing_fee": 1940,
                "interest_rate": 0,
                "emi": 32500,
                "existing_emi": 0,
                "dpa_link": "https://homecapital.page.link/3T6"
            },
            {
                "tenure": 6,
                "total_number_repayments": 6,
                "total_interest_payable": 0,
                "max_dpa": 195000,
                "total_amount_payable": 195000,
                "processing_fee": 6806,
                "interest_rate": 0,
                "emi": 32500,
                "existing_emi": 0,
                "dpa_link": "https://homecapital.page.link/AFe"
            },
          ]
    },
    "message": "Congratulation you are eligible for HomeCapital DPA"
  }

Use this endpoint to Check Eligibility of customer.

HTTPS Request

POST {{Req_URL}}/eligibility-check

Input Parameter

Parameter Type Required
first_name Required
last_name Required
dob Optional In the ISO calendar dates format. Example: 1992-09-12 for a date of birth of 12th September 1992.
email_id Required
mobile_number Required
monthly_income Optional
pan_no Optional
gender Optional Possible values are male and female.
pincode Optional
home_loan_required Opitional Possible values 1 or 0.
employment_type Opitional Possible Values salaried or self-employed.

Respone

Parameter Type Description
eligibility String Eligibility check of customer. Possible values true or false.
tenure Integer Tenure months for loan
total_number_repayments Integer
total_interest_payable Integer
max_dpa Integer Maximum down payment amount customer will get.
total_amount_payable Integer Total amount payable within tenure.
processing_fee Integer
interest_rate Float
emi Integer Emi amount to be paid.
existing_emi Integer
dpa_link String To complete the process customer will be redirected to this link
message String

Lead Status

Lead Id

Sample Input parameters.

require "uri"
require "net/http"

url = URI("{{Req_URL}}/locations/states")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer {{token}}"
request["x-api-key"] = "{{x-api-key}}"

response = http.request(request)
puts response.read_body

import http.client

conn = http.client.HTTPSConnection("{{Req_URL}}")
payload = ''
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{token}}',
  'x-api-key': '{{x-api-key}}'
}
conn.request("GET", "/locations/states", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{Req_URL}}/locations/states',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer {{token}}',
    'x-api-key: {{x-api-key}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

The above command returns JSON structured like this:

{
    "status": "success",
    "data": {
        "lead_status": "created"
    },
    "message": "success"
}

HTTPS Request

GET {{Req_URL}}/lead-status/{{lead_id}}

Respone

Parameter Type Description
lead_status String Expected value created, in process, rejected, disbured.
message String

DPA : Callbacks

Case Approval Callback

{

  "data-ref": "case-approved",
  "reference_id": "8396b84d-14ee-4134-9f0b-5b2808fea0e4",
  "data": {
    "approved_loan_amount": 252852,
    "tenure": 12,
    "esign_agreement_link": "https://esign_1611818857.1412.pdf",
    "mandate_link": "https://homecapital.page.link/n5cb",
    "processing_fees_link": "https://homecapital.page.link/n2bl"  
  }
}

Case Rejection Callback

{
  "data-ref": "case-rejected",
  "reference_id": "ec7671c1-58d1-4316-b08c-06ce1cc8d9e3",
  "data": {
    "message":"DPD in account."
  }
}

NACH Registration Callback

Indicates the mandate registration status.

{
  "data-ref": "nach-initiated/nach-confirmed",
  "reference_id": "279a55b5-3513-4235-b392-85f6842b5273",
  "data": {
    "message": "User successfully completed the E-NACH."
  }
}

Processing-fees Callback

Indicates processing fees is paid by customer.

{
  "data-ref": "processing-fees",
  "reference_id": "279a55b5-3513-4235-b392-85f6842b5273",
  "data": {
    "message": "User successfully paid."
  }
}

E-sign Callback

Indicates the E-sign status.

{
  "data-ref": "e-sign",
  "reference_id": "a672e0ff-39f9-4e1b-b216-d22afba70c82",
  "data": {
    "message": "e-sign successfully completed."
  }
}

Disbursal Callback

{
  "data-ref": "disbursed",
  "reference_id": "9a1cd3b7-db94-471c-9d21-ba70903f2c88",
  "data": {
    "utr": "ICICR42021012700538931",
    "loan_ref_no": "9a1cd3b7-db94-471c-9d21-ba70903f2c88",
    "disburse_amount": 259440
  }
}

Errors

The HomeCapital API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The API requested is hidden for administrators only.
404 Not Found -- The specified API could not be found.
405 Method Not Allowed -- You tried to access a API with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The API requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many API! Slow down!
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.