Mifos X API Documentation
Mifos X is a secure, multi-tenanted microfinance platform.
The goal of the Mifos X API is to empower developers to build apps on top of the Mifos X Platform. The reference app (username: mifos, password: password) works on the same demo 'tenant' as the interactive links in this documentation.
The API is organized around REST.
The API is designed to have:
- predictable,
resource-oriented URLs
- to use HTTP response codes to
indicate API errors
- to use built-in HTTP features, like
HTTP authentication and HTTP verbs, which can be understood by
off-the-shelf HTTP clients.
JSON is returned in all responses from the API, including errors.
Much of the API presentation and design ideas are owed to the excellent Apigee "Web API Design" eBook/PDF and the very good Stripe API reference.
Try The API From Your Browser
GET (read) examples can be run directly from this documentation. It is just a matter of clicking a link. Most browsers display the output on the same page (or another tab if you right click and select that option). Internet Explorer will probably treat the output as if you wanted to download a file. In that case just elect to open the output in a text editor.
If you want to check out the POST, PUT and DELETE (update) examples a good approach is to take a moment to install a REST plugin for your browser e.g. RESTClient for FireFox
The REST plugins will allow you to- Select the "Verb" (e.g. POST)
- Enter the resource name (e.g. offices)
- Add a header to indicate you are sending JSON data as part of the request body (Content-Type: application/json)
- Add a header to indicate your 'tenant' (X-Mifos-Platform-TenantId: default)
- Paste the example JSON into a Request Body
- Send the Request (and receive a Response)
Generic Options
Convenience Templates
There are a list of convenience resources (see Template menu option). These resources end with "/template" and can be useful when building maintenance user interface screens for client applications. The template data returned may consist of any or all of:
- Field Defaults
- Allowed Value Lists
Also, many "Retrieve a" type resources (Retrieve a Client for example) allow the parameter option "template=true". This appends any "Allowed Value Lists" which can be useful when building update functionality.
Restrict Returned Fields
Parameter "fields={fieldlist}" can be used on GET requests to restrict the fields returned.
Normal Request:
Request (restricting fields returned):
Pretty JSON Formatting
Parameter "pretty=true" can be used to display JSON from GET requests in an easy-to-read format. This parameter is used in this documentation.
Easy-to-read JSON output for POSTs, PUTs and DELETEs will available in the REST plugin you use e.g. RESTClient for FireFox
Normal Request (with pretty printing/formatting):
Creating and Updating
When you want to 'Create a ...' you have to at least supply the mandatory fields. The mandatory fields are listed in this documentation under the relevant 'Create a ...' heading.
When you want to 'Update a ...' you can update individual fields or a combination of fields (subject to data integrity rules).
Updating Dates and Numbers
Dates
Dates are returned in GET requests as an array e.g. [ 2007, 4, 11]. However, the API accepts them as strings in POST and PUT requests. If there are any dates in your POST or PUT requests, you need to provide the "locale" and "dateFormat". This can be any date pattern supported by Joda-Time. This capability can help you when saving data in your client application as you shouldn't need to do any date format conversion prior to issuing your POST or PUT request.
JSON examples:
{
"locale": "en_US",
"dateFormat": "dd MMMM yyyy",
"openingDate": "01 July 2007"
}
{
"locale": "en_US",
"dateFormat": "yyyy-MM-dd",
"openingDate": "2007-03-21"
}
Numbers
You must provide a "locale" when updating numbers. Numbers are not "Ids" or "Types" but are typically money amounts or percentages that relate to loans. In any case, the API will send back an error message if you forget.
JSON examples:
{
"locale": "en_US",
"principal": "240,400.88"
}
{
"locale": "fr_CH",
"principal": "240 400.88"
}
Field Descriptions
Most fields are self-explanatory. Fields that aren't are described under the relevant resource heading e.g. AUTHENTICATION
Authentication Overview
Authentication to the API occurs via HTTP Basic Auth.
The platform has been configured to reject plain HTTP requests and to expect all API requests to be made over HTTPS. All requests must be authenticated.
// A Javascript/Jquery example of how to login to Mifos X and use its api.
// Typically, the javascript application would
// 1) Display a login page to retrieve the username and password.
// 2) Send the username and password to a function
// such as setBasicAuthKey below which sets the HTTP Basic Auth key.
// 3) The HTTP Basic Auth key is used in all subsequent requests
// (see the function executeAjaxRequest below).
function setBasicAuthKey(username, password) {
var jqxhr = $.ajax({
url : "authentication?username=" + username + "&password=" + password,
type : 'POST',
contentType : "application/json; charset=utf-8",
dataType : 'json',
data : "{}",
cache : false,
success : function(data, textStatus, jqXHR) {
basicAuthKey = data.base64EncodedAuthenticationKey;
},
error : function(jqXHR, textStatus, errorThrown) {
//error processing
}
});
}
function executeAjaxRequest(url, verbType, jsonData, basicAuthKey, successFunction, errorFunction) {
var jqxhr = $.ajax({
url : url,
type : verbType, //POST, GET, PUT or DELETE
contentType : "application/json; charset=utf-8",
dataType : 'json',
data : jsonData,
cache : false,
beforeSend : function(xhr) {
xhr.setRequestHeader("Authorization", "Basic " + basicAuthKey);
},
success : successFunction,
error : errorFunction
});
}
Errors
All errors are returned in JSON.
HTTP Status Code Summary
- 200 OK - Everything Worked.
- 400 Bad Request - Invalid Parameter or Data Integrity Issue.
- 401 Authentication Error.
- 403 Unauthorized Request.
- 404 Resource Not Found
- 500 Platform Internal Server Error.
Error Message returned when attempting to create an Office without passing any parameters
{
"developerMessage": "The request was invalid. This typically will happen due to validation errors which are provided.",
"developerDocLink": "https://github.com/openMF/mifosx/wiki/HTTP-API-Error-codes",
"httpStatusCode": "400",
"defaultUserMessage": "Validation errors exist.",
"userMessageGlobalisationCode": "validation.msg.validation.errors.exist",
"errors": [
{
"developerMessage": "The parameter name cannot be blank.",
"defaultUserMessage": "The parameter name cannot be blank.",
"userMessageGlobalisationCode": "validation.msg.office.name.cannot.be.blank",
"parameterName": "name",
"value": null,
"args": []
},
{
"developerMessage": "The parameter openingDate cannot be blank.",
"defaultUserMessage": "The parameter openingDate cannot be blank.",
"userMessageGlobalisationCode": "validation.msg.office.openingDate.cannot.be.blank",
"parameterName": "openingDate", "value": null, "args": []
},
{
"developerMessage": "The parameter parentId cannot be blank.",
"defaultUserMessage": "The parameter parentId cannot be blank.",
"userMessageGlobalisationCode":
"validation.msg.office.parentId.cannot.be.blank", "parameterName":
"parentId", "value": null, "args": []
}
]
}
Clients
Clients are people and businesses that have applied (or may apply) to an MFI for loans.
Field Descriptions |
| accountNo |
| If provided during client creation, its value is set as account no. for client account, otherwise an auto generated account no. is put in place based on the configured strategy. |
| firstname |
| Facility to break up name into parts suitable for humans. |
| middlename |
| Facility to break up name into parts suitable for humans. |
| lastname |
| Facility to break up name into parts suitable for humans. |
| fullname |
| Facility to set name of a client or business that doesnt suit the firstname,middlename,lastname structure. |
| externalId |
| A place to put an external reference for
this client e.g. The ID another system uses. If provided, it must be unique. |
List Clients
Example Requests:
GET https://DomainName/api/v1/clients
[
{
"id": 2,
"accountNo": "000000002",
"externalId": "one/78",
"fullname": "New Business to Create",
"displayName": "New Business to Create",
"officeId": 1,
"officeName": "Head Office",
"joinedDate": [2006,6,13]
},
{
"id": 1,
"accountNo": "000000001",
"externalId": "786YYH7",
"firstname": "Petra",
"lastname": "Yton",
"displayName": "Petra Yton",
"officeId": 1,
"officeName": "Head Office",
"joinedDate": [2009,3,4]
}
]
Retrieve Client Details Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/clients/template
{
"officeId": 1,
"joinedDate": [
2013,
2,
5
],
"allowedOffices": [
{
"id": 1,
"name": "Head Office",
"nameDecorated": "Head Office"
}
]
}
Retrieve a Client
Example Requests:
GET https://DomainName/api/v1/clients/{clientId}
{
"id": 1,
"accountNo": "000000001",
"externalId": "786YYH7",
"firstname": "Petra",
"lastname": "Yton",
"displayName": "Petra Yton",
"officeId": 1,
"officeName": "Head Office",
"joinedDate": [
2009,
3,
4
]
}
Create a Client
Note: You can enter either:
firstname/middlename/lastname - for a person (middlename is
optional) OR
fullname - for a business or organisation
(or person known by one name).
Mandatory Fields |
| firstname and lastname OR fullname , joinedDate, officeId |
POST https://DomainName/api/v1/clients
POST clients
Content-Type: application/json Request Body:
{
"officeId": 1,
"firstname": "Petra",
"lastname": "Yton",
"externalId": "786YYH7",
"dateFormat": "dd MMMM yyyy",
"locale": "en",
"joinedDate": "04 March 2009"
}
{
"officeId": 1,
"clientId": 1,
"resourceId": 1
}
POST clients
Content-Type: application/json
Request Body:
{
"officeId": 1,
"fullname": "New Business to Create",
"externalId": "one/78",
"dateFormat": "dd MMMM yyyy",
"locale": "en",
"joinedDate": "13 June 2006"
}
{
"officeId": 1,
"clientId": 2,
"resourceId": 2
}
Update a Client
PUT https://DomainName/api/v1/clients/{clientId}
PUT clients/1
Content-Type: application/json
Request Body:
{
"externalId": "786444UUUYYH7",
"dateFormat": "dd MMMM yyyy",
"locale": "en",
"joinedDate": "09 June 2006"
}
{
"officeId": 1,
"clientId": 1,
"resourceId": 1,
"changes": {
"externalId": "786444UUUYYH7",
"joinedDate": "09 June 2006",
"dateFormat": "dd MMMM yyyy",
"locale": "en"
}
}
Retrieve a Client's Loan Account Summary
An example of how a loan portfolio summary can be provided. This
one contains quite a bit of redundant data (like the counts) and
is requested in a specific use case of the Individual Lending User
Interface.
However, it is quite reasonable to add
resources like this to simplify User Interface development.
Example Requests:
GET https://DomainName/api/v1/clients/{clientId}/loans
{
"anyLoanCount": 9,
"pendingApprovalLoanCount": 4,
"pendingApprovalLoans": [
{
"id": 48,
"accountNo": "48",
"productId": 1,
"productName": "PORetailLoan",
"status": {
"id": 100,
"code": "loanStatusType.submitted.and.pending.approval",
"value": "Submitted and pending approval"
}
},
{
"id": 50,
"accountNo": "50",
"productId": 1,
"productName": "PORetailLoan",
"status": {
"id": 100,
"code": "loanStatusType.submitted.and.pending.approval",
"value": "Submitted and pending approval"
}
},
{
"id": 51,
"accountNo": "51",
"productId": 1,
"productName": "PORetailLoan",
"status": {
"id": 100,
"code": "loanStatusType.submitted.and.pending.approval",
"value": "Submitted and pending approval"
}
},
{
"id": 62,
"accountNo": "62",
"productId": 3,
"productName": "Further Loan Product",
"status": {
"id": 100,
"code": "loanStatusType.submitted.and.pending.approval",
"value": "Submitted and pending approval"
}
}
],
"activeLoanCount": 2,
"openLoans": [
{
"id": 46,
"accountNo": "46",
"productId": 1,
"productName": "PORetailLoan",
"status": {
"id": 300,
"code": "loanStatusType.active",
"value": "Active"
}
},
{
"id": 60,
"accountNo": "60",
"productId": 1,
"productName": "PORetailLoan",
"status": {
"id": 300,
"code": "loanStatusType.active",
"value": "Active"
}
}
],
"closedLoanCount": 3,
"closedLoans": [
{
"id": 22,
"accountNo": "22",
"productId": 1,
"productName": "PORetailLoan",
"status": {
"id": 700,
"code": "loanStatusType.overpaid",
"value": "Overpaid"
}
},
{
"id": 33,
"accountNo": "33",
"productId": 1,
"productName": "PORetailLoan",
"status": {
"id": 601,
"code": "loanStatusType.closed.written.off",
"value": "Closed (written off)"
}
},
{
"id": 44,
"accountNo": "44",
"productId": 1,
"productName": "PORetailLoan",
"status": {
"id": 600,
"code": "loanStatusType.closed.obligations.met",
"value": "Closed (obligations met)"
}
}
]
}
Client Identifiers
Client Identifiers refer to documents that are
used to uniquely identify a customer
Ex: Drivers License, Passport, Ration card etc
Field Descriptions |
| documentKey |
| Number/String used to uniquely identify a particular document (Driving License number for a driving license etc) |
| documentType |
| Type of the identification document (License, Passport Etc) |
| description |
| Any user comments to be associated with the Client Identifier |
List all Identifiers for a Client
Example Requests:
GET https://DomainName/api/v1/clients/{clientId}/identifiers
[
{
"id": 2,
"clientId": 1,
"documentType": {
"id": 3,
"name": "Drivers License"
},
"documentKey": "12345",
"description": "Issued in the year 2--7"
}
]
Retrieve Client Identifier Details Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/clients/{clientId}/identifiers/template
{
"allowedDocumentTypes": [
{
"id": 1,
"name": "Passport",
"position": 0
},
{
"id": 2,
"name": "Id",
"position": 0
},
{
"id": 3,
"name": "Drivers License",
"position": 0
},
{
"id": 4,
"name": "Any Other Id Type",
"position": 0
}
]
}
Retrieve a Client Identifier
Example Requests:
GET https://DomainName/api/v1/clients/{clientId}/identifiers/{identifierId}
{
"id": 2,
"clientId": 1,
"documentType": {
"id": 3,
"name": "Drivers License"
},
"documentKey": "12345",
"description": "Issued in 2007"
}
Create an Identifier for a Client
Mandatory Fields |
| documentKey, documentTypeId |
POST https://DomainName/api/v1/clients/{clientId}/identifiers
POST clients/1/identifiers
Content-Type: application/json
Request Body:
{
"documentTypeId":"1",
"documentKey":"KA-54677",
"description":"Document has been verified"
}
{
"officeId": 1,
"clientId": 1,
"resourceId": 3
}
Update a Client Identifier
PUT https://DomainName/api/v1/clients/{clientId}/identifiers/{identifierId}
PUT clients/1/identifiers/3
Content-Type: application/json
Request Body:
{
"documentTypeId":"4",
"documentKey":"KA-94667",
"description":"Document has been updated"
}
{
"officeId": 1,
"clientId": 1,
"resourceId": 3,
"changes": {
"documentTypeId": 4,
"documentKey": "KA-94667",
"description": "Document has been updated"
}
}
Delete a Client Identifier
DELETE https://DomainName/api/v1/clients/{clientId}/identifiers/{identifierId}
DELETE clients/1/identifiers/3
Content-Type: application/json
No Request Body:
{
"officeId": 1,
"clientId": 1,
"resourceId": 3
}
Client Images
The current API provides support for the addition of a single
image for a Client
Allowed formats: JPEG (.jpg or .jpeg), GIF (.gif) and PNG (.png)
The API supports two different Approaches for manipulating Client Images
- Data URI's: For easier manipulation by Javascript clients etc in supported Browsers.
- Multi-part form data: Images can be uploaded using Multi part forms and downloaded as regular binary files
Get Client Image (DATA URI)
Example Requests:
GET https://DomainName/api/v1/clients/{clientId}/images
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ
bWFnZVJlYWR5ccllPAAAAJ1JREFUeNpi+P//PwMIA4E9EG8E4idQDGLbw+WhiiqA+D8OXAFVAzbp
DxBvB2JLIGaGYkuoGEjOhhFIHAbij0BdPgxYACMj42ogJQpifwBiXSDeC8JIbt4LxSC5DyxQjTeB
+BeaYb+Q5EBOAVutCzMJHUNNPADzzDokiYdAfAmJvwLkGeTgWQfyKZICS6hYBTwc0QL8ORSjBDhA
gAEAOg13B6R/SAgAAAAASUVORK5CYII=
Get Client Image (Binary file)
GET https://DomainName/api/v1/clients/{clientId}/images
POST clients/1/images
Accept: application/octet-stream
Not shown: The corresponding binary (image) file
Upload an Image for a Client (Data URI)
POST https://DomainName/api/v1/clients/{clientId}/images
POST clients/1/images
Content-Type: text/plain
Request Body:
data:image/png;base64,iVBORw0KGgoAA
AANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0l
EQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6
P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC
{
"resourceId": 1,
"changes": {},
"resourceIdentifier": "1"
}
Upload an Image for a Client (Multi-part Form data)
Mandatory Fields |
| file |
The form should contain a required named body part with the
name "file".
If you are using a HTML form, a snippet like
<input type="file" name="file"></input>
can be used for uploading the image file
POST https://DomainName/api/v1/clients/{clientId}/images
POST clients/1/images
Content-Type: multipart/form-data
Request Body: Not shown
{
"resourceId": 1,
"changes": {},
"resourceIdentifier": "1"
}
Update a Client Image (Data URI)
PUT https://DomainName/api/v1/clients/{clientId}/images
PUT clients/1/images
Content-Type: text/plain
Request Body:
data:image/png;base64,iVBORw0KGgoAA
AANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0l
EQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6
P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC
{
"resourceId": 1,
"changes": {},
"resourceIdentifier": "1"
}
Update a Client Image (Multi-part Form data)
Mandatory Fields |
| file |
The form should contain a required named body part with the
name "file".
If you are using a HTML form, a snippet like
<input type="file" name="file"></input>
can be used for uploading the image file
PUT https://DomainName/api/v1/clients/{clientId}/images
PUT clients/1/images
Content-Type: multipart/form-data
Request Body: Not shown
Delete a Client Image
DELETE https://DomainName/api/v1/clients/{clientId}/images
DELETE clients/1/images
Content-Type: application/json
No Request Body:
{
"resourceId": 1,
"changes": {},
"resourceIdentifier": "1"
}
Groups
Groups are collection of clients for specific purpose (JLG,SHG, Program etc)
Field Descriptions |
| office_id |
| It stores the officeid of office, to this officer Group belongs. |
| loan_officer_id |
| Id of the officer who manages this group. |
| name |
| Human friendly identity of the Group (Name given to the group). |
| externalId |
| A place to put an external reference for
this group e.g. The ID another system uses. If provided, it must be unique. |
| is_deleted |
| Indicator for active or archived groups. |
Create a Group
Mandatory Fields |
| name officeId clients |
POST https://DomainName/mifosng-provider/api/v1/groups
POST groups
Content-Type: application/json Request Body:
{
"officeId":"1",
"name":"TA Group",
"externalId":"",
"clientMembers":["82","83","84"]
}
{"resourceId":24,"changes":{}}
List Groups
Example Requests:
GET https://DomainName/mifosng-provider/api/v1/groups
[{
"id": 1,
"name": "GWT_2",
"externalId": "GWT_EX_ID_2",
"officeId": 7,
"officeName": "Z2"
}, {
"id": 2,
"name": "group22",
"externalId": "11234",
"officeId": 1,
"officeName": "Head Office"
}, {
"id": 3,
"name": "PlusOne",
"officeId": 22,
"officeName": "North Point Office"
}]
Retrieve a Group
Example Requests:
GET https://DomainName/mifosng-provider/api/v1/groups/10
{
"id": 10,
"name": "test123",
"externalId": "tejjjst",
"officeId": 1,
"officeName": "Head Office",
"clientMembers": [{
"id": 1,
"displayName": "Willie O\u0027Meara"
}]
}
Retrieve a Groups's Loan Account Summary
An example of how a loan portfolio summary can be provided. This one contains quite a bit of redundant data (like the counts)
Example Requests:
GET https://DomainName/mifosng-provider/api/v1/groups/7/loans
{
"anyLoanCount": 1,
"pendingApprovalLoanCount": 0,
"pendingApprovalLoans": [],
"awaitingDisbursalLoanCount": 0,
"awaitingDisbursalLoans": [],
"activeLoanCount": 1,
"openLoans": [{
"id": 79,
"productId": 1,
"productName": "1-PORetailLoan",
"accountStatusId": 300
}],
"closedLoanCount": 0,
"closedLoans": [],
"anyIndividualLoanCount": 3,
"pendingApprovalIndividualLoanCount": 0,
"pendingApprovalIndividualLoans": [],
"awaitingDisbursalIndividualLoanCount": 0,
"awaitingDisbursalIndividualLoans": [],
"activeIndividualLoanCount": 3,
"openIndividualLoans": [{
"id": 80,
"productId": 17,
"productName": "17-Intrasoft Business Loan",
"accountStatusId": 300
}, {
"id": 81,
"productId": 1,
"productName": "1-PORetailLoan",
"accountStatusId": 300
}, {
"id": 82,
"productId": 13,
"productName": "13-A Flat Loan",
"accountStatusId": 300
}],
"closedIndividualLoanCount": 0,
"closedIndividualLoans": []
}
Update a Group
PUT https://DomainName/mifosng-provider/api/v1/groups/{groupid}
PUT groups/7
Content-Type: application/json
Request Body:
{
"officeId": "26",
"name": "Laxmi SSG U",
"externalId": "Unq 2--124",
"clientMembers": ["91", "93", "94"]
}
{
"resourceId":7,
"changes":{}
}
Assign a Loan Officer to Group
POST https://DomainName/mifosng-provider/api/v1/groups/{groupid}/command/assign_loanofficer
POST groups/20/command/assign_loanofficer
Content-Type: application/json
Request Body:
{
{"loanOfficerId":"1"}
}
{
"resourceId":20,
"changes":{}
}
Unassign a loan officer to a Group
POST https://DomainName/mifosng-provider/api/v1/groups/{groupid}/command/assign_loanofficer
POST groups/20/command/unassign_loanofficer
Content-Type: application/json
Request Body:
{
{"loanOfficerId":"1"}
}
{
"resourceId":20,
"changes":{}
}
Delete a Group
POST https://DomainName/mifosng-provider/api/v1/groups/{groupid}
DELETE groups/7
{
"resourceId":7,
"changes":{}
}
Loans
The API concept of loans models the loan application process and the loan contract/monitoring process.
Field Descriptions |
| accountNo |
| The account no. associated with this loan. Is auto generated if not provided at loan application creation time. |
| externalId |
| A place to put an external reference for
this loan e.g. The ID another system uses. If provided, it must be unique. |
| fundId |
| Optional: For associating a loan with a given fund. |
| loanOfficerId |
| Optional: For associating a loan with a given staff member who is a loan officer. |
| loanPurposeId |
| Optional: For marking a loan with a given loan purpose option. Loan purposes are configurable and can be setup by system admin through code/code values screens. |
| principal |
| The loan amount to be disbursed to through loan. |
| loanTermFrequency |
| The length of loan term Used like: loanTermFrequency loanTermFrequencyType e.g. 12 Months |
| loanTermFrequencyType |
| The loan term period to use. Used like:
loanTermFrequency loanTermFrequencyType e.g. 12 Months Example Values: 0=Days, 1=Weeks, 2=Months, 3=Years |
| numberOfRepayments |
| Number of installments to repay. Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks |
| repaymentEvery |
| Used like: numberOfRepayments Every
repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks |
| repaymentFrequencyType |
| Used like: numberOfRepayments Every
repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks Example Values: 0=Days, 1=Weeks, 2=Months |
| interestRatePerPeriod |
| Interest Rate. Used like: interestRatePerPeriod % interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance |
| interestRateFrequencyType |
| Used like: interestRatePerPeriod%
interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance Example Values: 2=Per month, 3=Per year |
| expectedDisbursementDate |
| The proposed disbursement date of the loan so a proposed repayment schedule can be provided. |
| submittedOnDate |
| The date the loan application was submitted by applicant. |
| amortizationType |
| Example Values: 0=Equal principle payments, 1=Equal installments |
| interestType |
| Used like: interestRatePerPeriod%
interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance Example Values: 0=Declining Balance, 1=Flat |
| interestCalculationPeriodType |
| Example Values: 0=Daily, 1=Same as repayment period |
| inArrearsTolerance |
| The amount that can be 'waived' at end
of all loan payments because it is too small to worry about. This is also the tolerance amount assessed when determining if a loan is in arrears. |
| transactionProcessingStrategyId |
| The type of transaction processing strategy to be used. At present some MFI specific ones exist. This is an important point of change for many MFIs. Responsible for things like payment order and how early or late repayments should be processed. Out of the box, four available:
|
Retrieve Loan Details Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Arguments
- clientId
- Integer mandatory
- productId
- Integer optional
- If entered, productId, productName and selectedProduct fields are returned.
Example Requests:
GET https://DomainName/api/v1/loans/template?clientId=1
{
"clientId": 1,
"clientName": "Kampala first Client",
"clientOfficeId": 2,
"timeline": {
"expectedDisbursementDate": [
2013,
3,
8
]
},
"productOptions": [
{
"id": 1,
"name": "Kampala Product (with cash accounting)"
}
]
}
GET https://DomainName/api/v1/loans/template?clientId=1&productId=1
{
"clientId": 1,
"clientName": "Kampala first Client",
"clientOfficeId": 2,
"loanProductId": 1,
"loanProductName": "Kampala Product (with cash accounting)",
"loanProductDescription": "Typical Kampala loan product with cash accounting enabled for testing.",
"currency": {
"code": "UGX",
"name": "Uganda Shilling",
"decimalPlaces": 2,
"displaySymbol": "USh",
"nameCode": "currency.UGX",
"displayLabel": "Uganda Shilling (USh)"
},
"principal": 1000000,
"termFrequency": 12,
"termPeriodFrequencyType": {
"id": 2,
"code": "repaymentFrequency.periodFrequencyType.months",
"value": "Months"
},
"numberOfRepayments": 12,
"repaymentEvery": 1,
"repaymentFrequencyType": {
"id": 2,
"code": "repaymentFrequency.periodFrequencyType.months",
"value": "Months"
},
"interestRatePerPeriod": 24,
"interestRateFrequencyType": {
"id": 3,
"code": "interestRateFrequency.periodFrequencyType.years",
"value": "Per year"
},
"annualInterestRate": 24,
"amortizationType": {
"id": 1,
"code": "amortizationType.equal.installments",
"value": "Equal installments"
},
"interestType": {
"id": 1,
"code": "interestType.flat",
"value": "Flat"
},
"interestCalculationPeriodType": {
"id": 1,
"code": "interestCalculationPeriodType.same.as.repayment.period",
"value": "Same as repayment period"
},
"transactionProcessingStrategyId": 2,
"timeline": {
"expectedDisbursementDate": [
2013,
3,
8
]
},
"charges": [],
"productOptions": [
{
"id": 1,
"name": "Kampala Product (with cash accounting)"
}
],
"loanOfficerOptions": [
{
"id": 2,
"firstname": "Kampala",
"lastname": "LoanOfficer",
"displayName": "LoanOfficer, Kampala",
"officeId": 2,
"officeName": "Uganda (Kampala)",
"isLoanOfficer": true
}
],
"loanPurposeOptions": [
{
"id": 20,
"name": "option.Agriculture",
"position": 1
},
{
"id": 21,
"name": "option.Manufacturing",
"position": 20
},
{
"id": 22,
"name": "option.HousingImprovement",
"position": 21
}
],
"termFrequencyTypeOptions": [
{
"id": 0,
"code": "loanTermFrequency.periodFrequencyType.days",
"value": "Days"
},
{
"id": 1,
"code": "loanTermFrequency.periodFrequencyType.weeks",
"value": "Weeks"
},
{
"id": 2,
"code": "loanTermFrequency.periodFrequencyType.months",
"value": "Months"
},
{
"id": 3,
"code": "loanTermFrequency.periodFrequencyType.years",
"value": "Years"
}
],
"repaymentFrequencyTypeOptions": [
{
"id": 0,
"code": "repaymentFrequency.periodFrequencyType.days",
"value": "Days"
},
{
"id": 1,
"code": "repaymentFrequency.periodFrequencyType.weeks",
"value": "Weeks"
},
{
"id": 2,
"code": "repaymentFrequency.periodFrequencyType.months",
"value": "Months"
}
],
"interestRateFrequencyTypeOptions": [
{
"id": 2,
"code": "interestRateFrequency.periodFrequencyType.months",
"value": "Per month"
},
{
"id": 3,
"code": "interestRateFrequency.periodFrequencyType.years",
"value": "Per year"
}
],
"amortizationTypeOptions": [
{
"id": 1,
"code": "amortizationType.equal.installments",
"value": "Equal installments"
},
{
"id": 0,
"code": "amortizationType.equal.principal",
"value": "Equal principle payments"
}
],
"interestTypeOptions": [
{
"id": 1,
"code": "interestType.flat",
"value": "Flat"
},
{
"id": 0,
"code": "interestType.declining.balance",
"value": "Declining Balance"
}
],
"interestCalculationPeriodTypeOptions": [
{
"id": 0,
"code": "interestCalculationPeriodType.daily",
"value": "Daily"
},
{
"id": 1,
"code": "interestCalculationPeriodType.same.as.repayment.period",
"value": "Same as repayment period"
}
],
"transactionProcessingStrategyOptions": [
{
"id": 2,
"code": "heavensfamily-strategy",
"name": "Heavensfamily"
}
],
"chargeOptions": [
{
"id": 1,
"name": "Bank Fee (per installment)",
"active": true,
"penalty": false,
"currency": {
"code": "UGX",
"name": "Uganda Shilling",
"decimalPlaces": 2,
"displaySymbol": "USh",
"nameCode": "currency.UGX",
"displayLabel": "Uganda Shilling (USh)"
},
"amount": 1500,
"chargeTimeType": {
"id": 2,
"code": "chargeTimeType.specifiedDueDate",
"value": "Specified due date"
},
"chargeAppliesTo": {
"id": 1,
"code": "chargeAppliesTo.loan",
"value": "Loan"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
}
}
],
"loanCollateralOptions": [
{
"id": 17,
"name": "option.House",
"position": 1
},
{
"id": 18,
"name": "option.Television",
"position": 17
},
{
"id": 19,
"name": "option.Gold",
"position": 18
}
]
}
Retrieve a Loan
Note: template=true parameter doesn't apply to this resource.
Arguments
- associations
- optional, Either 'all' or a comma separated list of loan 'associations' (itemised below).
-
Associations are just extra pieces of data that you might or might not want to retrieve.
- 'all': Gets all association data.
- 'repaymentSchedule': Loan schedule data.
- 'transactions': Loan transactions data.
- 'charges': Loan charges data.
- 'guarantors': Loan guarantors data.
- 'collateral': Loan collateral data.
Example Requests:
GET https://DomainName/api/v1/loans/{loanId}
{
"id": 1,
"accountNo": "000000001",
"status": {
"id": 300,
"code": "loanStatusType.active",
"value": "Active",
"pendingApproval": false,
"waitingForDisbursal": false,
"active": true,
"closedObligationsMet": false,
"closedWrittenOff": false,
"closedRescheduled": false,
"closed": false,
"overpaid": false
},
"clientId": 1,
"clientName": "Kampala first Client",
"clientOfficeId": 2,
"loanProductId": 1,
"loanProductName": "Kampala Product (with cash accounting)",
"loanProductDescription": "Typical Kampala loan product with cash accounting enabled for testing.",
"loanPurposeId": 22,
"loanPurposeName": "option.HousingImprovement",
"loanOfficerId": 2,
"loanOfficerName": "LoanOfficer, Kampala",
"currency": {
"code": "UGX",
"name": "Uganda Shilling",
"decimalPlaces": 2,
"displaySymbol": "USh",
"nameCode": "currency.UGX",
"displayLabel": "Uganda Shilling (USh)"
},
"principal": 1000000,
"termFrequency": 12,
"termPeriodFrequencyType": {
"id": 2,
"code": "termFrequency.periodFrequencyType.months",
"value": "Months"
},
"numberOfRepayments": 12,
"repaymentEvery": 1,
"repaymentFrequencyType": {
"id": 2,
"code": "repaymentFrequency.periodFrequencyType.months",
"value": "Months"
},
"interestRatePerPeriod": 24,
"interestRateFrequencyType": {
"id": 3,
"code": "interestRateFrequency.periodFrequencyType.years",
"value": "Per year"
},
"annualInterestRate": 24,
"amortizationType": {
"id": 1,
"code": "amortizationType.equal.installments",
"value": "Equal installments"
},
"interestType": {
"id": 1,
"code": "interestType.flat",
"value": "Flat"
},
"interestCalculationPeriodType": {
"id": 1,
"code": "interestCalculationPeriodType.same.as.repayment.period",
"value": "Same as repayment period"
},
"transactionProcessingStrategyId": 2,
"timeline": {
"submittedOnDate": [
2012,
4,
3
],
"submittedByUsername": "admin",
"submittedByFirstname": "App",
"submittedByLastname": "Administrator",
"approvedOnDate": [
2012,
4,
3
],
"approvedByUsername": "admin",
"approvedByFirstname": "App",
"approvedByLastname": "Administrator",
"expectedDisbursementDate": [
2012,
4,
10
],
"actualDisbursementDate": [
2012,
4,
10
],
"disbursedByUsername": "admin",
"disbursedByFirstname": "App",
"disbursedByLastname": "Administrator",
"expectedMaturityDate": [
2013,
4,
10
]
},
"summary": {
"currency": {
"code": "UGX",
"name": "Uganda Shilling",
"decimalPlaces": 2,
"displaySymbol": "USh",
"nameCode": "currency.UGX",
"displayLabel": "Uganda Shilling (USh)"
},
"principalDisbursed": 1000000,
"principalPaid": 0,
"principalWrittenOff": 0,
"principalOutstanding": 1000000,
"principalOverdue": 833333.3,
"interestCharged": 240000,
"interestPaid": 0,
"interestWaived": 0,
"interestWrittenOff": 0,
"interestOutstanding": 240000,
"interestOverdue": 200000,
"feeChargesCharged": 18000,
"feeChargesDueAtDisbursementCharged": 0,
"feeChargesPaid": 0,
"feeChargesWaived": 0,
"feeChargesWrittenOff": 0,
"feeChargesOutstanding": 18000,
"feeChargesOverdue": 15000,
"penaltyChargesCharged": 0,
"penaltyChargesPaid": 0,
"penaltyChargesWaived": 0,
"penaltyChargesWrittenOff": 0,
"penaltyChargesOutstanding": 0,
"penaltyChargesOverdue": 0,
"totalExpectedRepayment": 1258000,
"totalRepayment": 0,
"totalExpectedCostOfLoan": 258000,
"totalCostOfLoan": 0,
"totalWaived": 0,
"totalWrittenOff": 0,
"totalOutstanding": 1258000,
"totalOverdue": 1048333.3,
"overdueSinceDate": [
2012,
5,
10
]
}
}
Calculate loan repayment schedule
Mandatory Fields |
| productId, principal, loanTermFrequency, loanTermFrequencyType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, expectedDisbursementDate, transactionProcessingStrategyId |
POST https://DomainName/api/v1/loans?command=calculateLoanSchedule
POST loans?command=calculateLoanSchedule
Content-Type: application/json
Request Body:
{
"dateFormat": "dd MMMM yyyy",
"locale": "en_GB",
"productId": 1,
"principal": "100,000.00",
"loanTermFrequency": 12,
"loanTermFrequencyType": 2,
"numberOfRepayments": 12,
"repaymentEvery": 1,
"repaymentFrequencyType": 2,
"interestRatePerPeriod": 2,
"interestRateFrequencyType": 2,
"amortizationType": 1,
"interestType": 0,
"interestCalculationPeriodType": 1,
"expectedDisbursementDate": "20 September 2011",
"transactionProcessingStrategyId": 2
}
{
"currency": {
"code": "UGX",
"name": "Uganda Shilling",
"decimalPlaces": 2,
"displaySymbol": "USh",
"nameCode": "currency.UGX",
"displayLabel": "Uganda Shilling (USh)"
},
"loanTermInDays": 366,
"totalPrincipalDisbursed": 100000,
"totalPrincipalExpected": 100000,
"totalPrincipalPaid": 0,
"totalInterestCharged": 13471.52,
"totalFeeChargesCharged": 0,
"totalPenaltyChargesCharged": 0,
"totalWaived": 0,
"totalWrittenOff": 0,
"totalRepaymentExpected": 113471.52,
"totalRepayment": 0,
"totalOutstanding": 0,
"periods": [
{
"period": 0,
"dueDate": [
2011,
9,
20
],
"principalDisbursed": 100000,
"principalLoanBalanceOutstanding": 100000,
"feeChargesDue": 0,
"feeChargesOutstanding": 0,
"totalOriginalDueForPeriod": 0,
"totalDueForPeriod": 0,
"totalOutstandingForPeriod": 0,
"totalOverdue": 0,
"totalActualCostOfLoanForPeriod": 0
},
{
"period": 1,
"fromDate": [
2011,
9,
20
],
"dueDate": [
2011,
10,
20
],
"daysInPeriod": 30,
"principalOriginalDue": 7455.96,
"principalDue": 7455.96,
"principalOutstanding": 7455.96,
"principalLoanBalanceOutstanding": 92544.04,
"interestOriginalDue": 2000,
"interestDue": 2000,
"interestOutstanding": 2000,
"feeChargesDue": 0,
"penaltyChargesDue": 0,
"totalOriginalDueForPeriod": 9455.96,
"totalDueForPeriod": 9455.96,
"totalPaidForPeriod": 0,
"totalOutstandingForPeriod": 9455.96,
"totalOverdue": 9455.96,
"totalActualCostOfLoanForPeriod": 2000
},
...
...
{
"period": 12,
"fromDate": [
2012,
8,
20
],
"dueDate": [
2012,
9,
20
],
"daysInPeriod": 31,
"principalOriginalDue": 9270.56,
"principalDue": 9270.56,
"principalOutstanding": 9270.56,
"principalLoanBalanceOutstanding": 0,
"interestOriginalDue": 185.4,
"interestDue": 185.4,
"interestOutstanding": 185.4,
"feeChargesDue": 0,
"penaltyChargesDue": 0,
"totalOriginalDueForPeriod": 9455.96,
"totalDueForPeriod": 9455.96,
"totalPaidForPeriod": 0,
"totalOutstandingForPeriod": 9455.96,
"totalOverdue": 9455.96,
"totalActualCostOfLoanForPeriod": 185.4
}
]
}
Submit a new Loan Application
Mandatory Fields |
| clientId, productId, principal, loanTermFrequency, loanTermFrequencyType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, transactionProcessingStrategyId, expectedDisbursementDate, submittedOnDate |
POST https://DomainName/api/v1/loans
POST loans
Content-Type: application/json
Request Body:
{
"dateFormat": "dd MMMM yyyy",
"locale": "en_GB",
"clientId": 1,
"productId": 1,
"principal": "100,000.00",
"loanTermFrequency": 12,
"loanTermFrequencyType": 2,
"numberOfRepayments": 12,
"repaymentEvery": 1,
"repaymentFrequencyType": 2,
"interestRatePerPeriod": 2,
"interestRateFrequencyType": 2,
"amortizationType": 1,
"interestType": 0,
"interestCalculationPeriodType": 1,
"transactionProcessingStrategyId": 1,
"expectedDisbursementDate": "20 September 2011",
"submittedOnDate": "20 September 2011"
}
{
"officeId": 1,
"clientId": 1,
"loanId": 1,
"resourceId": 1
}
Approve Loan Application
Mandatory Fields |
| approvedOnDate |
POST https://DomainName/api/v1/loans/{loanId}?command=approve
POST loans/1?command=approve
Content-Type: application/json
Request Body:
{
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"approvedOnDate": "20 September 2011",
"note": "Loan approval note"
}
{
"officeId": 1,
"clientId": 1,
"loanId": 1,
"resourceId": 1,
"changes": {
"status": {
"id": 200,
"code": "loanStatusType.approved",
"value": "Approved",
"pendingApproval": false,
"waitingForDisbursal": true,
"active": false,
"closedObligationsMet": false,
"closedWrittenOff": false,
"closedRescheduled": false,
"closed": false,
"overpaid": false
},
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"approvedOnDate": "20 September 2011",
"note": "Loan approval note"
}
}
Undo Loan Application Approval
POST https://DomainName/api/v1/loans/{loanId}?command=undoApproval
POST loans/1?command=undoApproval
Content-Type: application/json
Request Body:
{
"note": "Loan undo approval note"
}
{
"officeId": 1,
"clientId": 1,
"loanId": 1,
"resourceId": 1,
"changes": {
"status": {
"id": 100,
"code": "loanStatusType.submitted.and.pending.approval",
"value": "Submitted and pending approval",
"pendingApproval": true,
"waitingForDisbursal": false,
"active": false,
"closedObligationsMet": false,
"closedWrittenOff": false,
"closedRescheduled": false,
"closed": false,
"overpaid": false
},
"approvedOnDate": ""
}
}
Reject Loan Application
Mandatory Fields |
| rejectedOnDate |
POST https://DomainName/api/v1/loans/{loanId}?command=reject
POST loans/1?command=reject
Content-Type: application/json
Request Body:
{
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"rejectedOnDate": "20 September 2011",
"note": "Loan rejection reason."
}
{
"officeId": 1,
"clientId": 1,
"loanId": 1,
"resourceId": 1,
"changes": {
"status": {
"id": 500,
"code": "loanStatusType.rejected",
"value": "Rejected",
"pendingApproval": false,
"waitingForDisbursal": false,
"active": false,
"closedObligationsMet": false,
"closedWrittenOff": false,
"closedRescheduled": false,
"closed": false,
"overpaid": false
},
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"rejectedOnDate": "20 September 2011",
"closedOnDate": "20 September 2011"
}
}
Applicant Withdraws from Loan Application
Mandatory Fields |
| withdrawnOnDate |
POST https://DomainName/api/v1/loans/{loanId}?command=withdrawnByApplicant
POST loans/1?command=withdrawnByApplicant
Content-Type: application/json
Request Body:
{
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"withdrawnOnDate": "20 September 2011",
"note": "Reason loan applicant withdrew from application."
}
{
"officeId": 1,
"clientId": 1,
"loanId": 2,
"resourceId": 2,
"changes": {
"status": {
"id": 400,
"code": "loanStatusType.withdrawn.by.client",
"value": "Withdrawn by applicant",
"pendingApproval": false,
"waitingForDisbursal": false,
"active": false,
"closedObligationsMet": false,
"closedWrittenOff": false,
"closedRescheduled": false,
"closed": false,
"overpaid": false
},
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"withdrawnOnDate": "20 September 2011",
"closedOnDate": "20 September 2011"
}
}
Disburse Loan
Mandatory Fields |
| actualDisbursementDate |
POST https://DomainName/api/v1/loans/{loanId}?command=disburse
POST loans/1?command=disburse
Content-Type: application/json
Request Body:
{
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"actualDisbursementDate": "20 September 2011",
"note": "Any additional info related to disbursement of funds to applicant."
}
{
"officeId": 1,
"clientId": 1,
"loanId": 4,
"resourceId": 4,
"changes": {
"status": {
"id": 300,
"code": "loanStatusType.active",
"value": "Active",
"pendingApproval": false,
"waitingForDisbursal": false,
"active": true,
"closedObligationsMet": false,
"closedWrittenOff": false,
"closedRescheduled": false,
"closed": false,
"overpaid": false
},
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"actualDisbursementDate": "20 September 2011"
}
}
Undo Loan Disbursal
POST https://DomainName/api/v1/loans/{loanId}?command=undoDisbursal
POST loans/1?command=undoDisbursal
Content-Type: application/json
{
"officeId": 1,
"clientId": 1,
"loanId": 4,
"resourceId": 4,
"changes": {
"status": {
"id": 200,
"code": "loanStatusType.approved",
"value": "Approved",
"pendingApproval": false,
"waitingForDisbursal": true,
"active": false,
"closedObligationsMet": false,
"closedWrittenOff": false,
"closedRescheduled": false,
"closed": false,
"overpaid": false
},
"actualDisbursementDate": ""
}
}
Delete a Loan Application
Note: Only loans in "Submitted and awaiting approval" status can be deleted.
DELETE https://DomainName/api/v1/loans/{loanId}
DELETE loans/1
Content-Type: application/json
No Request Body:
{
"officeId": 1,
"clientId": 1,
"loanId": 1,
"resourceId": 1
}
Loan Transactions
Capabilities include loan repayment's, interest waivers and the ability to 'adjust' an existing transaction. An 'adjust'ment of a transaction is really a 'reversal' of existing transaction followed by creation of a new transaction with the provided details.
Field Descriptions |
| transactionAmount |
| The amount of the transaction. |
| transactionDate |
| The date of the transaction. |
Retrieve Loan Transaction Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Arguments
- command
- String mandatory, case-insensitive
-
'repayment'
"date" is set to the date of the first outstanding installment.
"total" "amount" is set to the amount outstanding. -
'waiver'
"date" is set to the current date.
"total" "amount" is set to the remaining loan principal outstanding. The amount that can be waived is limited to the loan's inArrearsTolerance
Example Request:
GET https://DomainName/api/v1/loans/{loanId}/transactions/template"
{
"transactionType": {
"id": 2,
"code": "loanTransactionType.repayment",
"value": "Repayment"
},
"date": [
2009,
8,
1
],
"total": {
"currencyCode": "XOF",
"digitsAfterDecimal": 0,
"amount": 471,
"defaultName": "CFA Franc BCEAO",
"nameCode": "currency.XOF",
"displaySymbol": "CFA",
"zero": false,
"greaterThanZero": true,
"displaySymbolValue": "471 CFA"
}
}
Make a Repayment
POST https://DomainName/api/v1/loans/{loanId}/transactions?command=repayment
POST loans/5/transactions?command=repayment
Content-Type: application/json
Request Body:
{
"locale": "en_GB",
"dateFormat": "dd MMMM yyyy",
"transactionDate": "14 May 2012",
"transactionAmount": "559.88",
"note": "Optional note related to the transaction."
}
{
"officeId": 1,
"clientId": 1,
"loanId": 5,
"resourceId": 3,
"changes": {
"transactionDate": "14 May 2012",
"transactionAmount": "559.88",
"locale": "en_GB",
"dateFormat": "dd MMMM yyyy",
"note": "Optional note related to the transaction."
}
}
Waive Interest
POST https://DomainName/api/v1/loans/{loanId}/transactions?command=waiveInterest
POST loans/5/transactions?command=waiveInterest
Content-Type: application/json
Request Body:
{
"locale": "en_GB",
"dateFormat": "dd MMMM yyyy",
"transactionDate": "14 May 2012",
"transactionAmount": "400",
"note": "Optional note related to the waiving of interest."
}
{
"officeId": 1,
"clientId": 1,
"loanId": 5,
"resourceId": 5,
"changes": {
"transactionDate": "14 May 2012",
"transactionAmount": "400",
"locale": "en_GB",
"dateFormat": "dd MMMM yyyy",
"note": "Optional note related to the interest waiver."
}
}
Write-off Loan
POST https://DomainName/api/v1/loans/{loanId}/transactions?command=writeoff
POST loans/70/transactions?command=writeoff
Content-Type: application/json
Request Body:
{
"locale": "en_GB",
"dateFormat": "dd MMMM yyyy",
"transactionDate": "14 May 2012",
"note": "Write-off note"
}
{
"officeId": 1,
"clientId": 7,
"loanId": 70,
"resourceId": 442,
"changes": {
"transactionDate": "1 March 2012",
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"status": {
"id": 601,
"code": "loanStatusType.closed.written.off",
"value": "Closed (written off)",
"pendingApproval": false,
"waitingForDisbursal": false,
"active": false,
"closedObligationsMet": false,
"closedWrittenOff": true,
"closedRescheduled": false,
"closed": true,
"overpaid": false
},
"closedOnDate": "1 March 2012",
"writtenOffOnDate": "1 March 2012",
"note": "Write-off note"
}
}
Retrieve a Transaction Details
Example Request:
GET https://DomainName/api/v1/loans/{loanId}/transactions/{transactionId}
{
"id": 3,
"type": {
"id": 2,
"code": "loanTransactionType.repayment",
"value": "Repayment",
"disbursement": false,
"repaymentAtDisbursement": false,
"repayment": true,
"contra": false,
"waiveInterest": false,
"waiveCharges": false,
"writeOff": false,
"recoveryRepayment": false
},
"date": [
2012,
5,
14
],
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 559.88,
"interestPortion": 559.88
}
Adjust a Transaction
Note: there is no need to specify command={transactionType} parameter.
Mandatory Fields |
| transactionDate, transactionAmount |
POST https://DomainName/api/v1/loans/{loanId}/transactions/{transactionId}
POST loans/1/transactions/2
Content-Type: application/json
Request Body:
{
"locale": "en_GB",
"dateFormat": "dd MMMM yyyy",
"transactionDate": "25 May 2012",
"transactionAmount": "50,000.00",
"note": "An optional note about why your adjusting or changing the transaction."
}
{
"resourceId": 16
}
Guarantors
A person who guarantees to pay for someone else's debt if he or she should default on a loan obligation. A guarantor acts as a co-signor of sorts.
Field Descriptions |
| guarantorType |
| Identifies if the guarantor is
an existing Client, Staff member or an external
individual Refer Retrieve Guarantor Details Template for complete details |
| entityId |
| The identifier for guarantors who are an existing Client of Staff member. |
| firstname |
| Guarantors first name |
| lastname |
| Guarantors last name |
| officeName |
| Name of the office with which the internal guarantors are associated |
| addressLine1, addressLine2, city, state, zip, country, mobileNumber, housePhoneNumber, comment, dob |
| Address, contact and date of birth details of an external guarantor |
List Guarantors
Example Requests:
GET https://DomainName/api/v1/loans/{loanId}/guarantors
[
{
"id": 1,
"loanId": 1,
"guarantorType": {
"id": 1,
"code": "guarantor.existing.customer",
"value": "CUSTOMER"
},
"firstname": "Declan",
"lastname": "Browne",
"officeName": "Head Office",
"joinedDate": [
2009,
1,
4
]
}
]
Retrieve Guarantors Details Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/loans/{loanId}/guarantors/template
{
"guarantorType": {
"id": 1,
"code": "guarantor.existing.customer",
"value": "CUSTOMER"
},
"guarantorTypeOptions": [
{
"id": 1,
"code": "guarantor.existing.customer",
"value": "CUSTOMER"
},
{
"id": 2,
"code": "guarantor.staff",
"value": "STAFF"
},
{
"id": 3,
"code": "guarantor.external",
"value": "EXTERNAL"
}
]
}
Retrieve a Guarantor
Example Requests:
GET https://DomainName/api/v1/loans/{loanId}/guarantors/{guarantorId}
{
"id": 1,
"loanId": 1,
"guarantorType": {
"id": 1,
"code": "guarantor.existing.customer",
"value": "CUSTOMER"
},
"firstname": "Declan",
"officeName": "Head Office",
"joinedDate": [
2009,
1,
4
]
}
Create a Guarantor
Note: You may associate any number of Guarantors
to a Loan. The mandatory fields would vary based
on the "guarantorType"
Mandatory Fields
for "internal" guarantors |
| guarantorTypeId, entityId |
Mandatory Fields for "external" guarantors |
| guarantorTypeId, firstname, lastname |
POST https://DomainName/api/v1//loans/{loanId}}/guarantors
POST /loans/1/guarantors
Content-Type: application/json
Request Body:
{
guarantorTypeId:3,
firstname:Lyndon,
lastname:Johnson
}
{
"officeId": 2,
"loanId": 1,
"resourceId": 9
}
POST /loans/1/guarantors
Content-Type: application/json
Request Body:
{
guarantorTypeId:1,
entityId:2
}
{
"officeId": 2,
"loanId": 1,
"resourceId": 10
}
Update a Guarantor
PUT https://DomainName/api/v1/loans/{loanId}/guarantors/{guarantorId}
PUT loans/1/guarantors/1
Content-Type: application/json
Request Body:
{
entityId:1
}
{
"officeId": 1,
"resourceId": 1,
"changes": {
"entityId": 1
}
}
Remove a Guarantor
Note: A guarantor can be removed only from loans that are not yet approved.
DELETE https://DomainName/api/v1/loans/{loanId}/guarantors/{guarantorId}
DELETE loans/1/guarantors/1
Content-Type: application/json
No Request Body:
{
"officeId": 2,
"loanId": 1,
"resourceId": 1
}
Loan Collateral
In lending agreements, collateral is a borrower's pledge of specific property to a lender, to secure repayment of a loan. The collateral serves as protection for a lender against a borrower's default - that is, any borrower failing to pay the principal and interest under the terms of a loan obligation. If a borrower does default on a loan (due to insolvency or other event), that borrower forfeits (gives up) the property pledged as collateral - and the lender then becomes the owner of the collateral
Field Descriptions |
| type |
| Identifies the type of a collateral Ex: Gold, property etc (permitted types can be configured using Code Values for the Code LoanCollateral) Refer Retrieve Collateral Details Template for complete details |
| value |
| The market value of a Collateral. |
| description |
| Description for the collateral |
| currency |
| Details of the currency used to estimate the value of a Collateral. The currency defaults to the currency of the Loan for which this Collateral serves as a guarantee |
List Loan Collaterals
Example Requests:
GET https://DomainName/api/v1/loans/{loanId}/collaterals
[
{
"id": 12,
"type": {
"id": 8,
"name": "Gold"
},
"value": 50000,
"description": "24 Carat Gold chain weighing 12 grams",
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
}
}
]
Retrieve Collateral Details Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/loans/{loanId}/collaterals/template
{
"allowedCollateralTypes": [
{
"id": 9,
"name": "Silver",
"position": 0
},
{
"id": 8,
"name": "Gold",
"position": 0
},
{
"id": 10,
"name": "Property",
"position": 0
}
]
}
Retrieve a Collateral
Example Requests:
GET https://DomainName/api/v1/loans/{loanId}/collaterals/{guarantorId}
{
"id": 12,
"type": {
"id": 8,
"name": "Gold"
},
"value": 50000,
"description": "24 Carat Gold chain weighing 12 grams",
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
}
}
Create a Collateral
Note: Currently, Collaterals may be added only before a Loan
is approved
Mandatory Fields
for "internal" collaterals |
| collateralTypeId |
POST https://DomainName/api/v1//loans/{loanId}/collaterals
POST /loans/1/collaterals
Content-Type: application/json
Request Body:
{
collateralTypeId:9,
}
{
"loanId": 1,
"resourceId": 12
}
POST /loans/1/collaterals
Content-Type: application/json
Request Body:
{
"collateralTypeId":"8",
"value": "50000",
"dateFormat":"dd MMMM yyyy",
"locale": "en",
"description": "24 Carat Gold chain weighing 12 grams"
}
{
"loanId": 1,
"resourceId": 13
}
Update a Collateral
PUT https://DomainName/api/v1/loans/{loanId}/collaterals/{collateralId}
PUT loans/1/collaterals/12
Content-Type: application/json
Request Body:
{
"description": "22 Carat Gold chain weighing 12 grams"
}
{
"loanId": 1,
"resourceId": 12,
"changes": {
"description": "22 Carat Gold chain weighing 12 grams"
}
}
Remove a Collateral
Note: A collateral can only be removed from Loans that are not yet approved.
DELETE https://DomainName/api/v1/loans/{loanId}/collaterals/{collateralId}
DELETE loans/1/collaterals/13
Content-Type: application/json
No Request Body:
{
"loanId": 1,
"resourceId": 13
}
Loan Charges
Its typical for MFIs to add extra costs for their loan products. They can be either Fees or Penalties.
Loan Charges are instances of Charges and represent either fees and penalties for loan products. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Loan) are described here
Field Descriptions |
| amountPaid |
| The Total amount which has been paid for this Charge |
| amountWaived |
| The Total amount that has been waived for this Charge |
| amountWrittenOff |
| Total amount written off from this Charge |
| amountOutstanding |
| The Total outstanding amount for this Charge |
List Loan Charges
Example Requests:
GET https://DomainName/api/v1/loans/{loanId}/charges
[
{
"id": 1,
"chargeId": 1,
"name": "Loan Processing fee",
"chargeTimeType": {
"id": 1,
"code": "chargeTimeType.disbursement",
"value": "Disbursement"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
},
"percentage": 0,
"amountPercentageAppliedTo": 0,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 100,
"amountPaid": 0,
"amountWaived": 0,
"amountWrittenOff": 0,
"amountOutstanding": 100,
"amountOrPercentage": 100,
"penalty": false
},
{
"id": 7,
"chargeId": 2,
"name": "Collection Fee",
"chargeTimeType": {
"id": 2,
"code": "chargeTimeType.specifiedDueDate",
"value": "Specified due date"
},
"dueDate": [
2013,
3,
29
],
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
},
"percentage": 0,
"amountPercentageAppliedTo": 0,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 100,
"amountPaid": 0,
"amountWaived": 0,
"amountWrittenOff": 0,
"amountOutstanding": 100,
"amountOrPercentage": 100,
"penalty": false
}
]
Retrieve Loan Charges Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/loans/{loanId}/charges/template
{
"amountPaid": 0,
"amountWaived": 0,
"amountWrittenOff": 0,
"chargeOptions": [
{
"id": 2,
"name": "Collection Fee",
"active": true,
"penalty": false,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 100,
"chargeTimeType": {
"id": 2,
"code": "chargeTimeType.specifiedDueDate",
"value": "Specified due date"
},
"chargeAppliesTo": {
"id": 1,
"code": "chargeAppliesTo.loan",
"value": "Loan"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
}
},
{
"id": 3,
"name": "Late payment penalty",
"active": true,
"penalty": true,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 1,
"chargeTimeType": {
"id": 2,
"code": "chargeTimeType.specifiedDueDate",
"value": "Specified due date"
},
"chargeAppliesTo": {
"id": 1,
"code": "chargeAppliesTo.loan",
"value": "Loan"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
}
},
{
"id": 1,
"name": "Loan Processing fee",
"active": true,
"penalty": false,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 100,
"chargeTimeType": {
"id": 1,
"code": "chargeTimeType.disbursement",
"value": "Disbursement"
},
"chargeAppliesTo": {
"id": 1,
"code": "chargeAppliesTo.loan",
"value": "Loan"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
}
}
],
"penalty": false
}
Retrieve a Loan Charge
Example Requests:
GET https://DomainName/api/v1/loans/{loanId}/charges/{chargeId}
{
"id": 1,
"chargeId": 1,
"name": "Loan Processing fee",
"chargeTimeType": {
"id": 1,
"code": "chargeTimeType.disbursement",
"value": "Disbursement"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
},
"percentage": 0,
"amountPercentageAppliedTo": 0,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 100,
"amountPaid": 0,
"amountWaived": 0,
"amountWrittenOff": 0,
"amountOutstanding": 100,
"amountOrPercentage": 100,
"penalty": false
}
Create a Loan Charge
Mandatory Fields
for Loan Charges |
| chargeId, amount, dueDate |
POST https://DomainName/api/v1/loans/{loanId}/charges
POST /loans/1/charges
Content-Type: application/json
Request Body:
{
"chargeId": "2",
"locale": "en",
"amount": "100",
"dateFormat": "dd MMMM yyyy",
"dueDate": "29 April 2013"
}
{
"officeId": 1,
"clientId": 1,
"loanId": 1,
"resourceId": 31
}
Update a Loan Charge
Currently Loan Charges may be updated only if the Loan is not yet approved
PUT https://DomainName/api/v1/loans/{loanId}/charges/{chargeId}
PUT loans/1/charges/12
Content-Type: application/json
Request Body:
{
"dateFormat": "dd MMMM yyyy",
"locale": "en",
"amount": "60",
"dueDate": "27 March 2013"
}
{
"officeId": 1,
"clientId": 1,
"loanId": 1,
"resourceId": 6,
"changes": {
"dueDate": "27 March 2013",
"dateFormat": "dd MMMM yyyy",
"locale": "en",
"amount": 60.0
}
}
Delete a Loan Charge
Note:Currently, A Loan Charge may only be removed from Loans that are not yet approved.
DELETE https://DomainName/api/v1/loans/{loanId}/charges/{chargeId}
DELETE loans/1/charges/2
Content-Type: application/json
No Request Body:
{
"officeId": 1,
"clientId": 1,
"loanId": 1,
"resourceId": 2
}
Offices
Offices are used to model an MFIs structure. A hierarchial representation of offices is supported. There will always be at least one office (which represents the MFI or an MFIs head office). All subsequent offices added must have a parent office.
Field Descriptions |
| externalId |
| A place to put an external reference for
this office e.g. The ID another system uses for it. If provided, it must be unique. |
| hierarchy |
| This field is a system generated
convenience field. It can't be set. It uses "dot notation" to define where an office stands in the office hierarchy. For example, the system default office (id = 1) has a hierarchy value of '.' An office (id = 12) placed directly underneath this default office has a hierarchy value of '.12.' And if a further office (id = 78) is placed directly under office (id = 12) its hierarchy value is '.12.78.' The hierarchy value is useful when you need to display offices in 'hierarchy' order (perhaps indented in a drop down list box). |
List Offices
Example Requests:
GET https://DomainName/api/v1/offices
[
{
"id": 1,
"name": "Head Office",
"nameDecorated": "Head Office",
"externalId": "1",
"openingDate": [
2009,
1,
1
],
"hierarchy": "."
}
]
Retrieve Office Details Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/offices/template
{
"openingDate": [
2013,
2,
4
],
"allowedParents": [
{
"id": 1,
"name": "Head Office",
"nameDecorated": "Head Office"
}
]
}
Retrieve an Office
Example Requests:
GET https://DomainName/api/v1/offices/1
{
"id": 1,
"name": "Head Office",
"nameDecorated": "Head Office",
"externalId": "1",
"openingDate": [
2009,
1,
1
],
"hierarchy": "."
}
Create an Office
Mandatory Fields |
| name, openingDate, parentId |
POST https://DomainName/api/v1/offices
POST offices
Content-Type: application/json
Request Body:
{
"name": "Example New Branch",
"dateFormat": "dd MMMM yyyy",
"locale": "en",
"openingDate": "01 July 2007",
"parentId": 2,
"externalId": "SYS54-88"
}
{
"officeId": 3,
"resourceId": 3
}
Update Office
PUT https://DomainName/api/v1/offices/{officeId}
PUT offices/1
Content-Type: application/json
Request Body:
{
"name": "Name is updated"
}
{
"officeId": 1,
"resourceId": 1,
"changes": {
"name": "Name is updated"
}
}
Loan Products
A Loan product is a template that is used when creating a loan. Much of the template definition can be overridden during loan creation.
Field Descriptions |
| name |
| Name associated with loan product on system. |
| description |
| For providing helpful description of product offering. |
| fundId |
| For associating a loan product with a given fund by default. |
| currencyCode |
| A three letter ISO code of currency. |
| digitsAfterDecimal |
| Override the currency default value for digitsAfterDecimal. |
| principal |
| The loan amount to be disbursed to through loan. |
| numberOfRepayments |
| Number of installments to repay. Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks |
| repaymentEvery |
| Used like: numberOfRepayments Every
repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks |
| repaymentFrequencyType |
| Used like: numberOfRepayments Every
repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks Example Values: 0=Days, 1=Weeks, 2=Months |
| interestRatePerPeriod |
| Interest Rate. Used like: interestRatePerPeriod % interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance |
| interestRateFrequencyType |
| Used like: interestRatePerPeriod%
interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance Example Values: 2=Per month, 3=Per year |
| amortizationType |
| Example Values: 0=Equal principle payments, 1=Equal installments |
| interestType |
| Used like: interestRatePerPeriod%
interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance Example Values: 0=Declining Balance, 1=Flat |
| interestCalculationPeriodType |
| Example Values: 0=Daily, 1=Same as repayment period |
| inArrearsTolerance |
| The amount that can be 'waived' at end
of all loan payments because it is too small to worry about. This is also the tolerance amount assessed when determining if a loan is in arrears. |
| transactionProcessingStrategyId |
| The type of transaction processing strategy to be used. At present some MFI specific ones exist. This is an important point of change for many MFIs. Responsible for things like payment order and how early or late repayments should be processed. Out of the box, four available:
|
| accountingRule |
| Example Values:1=NONE, 2=CASH_BASED, 3=ACCRUAL_BASED |
List Loan Products
Example Requests:
GET https://DomainName/api/v1/loanproducts
[
{
"id": 1,
"name": "LP with Charges but no accounting)",
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"principal": 100000,
"numberOfRepayments": 12,
"repaymentEvery": 1,
"repaymentFrequencyType": {
"id": 2,
"code": "repaymentFrequency.periodFrequencyType.months",
"value": "Months"
},
"interestRatePerPeriod": 1.75,
"interestRateFrequencyType": {
"id": 2,
"code": "interestRateFrequency.periodFrequencyType.months",
"value": "Per month"
},
"annualInterestRate": 21,
"amortizationType": {
"id": 1,
"code": "amortizationType.equal.installments",
"value": "Equal installments"
},
"interestType": {
"id": 0,
"code": "interestType.declining.balance",
"value": "Declining Balance"
},
"interestCalculationPeriodType": {
"id": 1,
"code": "interestCalculationPeriodType.same.as.repayment.period",
"value": "Same as repayment period"
},
"transactionProcessingStrategyId": 1,
"transactionProcessingStrategyName": "Mifos style",
"accountingRule": {
"id": 1,
"code": "accountingRuleType.none",
"value": "NONE"
}
}
]
Retrieve Loan Product Details Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/loanproducts/template
{
"currency": {
"code": "UGX",
"name": "Uganda Shilling",
"decimalPlaces": 2,
"displaySymbol": "USh",
"nameCode": "currency.UGX",
"displayLabel": "Uganda Shilling (USh)"
},
"repaymentFrequencyType": {
"id": 2,
"code": "repaymentFrequency.periodFrequencyType.months",
"value": "Months"
},
"interestRateFrequencyType": {
"id": 2,
"code": "interestRateFrequency.periodFrequencyType.months",
"value": "Per month"
},
"amortizationType": {
"id": 1,
"code": "amortizationType.equal.installments",
"value": "Equal installments"
},
"interestType": {
"id": 0,
"code": "interestType.declining.balance",
"value": "Declining Balance"
},
"interestCalculationPeriodType": {
"id": 1,
"code": "interestCalculationPeriodType.same.as.repayment.period",
"value": "Same as repayment period"
},
"transactionProcessingStrategyId": 2,
"transactionProcessingStrategyName": "Heavensfamily",
"accountingRule": {
"id": 1,
"code": "accountingRuleType.none",
"value": "NONE"
},
"accountingMappings": {},
"currencyOptions": [
{
"code": "UGX",
"name": "Uganda Shilling",
"decimalPlaces": 2,
"displaySymbol": "USh",
"nameCode": "currency.UGX",
"displayLabel": "Uganda Shilling (USh)"
}
],
"repaymentFrequencyTypeOptions": [
{
"id": 0,
"code": "repaymentFrequency.periodFrequencyType.days",
"value": "Days"
},
{
"id": 1,
"code": "repaymentFrequency.periodFrequencyType.weeks",
"value": "Weeks"
},
{
"id": 2,
"code": "repaymentFrequency.periodFrequencyType.months",
"value": "Months"
}
],
"interestRateFrequencyTypeOptions": [
{
"id": 2,
"code": "interestRateFrequency.periodFrequencyType.months",
"value": "Per month"
},
{
"id": 3,
"code": "interestRateFrequency.periodFrequencyType.years",
"value": "Per year"
}
],
"amortizationTypeOptions": [
{
"id": 1,
"code": "amortizationType.equal.installments",
"value": "Equal installments"
},
{
"id": 0,
"code": "amortizationType.equal.principal",
"value": "Equal principle payments"
}
],
"interestTypeOptions": [
{
"id": 1,
"code": "interestType.flat",
"value": "Flat"
},
{
"id": 0,
"code": "interestType.declining.balance",
"value": "Declining Balance"
}
],
"interestCalculationPeriodTypeOptions": [
{
"id": 0,
"code": "interestCalculationPeriodType.daily",
"value": "Daily"
},
{
"id": 1,
"code": "interestCalculationPeriodType.same.as.repayment.period",
"value": "Same as repayment period"
}
],
"transactionProcessingStrategyOptions": [
{
"id": 2,
"code": "heavensfamily-strategy",
"name": "Heavensfamily"
}
],
"chargeOptions": [
{
"id": 1,
"name": "Bank Fee (per installment)",
"active": true,
"penalty": false,
"currency": {
"code": "UGX",
"name": "Uganda Shilling",
"decimalPlaces": 2,
"displaySymbol": "USh",
"nameCode": "currency.UGX",
"displayLabel": "Uganda Shilling (USh)"
},
"amount": 1500,
"chargeTimeType": {
"id": 2,
"code": "chargeTimeType.specifiedDueDate",
"value": "Specified due date"
},
"chargeAppliesTo": {
"id": 1,
"code": "chargeAppliesTo.loan",
"value": "Loan"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
}
}
],
"accountingRuleOptions": [
{
"id": 1,
"code": "accountingRuleType.none",
"value": "NONE"
},
{
"id": 2,
"code": "accountingRuleType.cash",
"value": "CASH BASED"
},
{
"id": 3,
"code": "accountingRuleType.accrual",
"value": "ACCRUAL BASED"
}
],
"accountingMappingOptions": {
"assetAccountOptions": [
{
"id": 2,
"name": "Cash in Valut 1",
"glCode": "11101",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 1,
"code": "accountType.asset",
"value": "ASSET"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
}
},
{
"id": 4,
"name": "Centenary Opening Account",
"glCode": "11201",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 1,
"code": "accountType.asset",
"value": "ASSET"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
}
}
],
"expenseAccountOptions": [
{
"id": 41,
"name": "Water Charges",
"glCode": "42102",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 5,
"code": "accountType.expense",
"value": "EXPENSE"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
}
},
{
"id": 42,
"name": "Electricity Charges",
"glCode": "42103",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 5,
"code": "accountType.expense",
"value": "EXPENSE"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
}
},
{
"id": 97,
"name": "Miscellaneous",
"glCode": "42905",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 5,
"code": "accountType.expense",
"value": "EXPENSE"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
}
}
],
"incomeAccountOptions": [
{
"id": 34,
"name": "Interest on Loans",
"glCode": "31101",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 4,
"code": "accountType.income",
"value": "INCOME"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
}
},
{
"id": 35,
"name": "Late Payment Interest",
"glCode": "31102",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 4,
"code": "accountType.income",
"value": "INCOME"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
}
},
{
"id": 37,
"name": "Collected Bank Fees Receivable",
"glCode": "6201",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 4,
"code": "accountType.income",
"value": "INCOME"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
}
}
]
}
}
Retrieve a Loan Product
Example Requests:
GET https://DomainName/api/v1/loanproducts/{productId}
{
"id": 1,
"name": "LP with Charges but no accounting)",
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"principal": 100000,
"numberOfRepayments": 12,
"repaymentEvery": 1,
"repaymentFrequencyType": {
"id": 2,
"code": "repaymentFrequency.periodFrequencyType.months",
"value": "Months"
},
"interestRatePerPeriod": 1.75,
"interestRateFrequencyType": {
"id": 2,
"code": "interestRateFrequency.periodFrequencyType.months",
"value": "Per month"
},
"annualInterestRate": 21,
"amortizationType": {
"id": 1,
"code": "amortizationType.equal.installments",
"value": "Equal installments"
},
"interestType": {
"id": 0,
"code": "interestType.declining.balance",
"value": "Declining Balance"
},
"interestCalculationPeriodType": {
"id": 1,
"code": "interestCalculationPeriodType.same.as.repayment.period",
"value": "Same as repayment period"
},
"transactionProcessingStrategyId": 1,
"transactionProcessingStrategyName": "Mifos style",
"charges": [
{
"id": 1,
"name": "Loan service fee",
"active": true,
"penalty": false,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 230.56,
"chargeTimeType": {
"id": 1,
"code": "chargeTimeType.disbursement",
"value": "Disbursement"
},
"chargeAppliesTo": {
"id": 1,
"code": "chargeAppliesTo.loan",
"value": "Loan"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
}
}
],
"accountingRule": {
"id": 1,
"code": "accountingRuleType.none",
"value": "NONE"
}
}
Create a Loan Product
Depending of the Accounting Rule (accountingRule) selected, additional fields with details of the appropriate Ledger Account identifiers would need to be passed in.
Refer MifosX Accounting Specs Draft for more details regarding the significance of the selected accounting ruleMandatory Fields |
| name, currencyCode, digitsAfterDecimal, principal, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, transactionProcessingStrategyId, accountingRule |
Optional Fields |
| inArrearsTolerance, charges |
Additional Mandatory Fields for Cash(2) based accounting |
| fundSourceAccountId, loanPortfolioAccountId, interestOnLoanAccountId, incomeFromFeeAccountId, incomeFromPenaltyAccountId, writeOffAccountId |
Additional Mandatory Fields for Accrual(3) based accounting |
| fundSourceAccountId, loanPortfolioAccountId, interestOnLoanAccountId, incomeFromFeeAccountId, incomeFromPenaltyAccountId, writeOffAccountId, receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId |
POST https://DomainName/api/v1/loanproducts
POST loanproducts
Content-Type: application/json
Request Body:
{
"name": "LP with Charges but no accounting)",
"currencyCode": "USD",
"locale": "en_GB",
"digitsAfterDecimal": "2",
"principal": "100,000.00",
"numberOfRepayments": "12",
"repaymentEvery": "1",
"repaymentFrequencyType": 2,
"interestRatePerPeriod": "1.75",
"interestRateFrequencyType": 2,
"amortizationType": 1,
"interestType": 0,
"interestCalculationPeriodType": 1,
"inArrearsTolerance": "0",
"transactionProcessingStrategyId": 1,
"charges":[{"id":"1"}],
"accountingRule": 1
}
{
"resourceId": 1
}
POST loanproducts
Content-Type: application/json
Request Body:
{
"name": "LP Cash Accounting",
"currencyCode": "USD",
"locale": "en_GB",
"digitsAfterDecimal": "2",
"principal": "100,000.00",
"numberOfRepayments": "12",
"repaymentEvery": "1",
"repaymentFrequencyType": 2,
"transactionProcessingStrategyId": 1,
"interestRatePerPeriod": "1.75",
"interestRateFrequencyType": 2,
"amortizationType": 1,
"interestType": 0,
"interestCalculationPeriodType": 1,
"accountingRule":"2",
"fundSourceAccountId":"4",
"loanPortfolioAccountId":"8",
"interestOnLoanAccountId":"34",
"incomeFromFeeAccountId":"37",
"incomeFromPenaltyAccountId":"35",
"writeOffAccountId":"41"
}
{
"resourceId": 2
}
POST loanproducts
Content-Type: application/json
Request Body:
{
"name": "LP Accrual Accounting",
"currencyCode": "USD",
"locale": "en_GB",
"digitsAfterDecimal": "2",
"principal": "100,000.00",
"numberOfRepayments": "12",
"repaymentEvery": "1",
"repaymentFrequencyType": 2,
"transactionProcessingStrategyId": 1,
"interestRatePerPeriod": "1.75",
"interestRateFrequencyType": 2,
"amortizationType": 1,
"interestType": 0,
"interestCalculationPeriodType": 1,
"accountingRule":"3",
"fundSourceAccountId":"4",
"loanPortfolioAccountId":"8",
"receivableInterestAccountId":"9",
"receivableFeeAccountId":"11",
"receivablePenaltyAccountId":"10",
"interestOnLoanAccountId":"34",
"incomeFromFeeAccountId":"37",
"incomeFromPenaltyAccountId":"35",
"writeOffAccountId":"41"
}
{
"resourceId": 3
}
Update a Loan Product
PUT https://DomainName/api/v1/loanproducts/{loanId}
PUT loanproducts/1
Content-Type: application/json
Request Body:
{
"locale": "en_GB",
"principal": "70,000.00"
}
{
"resourceId": 1,
"changes": {
"principal": 70000,
"locale": "en_GB"
}
}
Currency
Application related configuration around viewing/updating the currencies permitted for use within the MFI.
Retrieve Currency Configuration
Returns the list of currencies permitted for use AND the list of currencies not selected (but available for selection).
Example Requests:
GET https://DomainName/api/v1/currencies
{
"selectedCurrencyOptions": [
{
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
}
],
"currencyOptions": [
{
"code": "AFN",
"name": "Afghanistan Afghani",
"decimalPlaces": 2,
"nameCode": "currency.AFN",
"displayLabel": "Afghanistan Afghani [AFN]"
},
{
"code": "ALL",
"name": "Albanian Lek",
"decimalPlaces": 2,
"nameCode": "currency.ALL",
"displayLabel": "Albanian Lek [ALL]"
},
{
"code": "ZWD",
"name": "Zimbabwe Dollar",
"decimalPlaces": 2,
"nameCode": "currency.ZWD",
"displayLabel": "Zimbabwe Dollar [ZWD]"
}
]
}
Update Currency Configuration
Updates the list of currencies permitted for use.
PUT https://DomainName/api/v1/currencies
PUT currencies
Content-Type: application/json
Request Body:
{
"currencies": [
"KES",
"BND",
"LBP",
"GHC",
"USD",
"XOF",
"AED",
"AMD"
]
}
{
"currencies": [
"KES",
"BND",
"LBP",
"GHC",
"USD",
"XOF",
"AED",
"AMD"
]
}
Global Configuration
Global configuration related to set of supported enable/disable configurations e.g. maker-checker.
Retrieve Global Configuration
Returns the list global enable/disable configurations.
Example Requests:
GET https://DomainName/api/v1/configurations
{
"globalConfiguration": [
{
"name": "maker-checker",
"enabled": false
}
]
}
Update Global Configuration
Updates an enable/disable global configuration item.
PUT https://DomainName/api/v1/configurations?maker-checker=false
PUT configurations
Content-Type: application/json
Request Body: { }
{ "changes": {} }
Codes
Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.
Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc
Create a Code
Creates a code. Codes created through api are always 'user defined' and so system defined is marked as false.
POST https://DomainName/api/v1/codes
POST codes
Content-Type: application/json
Request Body:
{
"name": "MyNewCode"
}
{
"resourceId": 4
}
Retrieve Codes
Returns the list of codes.
Example Requests:
GET https://DomainName/api/v1/codes
[
{
"id": 1,
"name": "Customer Identifier",
"systemDefined": true
},
{
"id": 2,
"name": "Gender",
"systemDefined": true
},
{
"id": 3,
"name": "Education",
"systemDefined": true
}
]
Retrieve a Code
Returns the details of a Code.
Example Requests:
GET https://DomainName/api/v1/codes/{codeId}
{
"id": 1,
"name": "Customer Identifier",
"systemDefined": true
}
Update a Code
Updates the details of a code if it is not system defined.
PUT https://DomainName/api/v1/codes/{codeId}
PUT codes/4
Content-Type: application/json
Request Body:
{
"name": "MyNewCode(changed)"
}
{
"resourceId": 4,
"changes": {
"name": "MyNewCode(changed)"
}
}
Delete a Code
Deletes a code if it is not system defined.
DELETE https://DomainName/api/v1/codes/{codeId}
DELETE codes/4
Content-Type: application/json
{
"resourceId": 4
}
Code Values
Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.
Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc
Create a Code Value
POST https://DomainName/api/v1/codes/1/codevalues
POST codes/1/codevalues
Content-Type: application/json
Request Body:
{
"name":"Ration Card",
"position":"1"
}
{
"resourceId": 4
}
List Code Values
Returns the list of Code Values for a given Code
Example Requests:
GET https://DomainName/api/v1/codes/{codeId}/codevalues
[
{
"id": 1,
"name": "Passport",
"position": 0
},
{
"id": 2,
"name": "Id",
"position": 0
},
{
"id": 3,
"name": "Drivers License",
"position": 0
},
{
"id": 4,
"name": "Any Other Id Type",
"position": 0
},
{
"id": 5,
"name": "Ration Card",
"position": 1
}
]
Retrieve a Code Value
Returns the details of a Code Value
Example Requests:
GET https://DomainName/api/v1/codes/{codeId}/codevalues/{codevalueId}
{
"id": 1,
"name": "Passport",
"position": 0
}
Update a Code Value
Updates the details of a code value.
PUT https://DomainName/api/v1/codes/{codeId}/codevalues/{codevalueId}
PUT codes/1/codevalues/1
Content-Type: application/json
Request Body:
{
"name": "Indian Passport",
"position":2
}
{
"resourceId": 1,
"changes": {
"name": "Indian Passport",
"position": 2
}
}
Delete a Code Value
Deletes a code value
DELETE https://DomainName/api/v1/codes/{codeId}/codevalues/{codevalueId}
DELETE codes/1/codevalues/5
Content-Type: application/json
{
"resourceId": 5
}
Funds
Simple implementation of funds. At present funds can optionally be associated with a Loan.
This information can then be used to produce reports on loans/loan amounts drawn from a fund.
Create a Fund
Creates a fund.
POST https://DomainName/api/v1/funds
POST funds
Content-Type: application/json
Request Body:
{
"name": "EU Agri Fund"
}
{
"resourceId": 1
}
Retrieve Funds
Returns the list of funds.
Example Requests:
GET https://DomainName/api/v1/funds
[
{
"id": 1,
"name": "EU Agri Fund"
}
]
Retrieve a Fund
Returns the details of a Fund.
Example Requests:
GET https://DomainName/api/v1/funds/{fundId}
{
"id": 1,
"name": "EU Agri Fund"
}
Update a Fund
Updates the details of a fund.
PUT https://DomainName/api/v1/funds/{fundId}
PUT funds/1
Content-Type: application/json
Request Body:
{
"name": "EU Agri Fund (2010-2020)"
}
{
"resourceId": 1,
"changes": {
"name": "EU Agri Fund (2010-2020)"
}
}
Staff
Allows you to model staff members. At present the key role of significance is whether this staff member is a loan officer or not.
Create a staff member
Creates a staff member.
POST https://DomainName/api/v1/staff
POST staff
Content-Type: application/json
Request Body:
{
"officeId": 1,
"firstname": "John",
"lastname": "Doe",
"isLoanOfficer": "true"
}
{
"officeId": 1,
"resourceId": 1
}
Retrieve Staff
Returns the list of staff members.
Example Requests:
GET https://DomainName/api/v1/staff
[
{
"id": 1,
"firstname": "John",
"lastname": "Doe",
"displayName": "Doe, John",
"officeId": 1,
"officeName": "Head Office",
"isLoanOfficer": true
}
]
Retrieve a Staff Member
Returns the details of a Staff Member.
Example Requests:
GET https://DomainName/api/v1/staff/{staffId}
{
"id": 1,
"firstname": "John",
"lastname": "Doe",
"displayName": "Doe, John",
"officeId": 1,
"officeName": "Head Office",
"isLoanOfficer": true
}
Update a Staff Member
Updates the details of a staff member.
PUT https://DomainName/api/v1/staff/{staffId}
PUT staff/1
Content-Type: application/json
Request Body:
{
"isLoanOfficer": "false"
}
{
"officeId": 1,
"resourceId": 1,
"changes": {
"isLoanOfficer": false
}
}
Charges
Its typical for MFIs to add extra costs for their financial products. There are typically Fees or Penalties.
Charges is what we use to model both fees and penalties. For now charges can only be associated with loan products / loans.
Field Descriptions |
| name |
| Name associated with this charge. |
| active |
| Boolean flag determines if the Charge is currently active. |
| penalty |
| Boolean flag determines if the Charge is a penalty. |
| currency |
| Details of the currency associated with this charge. Refer Charges Template for additional details |
| amount |
| Field holds the details of the actual amount to be collected in the case of "Flat Charges" or the percentage amount to be collected in case of "Percentage Amount Charges". Refer Charges Template for details of the Available Charge Types |
| chargeTimeType |
| The time at which the charge becomes Due. Refer Charges Template for additional details |
| chargeAppliesTo |
| The Entity for which the charge can be applied (Loans etc). Refer Charges Template for additional details |
| chargeCalculationType |
| Rules for calculating the amount for a particular Charge. Refer Charges Template for additional details |
Retrieve Charges Details Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/charges/template
{
"active": false,
"penalty": false,
"currencyOptions":
[
{
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
}
],
"chargeCalculationTypeOptions":
[
{
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
},
{
"id": 2,
"code": "chargeCalculationType.percent.of.amount",
"value": "% Amount"
}
],
"chargeAppliesToOptions":
[
{
"id": 1,
"code": "chargeAppliesTo.loan",
"value": "Loan"
}
],
"chargeTimeTypeOptions":
[
{
"id": 1,
"code": "chargeTimeType.disbursement",
"value": "Disbursement"
},
{
"id": 2,
"code": "chargeTimeType.specifiedDueDate",
"value": "Specified due date"
}
]
}
Create/Define a Charge
Define a new charge that can later be associated with loan products or loans.
POST https://DomainName/api/v1/charges
POST charges
Content-Type: application/json
Request Body:
{
"name": "Loan service fee",
"chargeAppliesTo": 1,
"currencyCode": "USD",
"locale": "en",
"amount": "230.56",
"chargeTimeType": "1",
"chargeCalculationType": "1",
"active": true
}
{
"resourceId": 1
}
POST charges
Content-Type: application/json
Request Body:
{
"locale": "en",
"name": "Default Penalty",
"amount": "2",
"currencyCode": "USD",
"chargeAppliesTo": "1",
"chargeTimeType": "2",
"chargeCalculationType": "2",
"active": "true",
"penalty": "true"
}
{
"resourceId": 4
}
Retrieve Charges
Returns the list of defined charges.
Example Requests:
GET https://DomainName/api/v1/charges
[
{
"id": 1,
"name": "Loan service fee",
"active": true,
"penalty": false,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 230.56,
"chargeTimeType": {
"id": 1,
"code": "chargeTimeType.disbursement",
"value": "Disbursement"
},
"chargeAppliesTo": {
"id": 1,
"code": "chargeAppliesTo.loan",
"value": "Loan"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
}
}
]
Retrieve a Charge
Returns the details of a defined Charge.
Example Requests:
GET https://DomainName/api/v1/charges/{chargeId}
{
"id": 1,
"name": "Loan service fee",
"active": true,
"penalty": false,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"amount": 230.56,
"chargeTimeType": {
"id": 1,
"code": "chargeTimeType.disbursement",
"value": "Disbursement"
},
"chargeAppliesTo": {
"id": 1,
"code": "chargeAppliesTo.loan",
"value": "Loan"
},
"chargeCalculationType": {
"id": 1,
"code": "chargeCalculationType.flat",
"value": "Flat"
}
}
Update a Charge
Updates the details of a Charge.
PUT https://DomainName/api/v1/charges/{chargeId}
PUT charges/1
Content-Type: application/json
Request Body:
{
"name": "Loan service fee(changed)"
}
{
"resourceId": 1,
"changes": {
"name": "Loan service fee(changed)"
}
}
Delete a Charge
Deletes a Charge.
DELETE https://DomainName/api/v1/charges/{chargeId}
DELETE charges/1
Content-Type: application/json
{ "resourceId": 1 }
Savings Product:
An MFIs savings product offerings are modeled using this API.
When creating savings accounts, the details from the savings product are used to auto fill details of savings account.
Field Descriptions |
| name |
| The name of the product offering. |
| description |
| A description of the product offering. |
| currencyCode |
| Three letter ISO code representing currency. |
| digitsAfterDecimal |
| Override the currency default value for digitsAfterDecimal. |
| nominalAnnualInterestRate |
| The default interest rate set when creating savings accounts of this type of product. e.g. 5% Per year - It number here is always expressed as the Nominal APR. |
| interestCompoundingPeriodType |
| The period at which interest rate is compounded. 1=Daily, 2=Weekly (at end of week, sunday), 3=Every two weeks (at end of two weeks, sunday), 4=Monthly (at end of month), 5=Quarterly (at end of quarter, 31st Mar, 30th Jun, 30th Sep, 31st Dec), 6=Bi-Annually (30th June, 31st Dec), 7=Annually (31st Dec), 8=No Compounding - Simple Interest |
| interestCalculationType |
| The interest calculation method used: 1=Daily Balance or 2=Average Daily Balance |
| interestCalculationDaysInYearType |
| The setting for number of days in year to use: 360=360 Days, 365=365 Days |
| minRequiredOpeningBalance |
| Optional: If provided, sets the minimum deposit amount required to open a savings account e.g. 2,000 |
| lockinPeriodFrequency |
| Optional: If provided, used along with lockinPeriodFrequencyType to indicate the length of time that the savings account is 'locked in' and withdrawals are not allowed. e.g. 6 Months |
| lockinPeriodFrequencyType |
| Optional: If provided, used along with lockinPeriodFrequency to indicate the length of time that the savings account is 'locked in' and withdrawals are not allowed. 0=Days, 1=Weeks, 2=Months, 3=Years e.g. 6 Months |
Retrieve Savings Product Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://Domain Name/api/v1/savingsproducts/template
{
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"interestCompoundingPeriodType": {
"id": 1,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.daily",
"value": "Daily"
},
"interestCalculationType": {
"id": 1,
"code": "savingsInterestCalculationType.dailybalance",
"value": "Daily Balance"
},
"interestCalculationDaysInYearType": {
"id": 365,
"code": "savingsInterestCalculationDaysInYearType.days365",
"value": "365 Days"
},
"currencyOptions": [
{
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
}
],
"interestCompoundingPeriodTypeOptions": [
{
"id": 1,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.daily",
"value": "Daily"
},
{
"id": 2,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.weekly",
"value": "Weekly"
},
{
"id": 3,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.biweekly",
"value": "Bi-Weekly"
},
{
"id": 4,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.monthly",
"value": "Monthly"
},
{
"id": 5,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.quarterly",
"value": "Quarterly"
},
{
"id": 6,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.biannual",
"value": "Semi-Annual"
},
{
"id": 7,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.annual",
"value": "Annually"
},
{
"id": 8,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.nocompounding",
"value": "No Compounding - Simple Interest"
}
],
"interestCalculationTypeOptions": [
{
"id": 1,
"code": "savingsInterestCalculationType.dailybalance",
"value": "Daily Balance"
},
{
"id": 2,
"code": "savingsInterestCalculationType.averagedailybalance",
"value": "Average Daily Balance"
}
],
"interestCalculationDaysInYearTypeOptions": [
{
"id": 360,
"code": "savingsInterestCalculationDaysInYearType.days360",
"value": "360 Days"
},
{
"id": 365,
"code": "savingsInterestCalculationDaysInYearType.days365",
"value": "365 Days"
}
],
"lockinPeriodFrequencyTypeOptions": [
{
"id": 0,
"code": "savings.lockin.savingsPeriodFrequencyType.days",
"value": "Days"
},
{
"id": 1,
"code": "savings.lockin.savingsPeriodFrequencyType.weeks",
"value": "Weeks"
},
{
"id": 2,
"code": "savings.lockin.savingsPeriodFrequencyType.months",
"value": "Months"
},
{
"id": 3,
"code": "savings.lockin.savingsPeriodFrequencyType.years",
"value": "Years"
}
]
}
Create a Savings Product
Mandatory Fields |
| name, description, currencyCode, digitsAfterDecimal, nominalAnnualInterestRate, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType |
Optional Fields |
| minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType |
POST https://Domain Name/api/v1/savingsproducts
POST savingsproducts
Content-Type: application/json
Request Body:
{
"name": "Passbook Savings",
"description": "Daily compounding using Daily Balance, 5% per year, 365 days in year",
"currencyCode": "USD",
"digitsAfterDecimal": 2,
"locale": "en",
"nominalAnnualInterestRate": "5.0",
"interestCompoundingPeriodType": 1,
"interestCalculationType": 1,
"interestCalculationDaysInYearType": "365"
}
{
"resourceId": 1
}
Retrieve a Savings Product
Example Requests:
GET https://Domain Name/api/v1/savingsproducts/1
{
"id": 1,
"name": "Passbook Savings",
"description": "Daily compounding using Daily Balance, 5% per year, 365 days in year",
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"nominalAnnualInterestRate": 5,
"interestCompoundingPeriodType": {
"id": 1,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.daily",
"value": "Daily"
},
"interestCalculationType": {
"id": 1,
"code": "savingsInterestCalculationType.dailybalance",
"value": "Daily Balance"
},
"interestCalculationDaysInYearType": {
"id": 365,
"code": "savingsInterestCalculationDaysInYearType.days365",
"value": "365 Days"
}
}
Update a Savings Product
PUT https://Domain Name/api/v1/savingsproducts/{productId}
POST savingsproducts/1
Content-Type: application/json
Request Body:
{
"description": "Passbook Savings Lite.",
"locale": "en",
"interestRate": "5.73"
}
{
"resourceId": 1,
"changes": {
"description": "Passbook Savings Lite.",
"interestRate": 5.73,
"locale": "en"
}
}
Delete a Savings Product
DELETE https://Domain Name/api/v1/savingsproducts/{productId}
DELETE savingsproducts/1
Content-Type: application/json
{
"resourceId": 1
}
List Savings Products
Example Requests:
GET https://Domain Name/api/v1/savingsproducts
[
{
"id": 1,
"name": "Passbook Savings",
"description": "Daily compounding using Daily Balance, 5% per year, 365 days in year",
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"nominalAnnualInterestRate": 5,
"interestCompoundingPeriodType": {
"id": 1,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.daily",
"value": "Daily"
},
"interestCalculationType": {
"id": 1,
"code": "savingsInterestCalculationType.dailybalance",
"value": "Daily Balance"
},
"interestCalculationDaysInYearType": {
"id": 365,
"code": "savingsInterestCalculationDaysInYearType.days365",
"value": "365 Days"
}
}
]
Savings Account:
An instance of a savings account for a individual or group.
Field Descriptions |
| clientId |
| The client you are creating the savings account for. Either clientId or groupId must be provided. |
| groupId |
| The group you are creating the savings account for. Either clientId or groupId must be provided. |
| productId |
| The id of the product used for this savings account. The savings account inherits the selected currency of the product and possibly other details if not overridden in the savings account creation request. |
| accountNo |
| The account no. associated with this loan. Is auto generated if not provided at creation time. |
| externalId |
| A place to put an external reference for this savings account e.g. The ID another system uses. If provided, it must be unique. |
| active |
| Indicates whether this savings account should go into active state or not automatically |
| activationDate |
| If active is true the activationDate must be provided. If the savings account has an entry for minRequiredOpeningBalance then a deposit for that amount with activationDate as the date is automatically entered. |
| nominalAnnualInterestRate |
| The interest rate set for savings account e.g. 5% Per year - It is always expressed as the Nominal APR. |
| interestCompoundingPeriodType |
| The period at which interest rate is compounded. 1=Daily, 2=Weekly (at end of week, sunday), 3=Every two weeks (at end of two weeks, sunday), 4=Monthly (at end of month), 5=Quarterly (at end of quarter, 31st Mar, 30th Jun, 30th Sep, 31st Dec), 6=Bi-Annually (30th June, 31st Dec), 7=Annually (31st Dec), 8=No Compounding - Simple Interest |
| interestCalculationType |
| The interest calculation method used: 1=Daily Balance or 2=Average Daily Balance |
| interestCalculationDaysInYearType |
| The setting for number of days in year to use: 360=360 Days, 365=365 Days |
| minRequiredOpeningBalance |
| Optional: If provided, sets the minimum deposit amount required to open a savings account e.g. 2,000 |
| lockinPeriodFrequency |
| Optional: If provided, used along with lockinPeriodFrequencyType to indicate the length of time that the savings account is 'locked in' and withdrawals are not allowed. e.g. 6 Months |
| lockinPeriodFrequencyType |
| Optional: If provided, used along with lockinPeriodFrequency to indicate the length of time that the savings account is 'locked in' and withdrawals are not allowed. 0=Days, 1=Weeks, 2=Months, 3=Years e.g. 6 Months |
Retrieve Savings Account Template:
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Arguments
- clientId
- Integer mandatory
- productId
- Integer optional
- If entered, productId, productName and selectedProduct fields are returned.
Example Requests:
GET https://Domain Name/api/v1/savingsaccounts/template?clientId={clientId}
{
"clientId": 1,
"clientName": "Client A AB",
"productOptions": [
{
"id": 1,
"name": "First"
}
]
}
GET https://Domain Name/api/v1/savingsaccounts/template?clientId={clientId}&productId={productId}
{
"clientId": 1,
"clientName": "John Doe",
"savingsProductId": 3,
"savingsProductName": "Passbook Savings",
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"nominalAnnualInterestRate": 5,
"interestCompoundingPeriodType": {
"id": 1,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.daily",
"value": "Daily"
},
"interestCalculationType": {
"id": 1,
"code": "savingsInterestCalculationType.dailybalance",
"value": "Daily Balance"
},
"interestCalculationDaysInYearType": {
"id": 365,
"code": "savingsInterestCalculationDaysInYearType.days365",
"value": "365 Days"
},
"productOptions": [
{
"id": 1,
"name": "01-Compounding Daily"
},
{
"id": 2,
"name": "02-Compounding Monthly"
},
{
"id": 3,
"name": "Passbook Savings"
}
],
"interestCompoundingPeriodTypeOptions": [
{
"id": 1,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.daily",
"value": "Daily"
},
{
"id": 2,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.weekly",
"value": "Weekly"
},
{
"id": 3,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.biweekly",
"value": "Bi-Weekly"
},
{
"id": 4,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.monthly",
"value": "Monthly"
},
{
"id": 5,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.quarterly",
"value": "Quarterly"
},
{
"id": 6,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.biannual",
"value": "Semi-Annual"
},
{
"id": 7,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.annual",
"value": "Annually"
},
{
"id": 8,
"code": "savings.interest.period.savingsCompoundingInterestPeriodType.nocompounding",
"value": "No Compounding - Simple Interest"
}
],
"interestCalculationTypeOptions": [
{
"id": 1,
"code": "savingsInterestCalculationType.dailybalance",
"value": "Daily Balance"
},
{
"id": 2,
"code": "savingsInterestCalculationType.averagedailybalance",
"value": "Average Daily Balance"
}
],
"interestCalculationDaysInYearTypeOptions": [
{
"id": 360,
"code": "savingsInterestCalculationDaysInYearType.days360",
"value": "360 Days"
},
{
"id": 365,
"code": "savingsInterestCalculationDaysInYearType.days365",
"value": "365 Days"
}
],
"lockinPeriodFrequencyTypeOptions": [
{
"id": 0,
"code": "savings.lockin.savingsPeriodFrequencyType.days",
"value": "Days"
},
{
"id": 1,
"code": "savings.lockin.savingsPeriodFrequencyType.weeks",
"value": "Weeks"
},
{
"id": 2,
"code": "savings.lockin.savingsPeriodFrequencyType.months",
"value": "Months"
},
{
"id": 3,
"code": "savings.lockin.savingsPeriodFrequencyType.years",
"value": "Years"
}
]
}
Create a New Savings Account
Mandatory Fields |
| clientId or groupId, productId, accountNo, externalId, active, (activationDate if active is true) |
Optional Fields |
| accountNo, externalId |
Inherited from Product (if not provided) |
| nominalAnnualInterestRate, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType |
Minimal request: accountNo auto generated, remaining details inherited from savings product.
POST https://Domain Name/api/v1/savingsaccounts
POST savingsaccount
Content-Type: application/json
Request Body:
{
"clientId": 1,
"productId": 1,
"active": false
}
Minimal request: accountNo provided (must be unique), remaining details inherited from savings product.
POST savingsaccount
Content-Type: application/json
Request Body:
{
"clientId": 1,
"productId": 1,
"active": false,
"accountNo": "SA000023",
"externalId": "SYS-23"
}
Full request: accountNo provided (must be unique), remaining details override details from savings product (except currency).
POST savingsaccount
Content-Type: application/json
Request Body:
{
"clientId": 1,
"productId": 1,
"accountNo": "SA000023",
"externalId": "SYS-23",
"active": true,
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"activationDate": "01 March 2011",
"interestRate": "5.65",
"interestRatePeriodFrequencyType": 2,
"minRequiredOpeningBalance": "1,000",
"lockinPeriodFrequency": 6,
"lockinPeriodFrequencyType": 2
}
{
"officeId": 1,
"clientId": 1,
"savingsId": 1,
"resourceId": 1
}
Activate a Savings Account
Activates a savings account.
POST https://Domain Name/api/v1/savingsaccounts/{savingsId}?command=activate
POST savingsaccount/1?command=activate
Content-Type: application/json
Request Body:
{
"locale": "en",
"dateFormat": "dd MMMM yyyy",
"activationDate": "01 March 2011"
}
{
"officeId": 1,
"clientId": 1,
"savingsId": 1,
"resourceId": 1
}
Calculate Interest on Savings Account
Calculates interest earned on a savings account based on todays date. It does not attempt to post or credit the interest on the account. That is responsibility of another API that will be called by overnight process.
POST https://Domain Name/api/v1/savingsaccounts/{savingsId}?command=calculateInterest
POST savingsaccount/1?command=calculateInterest
Content-Type: application/json
Request Body:
{
}
{
"officeId": 1,
"clientId": 1,
"savingsId": 1,
"resourceId": 1
}
List Savings Accounts
Example Requests:
GET https://Domain Name/api/v1/savingsaccounts
[
{
"id": 1,
"accountNo": "SA000023",
"externalId": "SYS-23",
"groupId": 0,
"clientId": 1,
"clientName": "Client A AB",
"savingsProductId": 1,
"savingsProductName": "First",
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"interestRate": 5.65,
"interestRatePeriodFrequencyType": {
"id": 2,
"code": "savings.interest.rate.periodFrequencyType.months",
"value": "Per month"
},
"annualInterestRate": 67.8,
"minRequiredOpeningBalance": 1000,
"lockinPeriodFrequency": 6,
"lockinPeriodFrequencyType": {
"id": 2,
"code": "savings.interest.rate.periodFrequencyType.months",
"value": "Per month"
}
}
]
Retrieve a Savings Account:
Arguments
- associations
- optional, Either 'all' or a comma separated list of savings 'associations' (itemized below).
Associations are just extra pieces of data that you might or might not want to retrieve.- 'all': Gets data related to all associations e.g. ?associations=all.
- 'transactions': Gets data related to transactions on the account e.g. ?associations=transactions
Example Requests :
GET https://DomainName/api/v1/savingsaccounts/{accountId}
{
"id": 1,
"accountNo": "000000002",
"groupId": 0,
"clientId": 1,
"clientName": "Test b Client",
"savingsProductId": 1,
"savingsProductName": "individual savings",
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"interestRate": 9.8,
"interestRatePeriodFrequencyType": {
"id": 3,
"code": "savings.interest.rate.periodFrequencyType.years",
"value": "Per year"
},
"annualInterestRate": 9.8,
"summary": {
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
},
"totalDeposits": 456.67,
"totalWithdrawals": 173,
"accountBalance": 283.67
}
}
Update a Savings Account
Will most likely have a restriction to only allow 'inactive' savings accounts to be updated.
As other updates like change of interest rate are possibly special cases for savings.
PUT https://Domain Name/api/v1/savingsaccounts/{accountsId}
PUT savingsaccounts/1
Content-Type: application/json
No Request Body:
{
"locale": "en",
"interestRate": "5.2323"
}
{
"officeId": 1,
"clientId": 1,
"resourceId": 1,
"changes": {
"interestRate": 5.2323,
"locale": "en"
}
}
Delete a Savings Account
At present we support hard delete of savings account but this is likely to change to a savings account closure or De-activation process/command.
DELETE https://Domain Name/api/v1/savingsaccounts/{accountsId}
DELETE savingsaccounts/1
Content-Type: application/json
No Request Body:
{
"officeId": 1,
"clientId": 1,
"resourceId": 1
}
Savings Account Transactions:
Transactions possible on a savings account.
Field Descriptions |
| transactionDate |
| The date of the transaction. |
| transactionAmount |
| The amount of the transaction. |
Retrieve Savings Account Transaction Template:
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Requests:
GET https://Domain Name/api/v1/savingsaccounts/{accountId}/transactions/template
{
"accountId": 2,
"accountNo": "000000002",
"date": [
2013,
3,
22
],
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
}
}
Deposit Transaction
POST https://Domain Name/api/v1/savingsaccounts/{accountsId}/transactions?command=deposit
POST savingsaccounts/1/transactions?command=deposit
Content-Type: application/json
No Request Body:
{
"dateFormat": "dd MMMM yyyy",
"locale": "en",
"transactionDate": "02 March 2011",
"transactionAmount": "256.67"
}
{
"officeId": 1,
"clientId": 1,
"savingsId": 1,
"resourceId": 1
}
Withdrawal Transaction
POST https://Domain Name/api/v1/savingsaccounts/{accountsId}/transactions?command=withdrawal
POST savingsaccounts/1/transactions?command=withdrawal
Content-Type: application/json
No Request Body:
{
"dateFormat": "dd MMMM yyyy",
"locale": "en",
"transactionDate": "02 March 2011",
"transactionAmount": "99.50"
}
{
"officeId": 1,
"clientId": 1,
"savingsId": 1,
"resourceId": 2
}
Data Tables
The datatables API allows you to plug-in your own tables (MySql) that have a relationship to a Mifos X core table. For example, you might want to add some extra client fields and record information about each of the clients' family members. Via the API you can create, read, update and delete entries for each 'plugged-in' table. The API checks for permission and for 'data scoping' (only data within the users' office hierarchy can be managed by the user).
The Mifos X Reference App uses a JQuery plug-in called stretchydatatables (which in turn uses this datatables resource) to provide a pretty flexible CRUD (Create, Read, Update, Delete) User Interface.
List Data Tables
Lists registered data tables and the Mifos X Core application table they are registered to.
Arguments
- apptable
- optional
- The Mifos X core application table.
Example Requests:
GET https://DomainName/api/v1/datatables
[
{
"applicationTableName": "m_client",
"registeredTableName": "Additional Client Fields Data"
},
{
"applicationTableName": "m_client",
"registeredTableName": "Extra Family Details Data"
},
{
"applicationTableName": "m_loan",
"registeredTableName": "Additional Loan Fields Data"
}
]
Register Data Table
Registers a data table with the Mifos X Core application table. This allows the data table to be maintained through the API.
POST https://DomainName/api/v1/datatables/register/{datatable}/{apptable}
POST datatables/register/extra_client_details/m_client
Content-Type: application/json
Request Body:
{}
{
"resourceIdentifier": "extra_client_details"
}
Deregister Data Table
Deregisters a data table. It will no longer be available through the API.
POST https://DomainName/api/v1/datatables/deregister/{datatable}
POST datatables/deregister/extra_client_details
Content-Type: application/json
Request Body:
{}
{
"resourceIdentifier": "extra_client_details"
}
Create Entry in Data Table
Adds a row to the data table.
Note that the default datatable UI functionality converts any field name containing spaces to underscores when using the API. This means the field name "Business Description" is considered the same as "Business_Description". So you shouldn't have both "versions" in any data table.
POST https://DomainName/api/v1/datatables/{datatable}/{apptableId}
POST datatables/extra_client_details/1
Content-Type: application/json
Request Body:
{
"Business Description": "Livestock sales",
"Comment": "First comment made",
"Education_cv": "Primary",
"Gender_cd": "6",
"Highest Rate Paid": "8.5",
"Next Visit": "01 October 2012",
"Years in Business": "5",
"dateFormat": "dd MMMM yyyy",
"locale": "en"
}
{
"resourceId": 1
}
Retrieve Entry(s) from Data Table
Gets the entry (if it exists) for data tables that are one to one
with the application table.
Gets the entries (if they
exist) for data tables that are one to many with the application
table.
Note: The 'fields' parameter is not available for datatables.
Arguments
- order
- optional
- Specifies the order in which data is returned.
- genericResultSet
- optional
- If 'true' an optimised JSON format is returned suitable for tabular display of data. This format is used by the default data tables UI functionality.
Example Requests:
GET https://DomainName/api/v1/datatables/{datatable}/{apptableId}?genericResultSet=true
{
"columnHeaders": [
{
"columnName": "client_id",
"columnType": "bigint",
"columnLength": 0,
"columnDisplayType": "INTEGER",
"isColumnNullable": false,
"isColumnPrimaryKey": true,
"columnValues": []
},
{
"columnName": "Business Description",
"columnType": "varchar",
"columnLength": 100,
"columnDisplayType": "STRING",
"isColumnNullable": true,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "Years in Business",
"columnType": "int",
"columnLength": 0,
"columnDisplayType": "INTEGER",
"isColumnNullable": true,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "Gender_cd",
"columnType": "int",
"columnLength": 0,
"columnDisplayType": "CODELOOKUP",
"isColumnNullable": true,
"isColumnPrimaryKey": false,
"columnValues": [
{
"id": 5,
"value": "option.Male"
},
{
"id": 6,
"value": "option.Female"
}
]
},
{
"columnName": "Education_cv",
"columnType": "varchar",
"columnLength": 60,
"columnDisplayType": "CODEVALUE",
"isColumnNullable": true,
"isColumnPrimaryKey": false,
"columnValues": [
{
"id": 9,
"value": "Primary"
},
{
"id": 10,
"value": "Secondary"
},
{
"id": 11,
"value": "University"
}
]
},
{
"columnName": "Next Visit",
"columnType": "date",
"columnLength": 0,
"columnDisplayType": "DATE",
"isColumnNullable": true,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "Highest Rate Paid",
"columnType": "decimal",
"columnLength": 0,
"columnDisplayType": "DECIMAL",
"isColumnNullable": true,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "Comment",
"columnType": "text",
"columnLength": 65535,
"columnDisplayType": "TEXT",
"isColumnNullable": true,
"isColumnPrimaryKey": false,
"columnValues": []
}
],
"data": [
{
"row": [
"1",
"Livestock sales",
"5",
"6",
"Primary",
"2012-10-01",
"8.500000",
"First\tcomment made"
]
}
]
}
Update Entry in Data Table (One to One)
Updates the row (if it exists) of the data table.
PUT https://DomainName/api/v1/datatables/{datatable}/{apptableId}
PUT datatables/extra_client_details/1
Content-Type: application/json
Request Body:
{
"Business Description": "Livestock sales updated",
}
{
"resourceId": 1,
"changes": {
"Business Description": "Livestock sales updated"
}
}
Update Entry in Data Table (One to Many)
Updates the row (if it exists) of the data table.
PUT https://DomainName/api/v1/datatables/{datatable}/{apptableId}/{datatableId}
PUT datatables/Extra Family Details Data/1/2
Content-Type: application/json
Request Body:
{
"Date of Birth": "01 June 1982",
Education_cdHighest: "5",
Name: "June",
"Other Notes": "More\nnotes",
"Points Score": "20",
dateFormat: "dd MMMM yyyy",
locale: "en"
}
{ "resourceId": 1 }
Delete Entry(s) in Data Table
Deletes the entry (if it exists) for data tables that are one-to-one with the application table.
Deletes the entries (if they exist) for data tables that are one-to-many with the application table.
DELETE https://DomainName/api/v1/datatables/{datatable}/{apptableId}
DELETE datatables/extra_client_details/1
Content-Type: application/json
Request Body:
{}
{
"resourceId": 1
}
Delete Entry in Datatable (One to Many)
Deletes the entry (if it exists) for data tables that are one to many with the application table.
DELETE https://DomainName/api/v1/datatables/{datatable}/{apptableId}/{datatableId}
DELETE datatables/extra_family_details/1/2
Content-Type: application/json
Request Body:
{}
{
"resourceId": 1
}
Notes
Notes API allows to enter notes for supported resources.
Field Descriptions |
| note |
| A simple text note created for supported resources. |
Supported Resources |
|
Client
Loan Group Savings Account |
Add a Resource Note
Adds a new note to a supported resource.
Mandatory Fields |
| note |
Example Requests:
POST https://DomainName/api/v1/{resource}/{resourceId}/notes
POST clients/1/notes
Content-Type: application/json
Request Body:
{
"note": "a note about the client"
}
{
"officeId": 1,
"clientId": 1,
"resourceId": 76
}
Retrieve a Resource's Notes
Note: Notes are returned in descending createOn order.
Example Requests:
GET https://DomainName/api/v1/{resource}/{resourceId}/notes
[
{
"id": 2,
"clientId": 1,
"noteType": {
"id": 100,
"code": "noteType.client",
"value": "Client note"
},
"note": "First note edited",
"createdById": 1,
"createdByUsername": "mifos",
"createdOn": 1342498505000,
"updatedById": 1,
"updatedByUsername": "mifos",
"updatedOn": 1342498517000
}
]
Retrieve a Resource Note
Example Requests:
GET https://DomainName/api/v1/{resource}/{resourceId}/notes/{noteId}
{
"id": 76,
"clientId": 1,
"noteType": {
"id": 100,
"code": "noteType.client",
"value": "Client note"
},
"note": "a note about the client",
"createdById": 1,
"createdByUsername": "mifos",
"createdOn": 1359463135000,
"updatedById": 1,
"updatedByUsername": "mifos",
"updatedOn": 1359463135000
}
Update a Resource Note
PUT https://DomainName/api/v1/{resource}/{resourceId}/notes/{noteId}
PUT clients/1/notes/76
Content-Type: application/json
Request Body:
{
"note": "and here the note is updated nicely."
}
{
"officeId": 1,
"clientId": 1,
"resourceId": 76,
"changes": {
"note": "and here the note is updated nicely."
}
}
Delete a Resource Note
DELETE https://DomainName/api/v1/{resource}/{resourceId}/notes/{noteId}
DELETE clients/1/notes/76
Content-Type: application/json
No Request Body:
{
"resourceId": 76
}
Documents
Multiple Documents (a combination of a name, description and a file) may be attached to different Entities like Clients, Groups, Staff, Loans, Savings and Client Identifiers in the system
Note: The currently allowed Entities are
- Clients: URL Pattern as clients
- Staff: URL Pattern as staff
- Loans: URL Pattern as loans
- Savings: URL Pattern as savings
- Client Identifiers: URL Pattern as client_identifiers
- Groups: URL Pattern as groups
Field Descriptions |
| parentEntityType |
| The type of the Entity with which this document is associated |
| parentEntityId |
| The ID of the entity (client, loan etc) with which this document is associated |
| name |
| User Defined name for the document, need not be the same as the name of the file associated with the document |
| fileName |
| The name of the file associated with this document |
| size |
| The size (in bytes) of the file associated with this document |
| type |
| Mime Type of the file associated with this document |
| description |
| A description of this document |
List documents
Example Requests:
GET https://DomainName/api/v1/{entityType}/{entityId}/documents
[
{
"id": 1,
"parentEntityType": "clients",
"parentEntityId": 1,
"name": "Client Details Form ",
"fileName": "CGAP.pdf",
"size": 5246719,
"type": "application/pdf",
"description": "A signed form signed by new member"
}
]
Retrieve a Document
Example Requests:
GET https://DomainName/api/v1/documents/{clientId}
{
"id": 1,
"parentEntityType": "clients",
"parentEntityId": 1,
"name": "Client Details Form ",
"fileName": "CGAP.pdf",
"size": 5246719,
"type": "application/pdf",
"description": "A signed form signed by new member"
}
Create a Document
Note: A document is created using a Multi-part form upload
Body Parts |
| name |
| Name or summary of the document |
| description |
| Description of the document |
| file |
| The file to be uploaded |
Mandatory Fields |
| file and description |
POST https://DomainName/api/v1/{entityType}/{entityId}/documents
POST clients/1/documents
Content-Type: multipart/form-data
Request Body:
Not Shown (multi-part form data)
{
"resourceId":3,
"resourceIdentifier":"3"
}
Update a Document
Note: A document is updated using a Multi-part form upload
Body Parts |
| name |
| Name or summary of the document |
| description |
| Description of the document |
| file |
| The file to be uploaded |
PUT https://DomainName/api/v1/{entityType}/{entityId}/documents/{documentId}
PUT clients/1/documents/1
Content-Type: multipart/form-data
Request Body:
Not Shown (multi-part form data)
{
"resourceId":3,
"changes":{},
"resourceIdentifier":"3"
}
Retrieve Binary File associated with Document
Request used to download the file associated with the document
Example Requests:
GET https://DomainName/api/v1/{entityType}/{entityId}/documents/{documentId}/attachment
Not Shown: The corresponding Binary file
Remove a Document
DELETE https://DomainName/api/v1/{entityType}/{entityId}/documents/{documentId}
DELETE clients/1/documents/1
Content-Type: application/json
No Request Body:
{
"resourceId":1,
"changes":{},
"resourceIdentifier":"1"
}
DELETE https://DomainName/api/v1/{entityType}/{entityId}/documents/{documentId}
DELETE loans/1/documents/1
Content-Type: application/json
No Request Body:
{
"resourceId":1,
"changes":{},
"resourceIdentifier":"1"
}
Reports
The reports resource allows you to run and receive output from pre-defined Mifos X reports. The default output is a JSON formatted "Generic Resultset". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding "&exportCSV=true" to the end of your URL.
If Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats.
The Mifos X Individual Lending client application uses a JQuery plugin called stretchyreporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI).
List Reports
Lists all reports and their parameters. If a report has more than one parameter it will be listed the same number of times as it has parameters.
Arguments
- exportCSV
- optional, The only valid value is 'true'. If any other value is provided the argument will be ignored
- Output will be delivered as a CSV file instead of JSON.
Example Requests:
GET https://DomainName/api/v1/reports
{
"columnHeaders": [
{
"columnName": "report_id",
"columnType": "INT",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "report_name",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "report_type",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "report_subtype",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "report_category",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "parameter_id",
"columnType": "INT",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "report_parameter_name",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "parameter_name",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
}
],
"data": [
{
"row": [
"10",
"Active Loans Portfolio Status",
"Table",
null,
"Loan",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"10",
"Active Loans Portfolio Status",
"Table",
null,
"Loan",
"6",
null,
"loanOfficerIdSelectAll"
]
},
{
"row": [
"10",
"Active Loans Portfolio Status",
"Table",
null,
"Loan",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"10",
"Active Loans Portfolio Status",
"Table",
null,
"Loan",
"20",
null,
"fundIdSelectAll"
]
},
{
"row": [
"10",
"Active Loans Portfolio Status",
"Table",
null,
"Loan",
"25",
null,
"loanProductIdSelectAll"
]
},
{
"row": [
"11",
"Active Loans Summary per Branch",
"Table",
null,
"Loan Portfolio",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"11",
"Active Loans Summary per Branch",
"Table",
null,
"Loan Portfolio",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"48",
"Balance Sheet",
"Pentaho",
null,
"Accounting",
"5",
"branch",
"OfficeIdSelectOne"
]
},
{
"row": [
"48",
"Balance Sheet",
"Pentaho",
null,
"Accounting",
"41",
"date",
"endDateSelect"
]
},
{
"row": [
"1",
"Client Listing",
"Table",
null,
"Client",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"2",
"Client Loans Listing",
"Table",
null,
"Client",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"2",
"Client Loans Listing",
"Table",
null,
"Client",
"6",
null,
"loanOfficerIdSelectAll"
]
},
{
"row": [
"2",
"Client Loans Listing",
"Table",
null,
"Client",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"2",
"Client Loans Listing",
"Table",
null,
"Client",
"20",
null,
"fundIdSelectAll"
]
},
{
"row": [
"2",
"Client Loans Listing",
"Table",
null,
"Client",
"25",
null,
"loanProductIdSelectAll"
]
},
{
"row": [
"20",
"Funds Disbursed Between Dates Summary",
"Table",
null,
"Fund",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"20",
"Funds Disbursed Between Dates Summary",
"Table",
null,
"Fund",
"20",
null,
"fundIdSelectAll"
]
},
{
"row": [
"20",
"Funds Disbursed Between Dates Summary",
"Table",
null,
"Fund",
"40",
null,
"startDateSelect"
]
},
{
"row": [
"20",
"Funds Disbursed Between Dates Summary",
"Table",
null,
"Fund",
"41",
null,
"endDateSelect"
]
},
{
"row": [
"21",
"Funds Disbursed Between Dates Summary by Office",
"Table",
null,
"Fund",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"21",
"Funds Disbursed Between Dates Summary by Office",
"Table",
null,
"Fund",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"21",
"Funds Disbursed Between Dates Summary by Office",
"Table",
null,
"Fund",
"20",
null,
"fundIdSelectAll"
]
},
{
"row": [
"21",
"Funds Disbursed Between Dates Summary by Office",
"Table",
null,
"Fund",
"40",
null,
"startDateSelect"
]
},
{
"row": [
"21",
"Funds Disbursed Between Dates Summary by Office",
"Table",
null,
"Fund",
"41",
null,
"endDateSelect"
]
},
{
"row": [
"49",
"Income Statement",
"Pentaho",
null,
"Accounting",
"5",
"branch",
"OfficeIdSelectOne"
]
},
{
"row": [
"49",
"Income Statement",
"Pentaho",
null,
"Accounting",
"40",
"fromDate",
"startDateSelect"
]
},
{
"row": [
"49",
"Income Statement",
"Pentaho",
null,
"Accounting",
"41",
"toDate",
"endDateSelect"
]
},
{
"row": [
"5",
"Loans Awaiting Disbursal",
"Table",
null,
"Loan Portfolio",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"5",
"Loans Awaiting Disbursal",
"Table",
null,
"Loan Portfolio",
"6",
null,
"loanOfficerIdSelectAll"
]
},
{
"row": [
"5",
"Loans Awaiting Disbursal",
"Table",
null,
"Loan Portfolio",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"5",
"Loans Awaiting Disbursal",
"Table",
null,
"Loan Portfolio",
"20",
null,
"fundIdSelectAll"
]
},
{
"row": [
"5",
"Loans Awaiting Disbursal",
"Table",
null,
"Loan Portfolio",
"25",
null,
"loanProductIdSelectAll"
]
},
{
"row": [
"6",
"Loans Awaiting Disbursal Summary",
"Table",
null,
"Loan Portfolio",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"6",
"Loans Awaiting Disbursal Summary",
"Table",
null,
"Loan Portfolio",
"6",
null,
"loanOfficerIdSelectAll"
]
},
{
"row": [
"6",
"Loans Awaiting Disbursal Summary",
"Table",
null,
"Loan Portfolio",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"6",
"Loans Awaiting Disbursal Summary",
"Table",
null,
"Loan Portfolio",
"20",
null,
"fundIdSelectAll"
]
},
{
"row": [
"6",
"Loans Awaiting Disbursal Summary",
"Table",
null,
"Loan Portfolio",
"25",
null,
"loanProductIdSelectAll"
]
},
{
"row": [
"7",
"Loans Awaiting Disbursal Summary by Month",
"Table",
null,
"Loan Portfolio",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"7",
"Loans Awaiting Disbursal Summary by Month",
"Table",
null,
"Loan Portfolio",
"6",
null,
"loanOfficerIdSelectAll"
]
},
{
"row": [
"7",
"Loans Awaiting Disbursal Summary by Month",
"Table",
null,
"Loan Portfolio",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"7",
"Loans Awaiting Disbursal Summary by Month",
"Table",
null,
"Loan Portfolio",
"20",
null,
"fundIdSelectAll"
]
},
{
"row": [
"7",
"Loans Awaiting Disbursal Summary by Month",
"Table",
null,
"Loan Portfolio",
"25",
null,
"loanProductIdSelectAll"
]
},
{
"row": [
"15",
"Portfolio at Risk",
"Table",
null,
"Loan Portfolio",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"15",
"Portfolio at Risk",
"Table",
null,
"Loan Portfolio",
"6",
null,
"loanOfficerIdSelectAll"
]
},
{
"row": [
"15",
"Portfolio at Risk",
"Table",
null,
"Loan Portfolio",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"15",
"Portfolio at Risk",
"Table",
null,
"Loan Portfolio",
"20",
null,
"fundIdSelectAll"
]
},
{
"row": [
"15",
"Portfolio at Risk",
"Table",
null,
"Loan Portfolio",
"25",
null,
"loanProductIdSelectAll"
]
},
{
"row": [
"16",
"Portfolio at Risk by Branch",
"Table",
null,
"Loan Portfolio",
"5",
null,
"OfficeIdSelectOne"
]
},
{
"row": [
"16",
"Portfolio at Risk by Branch",
"Table",
null,
"Loan Portfolio",
"6",
null,
"loanOfficerIdSelectAll"
]
},
{
"row": [
"16",
"Portfolio at Risk by Branch",
"Table",
null,
"Loan Portfolio",
"10",
null,
"currencyIdSelectAll"
]
},
{
"row": [
"16",
"Portfolio at Risk by Branch",
"Table",
null,
"Loan Portfolio",
"20",
null,
"fundIdSelectAll"
]
},
{
"row": [
"16",
"Portfolio at Risk by Branch",
"Table",
null,
"Loan Portfolio",
"25",
null,
"loanProductIdSelectAll"
]
},
{
"row": [
"50",
"Trial Balance",
"Pentaho",
null,
"Accounting",
"5",
"branch",
"OfficeIdSelectOne"
]
},
{
"row": [
"50",
"Trial Balance",
"Pentaho",
null,
"Accounting",
"40",
"fromDate",
"startDateSelect"
]
},
{
"row": [
"50",
"Trial Balance",
"Pentaho",
null,
"Accounting",
"41",
"toDate",
"endDateSelect"
]
}
]
}
Running a Report
Runs a report and returns the report output.
Arguments
- R_'parameter names' ...
- optional, No defaults
- The number and names of the parameters depend on the specific report and how it has been configured. R_officeId is an example parameter name.
- Note: the prefix R_ stands for Reporting
- parameterType
- optional, The only valid value is 'true'. If any other value is provided the argument will be ignored
- Determines whether the request looks in the list of reports or the list of parameters for its data. Doesn't apply to Pentaho reports.
- exportCSV
- optional, The only valid value is 'true'. If any other value is provided the argument will be ignored
- Output will be delivered as a CSV file instead of JSON. Doesn't apply to Pentaho reports.
- output-type
- optional, Defaults to HTML.
- Valid Values are HTML, XLS, CSV and PDF for html, Excel, CSV and PDF formats respectively.
- Only applies to Pentaho reports.
Example Requests:
GET https://DomainName/api/v1/reports/{reportName}
{
"columnHeaders": [
{
"columnName": "Office/Branch",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "Client Account No.",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "Name",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "Joined",
"columnType": "DATE",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
},
{
"columnName": "External Id",
"columnType": "VARCHAR",
"isColumnNullable": false,
"isColumnPrimaryKey": false,
"columnValues": []
}
],
"data": [
{
"row": [
"Head Office",
"000000001",
"Petra Yton",
"2009-03-04",
"786YYH7"
]
},
{
"row": [
"Head Office",
"000000002",
"Keith(changed) Yton",
"2009-03-04",
null
]
},
{
"row": [
"Head Office",
"000000003",
"Jorge lastname",
"2013-02-05",
null
]
}
]
}
Authentication
An API capability that allows client applications to verify authentication details.
Field Descriptions |
| base64EncodedAuthenticationKey |
| HTTP Basic Auth key. See Authentication Overview for an example of its use. |
Verify authentication
Authenticates the credentials provided and returns the set roles and permissions allowed.
POST https://DomainName/api/v1/authentication?username={username}&password={password}
POST authentication?username=mifos&password=password
Content-Type: application/json
No Request Body
{
"username": "mifos",
"userId": 1,
"base64EncodedAuthenticationKey": "bWlmb3M6cGFzc3dvcmQ=",
"authenticated": true,
"roles": [
{
"id": 1,
"name": "Super user",
"description": "This role provides all application permissions."
}
],
"permissions": [
"ALL_FUNCTIONS"
]
}
POST authentication?username=mifos&password=fail
Content-Type: application/json
No Request Body
{
"developerMessage": "Invalid authentication details were passed in api request.",
"developerDocLink": "https://github.com/openMF/mifosx/wiki/HTTP-API-Error-codes",
"httpStatusCode": "401",
"defaultUserMessage": "Unauthenticated. Please login.",
"userMessageGlobalisationCode": "error.msg.not.authenticated",
"errors": []
}
Users
An API capability to support administration of application users.
Retrieve list of users
Example Requests:
GET https://DomainName/api/v1/users
[
{
"id": 1,
"username": "mifos",
"officeId": 1,
"officeName": "Head Office",
"firstname": "App",
"lastname": "Administrator",
"email": "demomfi@mifos.org"
}
]
Retrieve User Details Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/users/template
{
"allowedOffices": [
{
"id": 1,
"name": "Head Office",
"nameDecorated": "Head Office"
}
],
"availableRoles": [
{
"id": 1,
"name": "Super user",
"description": "This role provides all application permissions."
}
]
}
Retrieve a User
Example Requests:
GET https://DomainName/api/v1/users/{userId}
{
"id": 1,
"username": "mifos",
"officeId": 1,
"officeName": "Head Office",
"firstname": "App",
"lastname": "Administrator",
"email": "demomfi@mifos.org",
"availableRoles": [],
"selectedRoles": [
{
"id": 1,
"name": "Super user",
"description": "This role provides all application permissions."
}
]
}
Create a User
Adds new application user.
Note: Password information is not required (or processed). Password details at present are auto-generated and then sent to the email account given (which is why it can take a few seconds to complete).
Mandatory Fields |
| username, firstname, lastname, email, officeId, roles |
POST https://DomainName/api/v1/users
POST users
Content-Type: application/json
Request body:
{
"username": "newuser",
"firstname": "Test",
"lastname": "User",
"email": "whatever@mifos.org",
"officeId": 1,
"roles": [2,3]
}
{
"officeId": 1,
"resourceId": 11
}
Update a User
Note: When updating a password you must provide the repeatPassword parameter also.
PUT https://DomainName/api/v1/users/{userId)
PUT users/3
Content-Type: application/json
Request body:
{
"firstname": "Test",
"password": "window75",
"repeatPassword": "window75"
}
{
"officeId": 1,
"resourceId": 3,
"changes": {
"firstname": "Test",
"passwordEncoded": "abc3326b1bb376351c7baeb4175f5e0504e33aadf6a158474a6d71de1befae51"
}
}
Delete a User
Removes the user and the associated roles and permissions.
DELETE https://DomainName/api/v1/users/{userId}
DELETE users/20
Content-Type: application/json
No Request Body
{
"officeId": 1,
"resourceId": 20,
"changes": {}
}
Roles
An API capability to support management of application roles for user administration.
List Roles
Example Requests:
GET https://DomainName/api/v1/roles
[
{
"id": 1,
"name": "Super user",
"description": "This role provides all application permissions."
}
]
Retrieve a Role
Example Requests:
GET https://DomainName/api/v1/roles/{roleId}
{
"id": 1,
"name": "Super user",
"description": "This role provides all application permissions."
}
Create a New Role
Mandatory Fields |
| name, description |
POST https://DomainName/api/v1/roles
POST roles
Content-Type: application/json
Request body:
{
"name": "Another Role Name",
"description": "A description outlining the purpose of this role in relation to the application."
}
{ "resourceId": 2}
Update a Role
PUT https://DomainName/api/v1/roles/{roleId}
PUT roles/1
Content-Type: application/json
Request body:
{
"description": "some description(changed)"
}
{
"resourceId": 1,
"changes": {
"description": "some description(changed)"
}
}
Retrieve a Role's Permissions
Example Requests:
GET https://DomainName/api/v1/roles/{roleId}/permissions
{
"id": 1,
"name": "Super user",
"description": "This role provides all application permissions.",
"permissionUsageData": [
{
"grouping": "authorisation",
"code": "READ_PERMISSION",
"entityName": "PERMISSION",
"actionName": "READ",
"selected": false
},
...
{
"grouping": "transaction_loan",
"code": "WRITEOFF_LOAN_CHECKER",
"entityName": "LOAN",
"actionName": "WRITEOFF",
"selected": false
}
]
}
Update a Role's Permissions
PUT https://DomainName/api/v1/roles/{roleId}/permissions
PUT roles/8
Content-Type: application/json
Request body:
{
"permissions": {
"ALL_FUNCTIONS_READ": "true"
}
}
{
"resourceId": 8,
"changes": {
"permissions": {
"ALL_FUNCTIONS_READ": true
}
}
}
Permissions
An API capability to support management of application permissions for user administration.
List Application Permissions
Example Requests:
GET https://DomainName/api/v1/permissions
[
{
"grouping": "authorisation",
"code": "READ_PERMISSION",
"entityName": "PERMISSION",
"actionName": "READ",
"selected": true
},
....
{
"grouping": "transaction_loan",
"code": "WRITEOFF_LOAN",
"entityName": "LOAN",
"actionName": "WRITEOFF",
"selected": true
}
]
General Ledger Account
Ledger accounts represent an Individual account within an Organizations Chart
Of Accounts(COA) and are assigned a name and unique number by which they can
be identified.
All transactions relating to a company's assets, liabilities, owners' equity,
revenue and expenses are recorded against these accounts
Field Descriptions |
| name |
| The name of the account |
| glCode |
| The ledger code associated with the
Account These codes are mandatory and should be unique within an organization |
| disabled |
| A boolean flag that indicates whether an account is currently in use |
| type |
| Classifies the account into one of the following Types
Asset: represent the different types of economic resources owned or controlled by business, common examples of Asset accounts are cash, cash in bank, building, inventory, prepaid rent, goodwill, accounts receivable Liability: represent the different types of economic obligations by a business, such as accounts payable, bank loan, bonds payable Income: represent the company's gross earnings and common examples include Interest Income, Sales and Service revenue Expense: represent the company's expenditures to enable itself to operate. Common examples are electricity and water, rentals, depreciation, doubtful accounts, insurance. Equity: represent the residual equity of a business (after deducting from Assets all the liabilities) including Retained Earnings and Appropriations The options are fully listed in Retrieve General Ledger Accounts Template. |
| usage |
| Determines how the account shall be used "Header" accounts specify the title of a group of accounts. They are used only for grouping together detail accounts that have a similar purpose; that is, detail accounts are assigned to specific header accounts "Detail" accounts may have transactions logged against them The options are fully listed in Retrieve General Ledger Accounts Template. |
| manualEntriesAllowed |
| Specifies if manual entries can be made against this account using the Create Journal Entries API |
| description |
| Human understandable description for the Ledger Account |
List General Ledger Accounts
Arguments
- type
- Integer optional
- manualEntriesAllowed
- boolean optional
- usage
- Integer optional
- disabled
- boolean optional
Example Requests:
GET https://DomainName/api/v1/glaccounts
[
{
"id": 16,
"name": "Cash",
"glCode": "100001",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 1,
"code": "accountType.asset",
"value": "ASSET"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
},
"description": "Desc"
},
{
"id": 15,
"name": "Fund Source For Loan",
"glCode": "100002",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 1,
"code": "accountType.asset",
"value": "ASSET"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
},
"description": "Desc"
}
]
Retrieve GL Accounts Template
This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:
- Field Defaults
- Allowed Value Lists
Example Request:
GET https://DomainName/api/v1/glaccounts/template
{
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 1,
"code": "accountType.asset",
"value": "ASSET"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
},
"accountTypeOptions": [
{
"id": 1,
"code": "accountType.asset",
"value": "ASSET"
},
{
"id": 2,
"code": "accountType.liability",
"value": "LIABILITY"
},
{
"id": 3,
"code": "accountType.equity",
"value": "EQUITY"
},
{
"id": 4,
"code": "accountType.income",
"value": "INCOME"
},
{
"id": 5,
"code": "accountType.expense",
"value": "EXPENSE"
}
],
"usageOptions": [
{
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
},
{
"id": 2,
"code": "accountUsage.header",
"value": "HEADER"
}
]
}
Retrieve a General Ledger Account
Example Requests:
GET https://DomainName/api/v1/glaccounts/{glaccountsId}
{
"id": 1,
"name": "Cash",
"glCode": "100001",
"disabled": false,
"manualEntriesAllowed": true,
"type": {
"id": 1,
"code": "accountType.asset1",
"value": "ASSET"
},
"usage": {
"id": 1,
"code": "accountUsage.detail",
"value": "DETAIL"
},
"description": "Desc"
}
Create a General Ledger Account
Note: You may optionally
create Hierarchical Chart of Accounts by using the "parentId"
property of an Account
Mandatory Fields |
| name, glCode, type, usage and manualEntriesAllowed |
POST https://DomainName/api/v1/glaccounts
POST glaccounts
Content-Type: application/json
Request Body:
{
"name": "Cash at Bangalore",
"glCode": "100017",
"manualEntriesAllowed": true,
"type": 1,
"usage": 1,
"description": "Cash at Bangalore Branch"
}
{
"resourceId": 22
}
Update a General Ledger Account
PUT https://DomainName/api/v1/glaccounts/{glaccountId}
PUT glaccounts/22
Content-Type: application/json
Request Body:
{
"name": "Cash at Bangalore rural"
}
{
"resourceId": 22,
"changes": {
"name": "Cash at Bangalore rural"
}
}
PUT glaccounts/1
Content-Type: application/json
Request Body:
{
"disabled": true
}
{
"resourceId": 1,
"changes": {
"disabled": true
}
}
Delete a General Ledger Account
Note: Only Ledger Accounts against which no transactions have been logged (either manually or by the loan or Savings portfolio) can be deleted.
DELETE https://DomainName/api/v1/glaccounts/{glaccountId}
DELETE glaccounts/1
Content-Type: application/json
No Request Body:
{
"resourceId": 1,
"changes": {}
}
Accounting Closure
An accounting closure indicates that no more journal entries may be logged (or reversed) in the system, either manually or via the portfolio with an entry date prior to the defined closure date
Field Descriptions |
| closingDate |
| The date for which the accounting closure is defined |
| officeId |
| The identifer of the branch for which accounting has been closed |
| comments |
| Description associated with an Accounting closure |
List Accounting closures
Example Requests:
GET https://DomainName/api/v1/glclosures
[
{
"id": 7,
"officeId": 1,
"officeName": "Head Office",
"closingDate": [
2013,
1,
2
],
"deleted": false,
"createdDate": [
2013,
1,
3
],
"lastUpdatedDate": [
2013,
1,
3
],
"createdByUserId": 1,
"createdByUsername": "mifos",
"lastUpdatedByUserId": 1,
"lastUpdatedByUsername": "mifos",
"comments": "closed",
},
{
"id": 6,
"officeId": 1,
"officeName": "Head Office",
"closingDate": [
2012,
12,
13
],
"deleted": false,
"createdDate": [
2012,
12,
14
],
"lastUpdatedDate": [
2012,
12,
14
],
"createdByUserId": 1,
"createdByUsername": "mifos",
"lastUpdatedByUserId": 1,
"lastUpdatedByUsername": "mifos",
"comments": "hello",
}
]
Retrieve an Accounting Closure
Example Requests:
GET https://DomainName/api/v1/glclosures/{glclosureId}
{
"id": 7,
"officeId": 1,
"officeName": "Head Office",
"closingDate": [
2013,
1,
2
],
"deleted": false,
"createdDate": [
2013,
1,
3
],
"lastUpdatedDate": [
2013,
1,
3
],
"createdByUserId": 1,
"createdByUsername": "mifos",
"lastUpdatedByUserId": 1,
"lastUpdatedByUsername": "mifos",
"comments": "closed",
}
Create an Accounting Closure
Mandatory Fields |
| officeId,closingDate |
POST https://DomainName/api/v1/glclosures
POST glclosures
Content-Type: application/json
Request Body:
{
"officeId": 1,
"closingDate": "06 December 2012",
"comments": "The accountants are heading for a carribean vacation",
"locale": "en" ,
"dateFormat": "dd MMMM yyyy"
}
{
"officeId": 1,
"resourceId": 9
}
Update an Accounting closure
Once an accounting closure is created, only the comments associated with it may be edited
PUT https://DomainName/api/v1/glclosures/{glclosureId}
PUT glclosures/1
Content-Type: application/json
Request Body:
{
"comments": "All transactions verified by Johnny Cash"
}
{
"officeId": 1,
"resourceId": 1,
"changes": {
"comments": "All transactions verified by Johnny Cash"
}
}
Delete an accounting closure
Note: Only the latest accounting closure associated with a branch may be deleted.
DELETE https://DomainName/api/v1/glclosures/{glclosureId}
DELETE glclosures/1
Content-Type: application/json
No Request Body:
{
"officeId": 1,
"resourceId": 1
}
Journal Entries
A journal entry refers to the logging of
transactions against general ledger accounts. A journal
entry may consist of several line items, each of which is either a "debit" or a "credit". The total amount of the
debits must equal the total amount of the credits or the
journal entry is said to be "unbalanced"
A journal entry directly changes the account balances on
the general ledger
Field Descriptions |
| officeId |
| The identifier of the office ( cost center) at which the financial activity occured |
| glAccountId |
| The identifier of the account ( Ledger Account) against which this journal entry was made |
| transactionDate |
| The target date for which this entry was recorded |
| amount |
| The Monetary amount associated with this entry |
| comments |
| A description associated with this entry |
| entryType |
| Either a Credit(1) or a Debit(2) |
| transactionId |
| A unique Identifier for a set
of related Credit and Debit entries that make up
a "balanced" jounral Entry. For a manual entry,
this feild is a unique string. For a system generated entry, the combination of transactionId and entityId is unique |
| manualEntry |
| Flag determines if an entry is generated by the portfolio (posted automatically by the system during the lifecycle of loan or saving products) or manually created by using the Create (Balanced) Journal Entries API |
| reversed |
| Flag determines if this manual
journal entry has been reversed using the Reverse a Journal Entry
API. Note: A journal entry is reversed by logging debits for all credits that make up the Journal entry and vice-versa |
List Journal Entries
Arguments
- officeId
- Integer optional
- glAccountId
- Integer optional
- manualEntriesOnly
- Boolean optional
- Flag determines if only manually created journal entries
are to be returned( journal entries created by
the system during lifecycle of loan or saving
products etc shall be excluded)
Set to "false" by default if not passed in explicity - fromDate
- Date (yyyy-MM-dd)optional
- Filters for Journal entries whose entry Date is greater than or equal to the passed in Date
- toDate
- Date (yyyy-MM-dd)optional
- Filters for Journal entries whose entry Date is lesser than or equal to the passed in Date
- transactionId
- String optional
Example Requests:
GET https://DomainName/api/v1/journalentries?transactionId=PB37X8Y21EQUY4S
[
{
"id": 81,
"officeId": 1,
"officeName": "Head Office",
"glAccountName": "Something totally else",
"glAccountId": 17,
"glAccountCode": "340098",
"glAccountType": {
"id": 3,
"code": "accountType.equity",
"value": "EQUITY"
},
"transactionDate": [
2012,
12,
12
],
"entryType": {
"id": 2,
"code": "journalEntrytType.debit",
"value": "DEBIT"
},
"amount": 120,
"transactionId": "PB37X8Y21EQUY4S",
"manualEntry": true,
"createdByUserId": 1,
"createdDate": [
2012,
12,
13
],
"createdByUserName": "mifos",
"reversed": true
},
{
"id": 82,
"officeId": 1,
"officeName": "Head Office",
"glAccountName": "Something else",
"glAccountId": 19,
"glAccountCode": "560050",
"glAccountType": {
"id": 3,
"code": "accountType.equity",
"value": "EQUITY"
},
"transactionDate": [
2012,
12,
12
],
"entryType": {
"id": 1,
"code": "journalEntryType.credit",
"value": "CREDIT"
},
"amount": 120,
"transactionId": "PB37X8Y21EQUY4S",
"manualEntry": true,
"createdByUserId": 1,
"createdDate": [
2012,
12,
13
],
"createdByUserName": "mifos",
"reversed": true
}
]
Create "Balanced" Journal Entries
Note: A Balanced (simple) Journal entry would
have atleast one "Debit" and one "Credit" entry whose
amounts are equal
Compound Journal entries may have "n" debits and "m"
credits where both "m" and "n" are greater than 0
and the net sum or all debits and credits are equal
Mandatory Fields |
| officeId, transactionDate |
| credits |
| Details of the credits contained
in the journal entry. Each credit entry contains
the following items glAccountId: Identifier of the general ledger account against which the credit entry shall be made amount: Amount of money credited comments: Optional description associated with a credit entry . |
| debits |
| Details of the debits contained
in the journal entry. Each debit entry contains the
following items glAccountId: Identifier of the general ledger account against which the debit entry shall be made amount: Amount of money debited comments: Optional description associated with a debit entry . |
POST https://DomainName/api/v1/journalentries
POST journalentries
Content-Type: application/json
Request Body:
{
"officeId": 1,
"transactionDate": "06 December 2012",
"comments": "Gifts for staff",
"locale": "en" ,
"dateFormat": "dd MMMM yyyy",
"credits":[{"glAccountId":1,
"amount":5000},
{"glAccountId":2,
"amount":5000}
],
"debits":[{"glAccountId":3,
"amount":5000},
{"glAccountId":4,
"amount":5000}
]
}
{
"officeId": 1,
"transactionId": "DNEEMS2LPD0NJ9O"
}
Retrieve a single Entry
Example Requests:
GET https://DomainName/api/v1/journalentries/{entryId}
{
"id": 1,
"officeId": 2,
"officeName": "sub branch 1",
"glAccountName": "Income from interest",
"glAccountId": 14,
"glAccountCode": "400001",
"glAccountType": {
"id": 4,
"code": "accountType.income",
"value": "INCOME"
},
"transactionDate": [
2012,
11,
2
],
"entryType": {
"id": 1,
"code": "journalEntryType.credit",
"value": "CREDIT"
},
"amount": 900,
"transactionId": "13",
"manualEntry": true,
"createdByUserId": 1,
"createdDate": [
2012,
11,
2
],
"createdByUserName": "mifos",
"reversed": false
}
Reverse a Journal Entry
Note: A journal entry is reversed by logging debits for all credits that constitute the Journal entry and vice-versa. The transactionId of the "reversal Entry" is returned as the methods response
Arguments
- command
- String Mandatory, case-insensitive
- 'reverse' : Reverse the Journal Entry
GET https://DomainName/api/v1/journalentries/{transactionId}
POST journalentries/C1MAE935K0IAEYA?command=reverse
Content-Type: application/json
{
"transactionId": "YFDYMPBVVI9TRJP"
}
Search
Search API allows to search scoped resources clients, loans and groups on specified fields.
Scoped Resources |
Scoped fields |
| Client | Display Name |
| Account Number | |
| External Id | |
| Loan | Account Number |
| Client Identifiers | Document Key |
| Group | Name |
| External Id |
Search Resources
Example Requests:
Parameters |
Description |
|
query
(mandatory) |
String which is searched on scoped resources |
|
resource
(non-mandatory) |
Scoped resources on which search can be performed. If there is no resource parameter passed then search will be performed on all scoped resources. |
Order of Search results |
List exact match results in following order
|
List partial match results in following order
|
GET https://DomainName/api/v1/search?query=000000111
[
{
"entityId": 111,
"entityAccountNo": "000000111",
"entityName": "12-A Flat Loan",
"entityType": "LOAN",
"parentId": 65,
"parentName": "aaaa aaaaa"
}
]