Loan History
curl --request GET \
--url https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}import requests
url = "https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAPI Endpoints
Loan History
Retrieves a paginated history of all loans for a customer, including active, completed, and cancelled loans.
GET
/
user
/
get-loan-history
/
{customerId}
Loan History
curl --request GET \
--url https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}import requests
url = "https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.fincode.software/api/v1/services/user/get-loan-history/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyFetches a comprehensive, paginated history of all loans associated with a customer, providing detailed information about each loan’s status, amounts, and timeline.
Request Headers
Path Parameters
Query Parameters
Code Examples
curl --location 'https://{your-domain}.fincode.software/api/v1/services/user/loan-history/123e4567-e89b-12d3-a456-426614174000?page=1&size=10' \
--header 'X-Auth-Token: YOUR_JWT_ACCESS_TOKEN' \
--header 'x-idempotency-key: unique-key-12345' \
--header 'x-fapi-auth-date: 2024-01-15T10:30:00Z' \
--header 'x-fapi-customer-ip-address: 192.168.1.1' \
--header 'x-fapi-interaction-id: interaction-12345'
const axios = require('axios');
const BASE_URL = 'https://{your-domain}.fincode.software/api/v1/services/user';
async function getCustomerLoanHistory(accessToken, customerId, page = 1, size = 10) {
try {
const response = await axios.get(
`${BASE_URL}/loan-history/${customerId}`,
{
params: {
page,
size,
},
headers: {
'X-Auth-Token': accessToken,
'x-idempotency-key': `key-${Date.now()}`,
'x-fapi-auth-date': new Date().toISOString(),
'x-fapi-customer-ip-address': '192.168.1.1',
'x-fapi-interaction-id': `interaction-${Date.now()}`,
},
}
);
loans.forEach((loan) => {
console.log(
`- ${loan.loanApplicationId}: ${loan.loanProductName} - ` +
`${loan.loanAmount} (Status: ${loan.status})`
);
});
return history;
} catch (error) {
console.error(
'Failed to fetch customer loan history:',
error.response?.data || error.message
);
throw error;
}
}
