Create Loan Account
curl --request POST \
--url https://spark.test.woodcore.co/api/v2/loans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientId": 1092,
"createdDate": "15 Mar 2022",
"duration": 12,
"durationBy": "Month",
"expectedDisbursementDate": "15 Mar 2022",
"interestRate": 5,
"interestType": "Flat",
"linkDepositAccountId": 454,
"loanType": "individual",
"numberOfRepayments": 12,
"principal": 100000,
"productId": 1,
"repaymentEvery": 1,
"repaymentFrequency": "Monthly"
}
'import requests
url = "https://spark.test.woodcore.co/api/v2/loans"
payload = {
"clientId": 1092,
"createdDate": "15 Mar 2022",
"duration": 12,
"durationBy": "Month",
"expectedDisbursementDate": "15 Mar 2022",
"interestRate": 5,
"interestType": "Flat",
"linkDepositAccountId": 454,
"loanType": "individual",
"numberOfRepayments": 12,
"principal": 100000,
"productId": 1,
"repaymentEvery": 1,
"repaymentFrequency": "Monthly"
}
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({
clientId: 1092,
createdDate: '15 Mar 2022',
duration: 12,
durationBy: 'Month',
expectedDisbursementDate: '15 Mar 2022',
interestRate: 5,
interestType: 'Flat',
linkDepositAccountId: 454,
loanType: 'individual',
numberOfRepayments: 12,
principal: 100000,
productId: 1,
repaymentEvery: 1,
repaymentFrequency: 'Monthly'
})
};
fetch('https://spark.test.woodcore.co/api/v2/loans', 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://spark.test.woodcore.co/api/v2/loans",
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([
'clientId' => 1092,
'createdDate' => '15 Mar 2022',
'duration' => 12,
'durationBy' => 'Month',
'expectedDisbursementDate' => '15 Mar 2022',
'interestRate' => 5,
'interestType' => 'Flat',
'linkDepositAccountId' => 454,
'loanType' => 'individual',
'numberOfRepayments' => 12,
'principal' => 100000,
'productId' => 1,
'repaymentEvery' => 1,
'repaymentFrequency' => 'Monthly'
]),
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://spark.test.woodcore.co/api/v2/loans"
payload := strings.NewReader("{\n \"clientId\": 1092,\n \"createdDate\": \"15 Mar 2022\",\n \"duration\": 12,\n \"durationBy\": \"Month\",\n \"expectedDisbursementDate\": \"15 Mar 2022\",\n \"interestRate\": 5,\n \"interestType\": \"Flat\",\n \"linkDepositAccountId\": 454,\n \"loanType\": \"individual\",\n \"numberOfRepayments\": 12,\n \"principal\": 100000,\n \"productId\": 1,\n \"repaymentEvery\": 1,\n \"repaymentFrequency\": \"Monthly\"\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://spark.test.woodcore.co/api/v2/loans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": 1092,\n \"createdDate\": \"15 Mar 2022\",\n \"duration\": 12,\n \"durationBy\": \"Month\",\n \"expectedDisbursementDate\": \"15 Mar 2022\",\n \"interestRate\": 5,\n \"interestType\": \"Flat\",\n \"linkDepositAccountId\": 454,\n \"loanType\": \"individual\",\n \"numberOfRepayments\": 12,\n \"principal\": 100000,\n \"productId\": 1,\n \"repaymentEvery\": 1,\n \"repaymentFrequency\": \"Monthly\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spark.test.woodcore.co/api/v2/loans")
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 \"clientId\": 1092,\n \"createdDate\": \"15 Mar 2022\",\n \"duration\": 12,\n \"durationBy\": \"Month\",\n \"expectedDisbursementDate\": \"15 Mar 2022\",\n \"interestRate\": 5,\n \"interestType\": \"Flat\",\n \"linkDepositAccountId\": 454,\n \"loanType\": \"individual\",\n \"numberOfRepayments\": 12,\n \"principal\": 100000,\n \"productId\": 1,\n \"repaymentEvery\": 1,\n \"repaymentFrequency\": \"Monthly\"\n}"
response = http.request(request)
puts response.read_body{}Loan Account
Create Loan Account
POST
/
loans
Create Loan Account
curl --request POST \
--url https://spark.test.woodcore.co/api/v2/loans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientId": 1092,
"createdDate": "15 Mar 2022",
"duration": 12,
"durationBy": "Month",
"expectedDisbursementDate": "15 Mar 2022",
"interestRate": 5,
"interestType": "Flat",
"linkDepositAccountId": 454,
"loanType": "individual",
"numberOfRepayments": 12,
"principal": 100000,
"productId": 1,
"repaymentEvery": 1,
"repaymentFrequency": "Monthly"
}
'import requests
url = "https://spark.test.woodcore.co/api/v2/loans"
payload = {
"clientId": 1092,
"createdDate": "15 Mar 2022",
"duration": 12,
"durationBy": "Month",
"expectedDisbursementDate": "15 Mar 2022",
"interestRate": 5,
"interestType": "Flat",
"linkDepositAccountId": 454,
"loanType": "individual",
"numberOfRepayments": 12,
"principal": 100000,
"productId": 1,
"repaymentEvery": 1,
"repaymentFrequency": "Monthly"
}
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({
clientId: 1092,
createdDate: '15 Mar 2022',
duration: 12,
durationBy: 'Month',
expectedDisbursementDate: '15 Mar 2022',
interestRate: 5,
interestType: 'Flat',
linkDepositAccountId: 454,
loanType: 'individual',
numberOfRepayments: 12,
principal: 100000,
productId: 1,
repaymentEvery: 1,
repaymentFrequency: 'Monthly'
})
};
fetch('https://spark.test.woodcore.co/api/v2/loans', 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://spark.test.woodcore.co/api/v2/loans",
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([
'clientId' => 1092,
'createdDate' => '15 Mar 2022',
'duration' => 12,
'durationBy' => 'Month',
'expectedDisbursementDate' => '15 Mar 2022',
'interestRate' => 5,
'interestType' => 'Flat',
'linkDepositAccountId' => 454,
'loanType' => 'individual',
'numberOfRepayments' => 12,
'principal' => 100000,
'productId' => 1,
'repaymentEvery' => 1,
'repaymentFrequency' => 'Monthly'
]),
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://spark.test.woodcore.co/api/v2/loans"
payload := strings.NewReader("{\n \"clientId\": 1092,\n \"createdDate\": \"15 Mar 2022\",\n \"duration\": 12,\n \"durationBy\": \"Month\",\n \"expectedDisbursementDate\": \"15 Mar 2022\",\n \"interestRate\": 5,\n \"interestType\": \"Flat\",\n \"linkDepositAccountId\": 454,\n \"loanType\": \"individual\",\n \"numberOfRepayments\": 12,\n \"principal\": 100000,\n \"productId\": 1,\n \"repaymentEvery\": 1,\n \"repaymentFrequency\": \"Monthly\"\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://spark.test.woodcore.co/api/v2/loans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": 1092,\n \"createdDate\": \"15 Mar 2022\",\n \"duration\": 12,\n \"durationBy\": \"Month\",\n \"expectedDisbursementDate\": \"15 Mar 2022\",\n \"interestRate\": 5,\n \"interestType\": \"Flat\",\n \"linkDepositAccountId\": 454,\n \"loanType\": \"individual\",\n \"numberOfRepayments\": 12,\n \"principal\": 100000,\n \"productId\": 1,\n \"repaymentEvery\": 1,\n \"repaymentFrequency\": \"Monthly\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spark.test.woodcore.co/api/v2/loans")
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 \"clientId\": 1092,\n \"createdDate\": \"15 Mar 2022\",\n \"duration\": 12,\n \"durationBy\": \"Month\",\n \"expectedDisbursementDate\": \"15 Mar 2022\",\n \"interestRate\": 5,\n \"interestType\": \"Flat\",\n \"linkDepositAccountId\": 454,\n \"loanType\": \"individual\",\n \"numberOfRepayments\": 12,\n \"principal\": 100000,\n \"productId\": 1,\n \"repaymentEvery\": 1,\n \"repaymentFrequency\": \"Monthly\"\n}"
response = http.request(request)
puts response.read_body{}Create Loan Account
A loan account application can be created by using this endpoint.Field Description
| Field | Description | Type |
|---|---|---|
| clientId | The client submitting a loan application. | Integer |
| productId | Desccribes the Identifier of the loan product associated with the loan application. The loan application inherits some of the information from its associated loan product. | Integer |
| principal | The loan amount to be disbursed to through loan. | Integer |
| duration | The loan term period to use. e.g. 10,12 | Integer |
| durationBy | Describes the type of duration cycle to be used for the loan. Available values include: [Month, Year] | String |
| loanType | To represent different type of loans. At present there are three type of loans are supported. Available loan types: individual: Loan given to individual member. group: Loan given to group as a whole. jlg: Joint liability group loan given to members in a group on individual basis. JLG loan can be given to one or more members in a group. | String |
| numberOfRepayments | This is the number of installments to repay. e.g 1 (repayments) every 12 months. | Integer |
| repaymentEvery | This is used like numberOfRepayments e.g 1 (repayments) every 1 month. | Integer |
| repaymentFrequency | This describes the frequency of payments for the loan. Available options include: [Monthly, Yearly] | String |
| interestRate | This describes the rate of interest calculated on the principal amount of the loan. | Integer |
| interestType | Describes the type of interest calculated on the loan. Examples include: fiat, declining, e.t.c. | String. |
| linkDepositAccountId | Describes the Identifier of the savings account to be linked to the loan account. | Integer |
| expectedDisbursementDate | The proposed disbursement date of the loan so a proposed repayment schedule can be provided. | String |
| createdDate | The date the loan application was submitted by applicant. | String |
| dateFormat | The default date format on WoodCore “dd MMMM yyyy” | String |
| locale | ”en” by default | String |
Parameters
- woodcoretenant (header, string, required: False): Example:
default
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/jsontext/plain
Example:
1092
Example:
"15 Mar 2022"
Example:
12
Example:
"Month"
Example:
"15 Mar 2022"
Example:
5
Example:
"Flat"
Example:
454
Example:
"individual"
Example:
12
Example:
100000
Example:
1
Example:
1
Example:
"Monthly"
Response
200 - application/json
{}
The response is of type object.
⌘I