Calculate Repayment
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/calculate-repayment \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"loan_amount": 2000000,
"tenure": 3,
"state": "LAGOS STATE"
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({loan_amount: 2000000, tenure: 3, state: 'LAGOS STATE'})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/calculate-repayment', 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/calculate-repayment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'loan_amount' => 2000000,
'tenure' => 3,
'state' => 'LAGOS STATE'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/calculate-repayment"
payload = {
"loan_amount": 2000000,
"tenure": 3,
"state": "LAGOS STATE"
}
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/calculate-repayment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"loan_amount\": 2000000,\n \"tenure\": 3,\n \"state\": \"LAGOS STATE\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/calculate-repayment"
payload := strings.NewReader("{\n \"loan_amount\": 2000000,\n \"tenure\": 3,\n \"state\": \"LAGOS STATE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"data": {
"monthly_repayment": 719999,
"total_repayment": 2159997,
"interest_rate": 8,
"schedule": [
{
"month": 1,
"principal": 666666,
"interest": 53333,
"total": 719999
}
]
}
}Loans
Calculate Repayment
Preview the repayment breakdown for a given loan amount and tenure.
POST
/
v1
/
loans
/
calculate-repayment
Calculate Repayment
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/calculate-repayment \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"loan_amount": 2000000,
"tenure": 3,
"state": "LAGOS STATE"
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({loan_amount: 2000000, tenure: 3, state: 'LAGOS STATE'})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/calculate-repayment', 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/calculate-repayment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'loan_amount' => 2000000,
'tenure' => 3,
'state' => 'LAGOS STATE'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/calculate-repayment"
payload = {
"loan_amount": 2000000,
"tenure": 3,
"state": "LAGOS STATE"
}
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/calculate-repayment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"loan_amount\": 2000000,\n \"tenure\": 3,\n \"state\": \"LAGOS STATE\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/calculate-repayment"
payload := strings.NewReader("{\n \"loan_amount\": 2000000,\n \"tenure\": 3,\n \"state\": \"LAGOS STATE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"data": {
"monthly_repayment": 719999,
"total_repayment": 2159997,
"interest_rate": 8,
"schedule": [
{
"month": 1,
"principal": 666666,
"interest": 53333,
"total": 719999
}
]
}
}Overview
Returns a projected repayment schedule for a given loan amount, tenure, and state. Can be called at any point — no active application is required. Useful for showing customers a preview before they apply. All amounts are in kobo.Request
Method:POSTURL:
/v1/loans/calculate-repayment
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-carbon-key | Header | string | Yes | API key for authentication. |
Request Body
{
"loan_amount": 2000000,
"tenure": 3,
"state": "Lagos"
}
| Field | Type | Required | Description |
|---|---|---|---|
loan_amount | number | Yes | Loan amount in kobo |
tenure | number | Yes | Repayment period in months (positive integer) |
state | string | Yes | Nigerian state name (affects rate) |
Response
200 OK
{
"status": "success",
"message": "Repayment calculated",
"data": {
"monthlyRepayment": 720000,
"totalRepayment": 2160000,
"interestRate": 8.0,
"schedule": [
{
"dueDate": "2025-02-15",
"principalDue": 666666,
"interestDue": 53333,
"totalDue": 719999
}
]
}
}
Error Responses
| Status | Message | Cause |
|---|---|---|
| 400 | loan_amount must be a number (in kobo) | Missing or invalid type |
| 400 | tenure must be a positive integer (months) | Invalid tenure |
| 400 | state is required | Missing state |
Authorizations
Provide your API key in the 'apikey' header.
Headers
Body
application/json
Provide the required values for the request body.
Response
200 - application/json
Successful response
The response is of type object.
⌘I