Create Loan
curl --request POST \
--url https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "<string>",
"duration": 123,
"currency": "<string>",
"interest_rate": 123,
"amount": "<string>",
"repayment_amount": "<string>",
"collaterals": [
{}
],
"loan_configuration_id": "<string>",
"reason": "<string>",
"bank_name": "<string>",
"bank_code": "<string>",
"account_number": "<string>"
}
'import requests
url = "https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan"
payload = {
"user_id": "<string>",
"duration": 123,
"currency": "<string>",
"interest_rate": 123,
"amount": "<string>",
"repayment_amount": "<string>",
"collaterals": [{}],
"loan_configuration_id": "<string>",
"reason": "<string>",
"bank_name": "<string>",
"bank_code": "<string>",
"account_number": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
duration: 123,
currency: '<string>',
interest_rate: 123,
amount: '<string>',
repayment_amount: '<string>',
collaterals: [{}],
loan_configuration_id: '<string>',
reason: '<string>',
bank_name: '<string>',
bank_code: '<string>',
account_number: '<string>'
})
};
fetch('https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan', 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://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan",
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([
'user_id' => '<string>',
'duration' => 123,
'currency' => '<string>',
'interest_rate' => 123,
'amount' => '<string>',
'repayment_amount' => '<string>',
'collaterals' => [
[
]
],
'loan_configuration_id' => '<string>',
'reason' => '<string>',
'bank_name' => '<string>',
'bank_code' => '<string>',
'account_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"duration\": 123,\n \"currency\": \"<string>\",\n \"interest_rate\": 123,\n \"amount\": \"<string>\",\n \"repayment_amount\": \"<string>\",\n \"collaterals\": [\n {}\n ],\n \"loan_configuration_id\": \"<string>\",\n \"reason\": \"<string>\",\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"duration\": 123,\n \"currency\": \"<string>\",\n \"interest_rate\": 123,\n \"amount\": \"<string>\",\n \"repayment_amount\": \"<string>\",\n \"collaterals\": [\n {}\n ],\n \"loan_configuration_id\": \"<string>\",\n \"reason\": \"<string>\",\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"duration\": 123,\n \"currency\": \"<string>\",\n \"interest_rate\": 123,\n \"amount\": \"<string>\",\n \"repayment_amount\": \"<string>\",\n \"collaterals\": [\n {}\n ],\n \"loan_configuration_id\": \"<string>\",\n \"reason\": \"<string>\",\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Loan created successfully",
"data": {
"id": "67ef8652ad2aff781bf017c6",
"borrower": "67d3267b6b2f7dfc493db74a",
"creditor": "624598bd83067c00f691c0ca",
"amount": 840000,
"currency": "NGN",
"repayment_amount": 1596000,
"repayment_date": "Fri Jul 04 2025 08:12:11 GMT+0100 (West Africa Standard Time)",
"interest_rate": 0.3,
"duration": 3,
"status": "ACTIVE",
"grace_period": 5,
"grace_period_unit": "DAYS",
"reason": "Personal Use",
"created_at": "2025-04-04T07:12:18.561Z",
"updated_at": "2025-04-04T07:12:18.561Z",
"collaterals": [
{
"name": "CredPal2",
"token_id": "67e30ac4c6ee9dd9cc0fe0e4",
"quantity": 10
},
{
"name": "CredPal",
"token_id": "66b3dd8b7f741f367b960f26",
"quantity": 100
}
]
}
}
Credit Loan
Create Loan
Creates a new loan using specified collateral against a matched loan configuration.
POST
/
api
/
credit
/
loan
Create Loan
curl --request POST \
--url https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "<string>",
"duration": 123,
"currency": "<string>",
"interest_rate": 123,
"amount": "<string>",
"repayment_amount": "<string>",
"collaterals": [
{}
],
"loan_configuration_id": "<string>",
"reason": "<string>",
"bank_name": "<string>",
"bank_code": "<string>",
"account_number": "<string>"
}
'import requests
url = "https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan"
payload = {
"user_id": "<string>",
"duration": 123,
"currency": "<string>",
"interest_rate": 123,
"amount": "<string>",
"repayment_amount": "<string>",
"collaterals": [{}],
"loan_configuration_id": "<string>",
"reason": "<string>",
"bank_name": "<string>",
"bank_code": "<string>",
"account_number": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
duration: 123,
currency: '<string>',
interest_rate: 123,
amount: '<string>',
repayment_amount: '<string>',
collaterals: [{}],
loan_configuration_id: '<string>',
reason: '<string>',
bank_name: '<string>',
bank_code: '<string>',
account_number: '<string>'
})
};
fetch('https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan', 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://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan",
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([
'user_id' => '<string>',
'duration' => 123,
'currency' => '<string>',
'interest_rate' => 123,
'amount' => '<string>',
'repayment_amount' => '<string>',
'collaterals' => [
[
]
],
'loan_configuration_id' => '<string>',
'reason' => '<string>',
'bank_name' => '<string>',
'bank_code' => '<string>',
'account_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"duration\": 123,\n \"currency\": \"<string>\",\n \"interest_rate\": 123,\n \"amount\": \"<string>\",\n \"repayment_amount\": \"<string>\",\n \"collaterals\": [\n {}\n ],\n \"loan_configuration_id\": \"<string>\",\n \"reason\": \"<string>\",\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"duration\": 123,\n \"currency\": \"<string>\",\n \"interest_rate\": 123,\n \"amount\": \"<string>\",\n \"repayment_amount\": \"<string>\",\n \"collaterals\": [\n {}\n ],\n \"loan_configuration_id\": \"<string>\",\n \"reason\": \"<string>\",\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ge-exchange-staging-1.herokuapp.com/v1/api/credit/loan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"duration\": 123,\n \"currency\": \"<string>\",\n \"interest_rate\": 123,\n \"amount\": \"<string>\",\n \"repayment_amount\": \"<string>\",\n \"collaterals\": [\n {}\n ],\n \"loan_configuration_id\": \"<string>\",\n \"reason\": \"<string>\",\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Loan created successfully",
"data": {
"id": "67ef8652ad2aff781bf017c6",
"borrower": "67d3267b6b2f7dfc493db74a",
"creditor": "624598bd83067c00f691c0ca",
"amount": 840000,
"currency": "NGN",
"repayment_amount": 1596000,
"repayment_date": "Fri Jul 04 2025 08:12:11 GMT+0100 (West Africa Standard Time)",
"interest_rate": 0.3,
"duration": 3,
"status": "ACTIVE",
"grace_period": 5,
"grace_period_unit": "DAYS",
"reason": "Personal Use",
"created_at": "2025-04-04T07:12:18.561Z",
"updated_at": "2025-04-04T07:12:18.561Z",
"collaterals": [
{
"name": "CredPal2",
"token_id": "67e30ac4c6ee9dd9cc0fe0e4",
"quantity": 10
},
{
"name": "CredPal",
"token_id": "66b3dd8b7f741f367b960f26",
"quantity": 100
}
]
}
}
The id of the user who will receive the loan.
Loan duration in months.
Loan currency (e.g., “NGN”).
Interest rate, expressed as a decimal between 0 and 1 (e.g., 0.05 for 5%).
The amount loaned out to a customer
The amount to be paid back by the customer
Array of collateral objects with token_id and quantity.
[
{ "token_id": "67e2f7ed702e11a6778681a3", "quantity": 2 },
{ "token_id": "67e2f7ed702e11a6778681b3", "quantity": 5 }
]
ID of the matched loan configuration.
Optional reason for the loan.
Optional name of the bank to repay a loan to
Optional bank code
Optional Account number
{
"status": "success",
"message": "Loan created successfully",
"data": {
"id": "67ef8652ad2aff781bf017c6",
"borrower": "67d3267b6b2f7dfc493db74a",
"creditor": "624598bd83067c00f691c0ca",
"amount": 840000,
"currency": "NGN",
"repayment_amount": 1596000,
"repayment_date": "Fri Jul 04 2025 08:12:11 GMT+0100 (West Africa Standard Time)",
"interest_rate": 0.3,
"duration": 3,
"status": "ACTIVE",
"grace_period": 5,
"grace_period_unit": "DAYS",
"reason": "Personal Use",
"created_at": "2025-04-04T07:12:18.561Z",
"updated_at": "2025-04-04T07:12:18.561Z",
"collaterals": [
{
"name": "CredPal2",
"token_id": "67e30ac4c6ee9dd9cc0fe0e4",
"quantity": 10
},
{
"name": "CredPal",
"token_id": "66b3dd8b7f741f367b960f26",
"quantity": 100
}
]
}
}
Was this page helpful?
⌘I
