Get Active Loan
curl --request GET \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>'const options = {
method: 'GET',
headers: {'x-carbon-key': '<x-carbon-key>', apikey: '<api-key>'}
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active', 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://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <api-key>",
"x-carbon-key: <x-carbon-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active"
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"message": "Active loan fetched",
"data": {
"loanId": "LOAN_ABC123",
"outstandingBalance": 150000000,
"loanStatus": "ACTIVE",
"nextRepaymentDate": "2025-02-15",
"nextRepaymentAmount": 7199999
}
}Loans
Get Active Loan
Fetch the currently active (disbursed) loan for a customer.
GET
/
v1
/
loans
/
active
Get Active Loan
curl --request GET \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>'const options = {
method: 'GET',
headers: {'x-carbon-key': '<x-carbon-key>', apikey: '<api-key>'}
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active', 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://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <api-key>",
"x-carbon-key: <x-carbon-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active"
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/active"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"message": "Active loan fetched",
"data": {
"loanId": "LOAN_ABC123",
"outstandingBalance": 150000000,
"loanStatus": "ACTIVE",
"nextRepaymentDate": "2025-02-15",
"nextRepaymentAmount": 7199999
}
}Overview
Returns the active disbursed loan for a customer. Use this to check outstanding balance, next repayment date, and current loan status.Request
Method:GETURL:
/v1/loans/active
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-carbon-key | Header | string | Yes | API key for authentication. |
customer_id | Query | string | Yes | UUID of the customer. |
Response
200 OK
{
"status": "success",
"message": "Active loan fetched",
"data": {
"loanId": "LOAN_ABC123",
"outstandingBalance": 150000000,
"loanStatus": "ACTIVE",
"nextRepaymentDate": "2025-02-15",
"nextRepaymentAmount": 7199999
}
}
loanStatus | Meaning |
|---|---|
ACTIVE | Loan is active and in good standing |
ACTIVE_IN_ARREARS | Loan is active but overdue |
CLOSED | Loan is fully repaid |
Error Responses
| Status | Message | Cause |
|---|---|---|
| 400 | customer_id query param is required | Missing customer_id query parameter |
| 400 | Customer not enrolled for lending | Customer not found or not enrolled |
⌘I