Mifos X API Documentation
The Mifos X 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. https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices)
- Add a header to indicate you are sending JSON data as part of the request body (e.g. Content-Type: application/json)
- 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 Convenience 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.
Example Request:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices/1?pretty=true&fields=id,name,parentNamePretty 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
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, they are sent as strings in POST and PUT requests. If there are any dates in your POST or PUT requests, you need to provide the "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:
{
"dateFormat": "dd MMMM yyyy",
"openingDate": "01 July 2007"
}
{
"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.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. You must authenticate for all requests.
// 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 : "https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/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
JPW:Need to update this Stripe uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, a charge failed, etc.), and codes in the 5xx range indicate an error with Stripe's servers.
Not all errors map cleanly onto HTTP response codes, however. When a request is valid but does not complete successfully (e.g. a card is declined), we return a 402 error code.
All errors return JSON with a type (one of card_error, invalid_request_error, or api_error) and message describing the particular problem.
Attributes
- type
- The type of error returned (card_error, invalid_request_error, api_error) Card errors are the most common type of error you should expect to handle. They result when the user enters a card that can't be charged for some reason. Invalid request errors arise when your request has invalid parameters. API errors cover any other type of problem (e.g. a temporary problem with Stripe's servers) and should turn up only very infrequently.
- message
- A user-friendly message describing the error
- code
- optional
- For card errors, additional information about the user-friendly message to display for this error (e.g. "Your card was declined.")
- param
- optional
- The parameter the error relates to if the error is parameter-specific. You can use this to display a message near the correct form field, for example.
HTTP Status Code Summary
- 200 OK - Everything worked as expected.
- 400 Bad Request - Often missing a required parameter.
- 401 Unauthorized - No valid API key provided.
- 402 Request Failed - Parameters were valid but request failed.
- 404 Not Found - The requested item doesn't exist.
- 500, 502, 503, 504 Server errors - something went wrong on Stripe's end.
Errors
Type: invalid_request_error
Type: api_error
Type: card_error
| Code | Details |
|---|---|
| invalid_number | The card number is invalid |
| incorrect_number | The card number is incorrect |
| invalid_expiry_month | The card's expiration month is invalid |
| invalid_expiry_year | The card's expiration year is invalid |
| invalid_cvc | The card's security code is invalid |
| expired_card | The card has expired |
| invalid_amount | An invalid amount was entered |
| incorrect_cvc | The card's security code is incorrect |
| card_declined | The card was declined. |
| missing | There is no card on a customer that is being charged. |
| duplicate_transaction | A transaction with identical amount and credit card information was submitted very recently. |
| processing_error | An error occurred while processing the card. |
Clients
Clients are people and businesses that have applied (or may apply) to an MFI for loans.
Field Descriptions |
| externalId |
| A place to put an external reference for this client e.g. The ID another system uses. |
| maxJoinedOnOffsetFromToday |
| Convenience field. Number of days since the Client joined. |
List Clients
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients?pretty=true&fields=displayName,officeName,joinedDate
GET https://thedomainname/api/v1/clients
[ {
"officeId" : 1,
"officeName" : "change super user",
"id" : 2,
"firstname" : "Dennis",
"lastname" : "O'Meara",
"displayName" : "Dennis O'Meara",
"externalId" : null,
"joinedDate" : [ 2009, 1, 4 ],
"maxJoinedOnOffsetFromToday" : -1241
}, {
"officeId" : 1,
"officeName" : "change super user",
"id" : 4,
"firstname" : "Jimmy",
"lastname" : "O'Meara",
"displayName" : "Jimmy O'Meara",
"externalId" : null,
"joinedDate" : [ 2009, 1, 11 ],
"maxJoinedOnOffsetFromToday" : -1234
}...]
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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/template?pretty=trueGET https://thedomainname/api/v1/clients/template
{
"joinedDate" : [ 2012, 5, 29 ],
"allowedOffices" : [ {
"id" : 1,
"name" : "Demo MFI Head Office"
}, {
"id" : 2,
"name" : "sub branch 1"
}, {
"id" : 8,
"name" : "moi aussi"
}, {
"id" : 3,
"name" : "sub branch 2"
}, {
"id" : 4,
"name" : "sub branch 3"
} ]
}
Retrieve a Client
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/1?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/1?pretty=true&template=true
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/1?pretty=true&fields=id,displayName,officeName
GET https://thedomainname/api/v1/clients/{clientId}
{
"officeId" : 1,
"officeName" : "change super user",
"id" : 1,
"firstname" : "Patrick",
"lastname" : "O'Meara",
"displayName" : "Patrick O'Meara",
"externalId" : null,
"joinedDate" : [ 2009, 1, 4 ],
"maxJoinedOnOffsetFromToday" : -1241
}
Create a Client
Note: You can enter either:
firstname/lastname - for a person OR
clientOrBusinessName - for a business or organisation (or person known by one name).
Mandatory Fields |
| firstname, lastname, joiningDate, officeId |
POST https://thedomainname/api/v1/clients
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients
Content-Type: application/json
Request Body:
{
"officeId": 1,
"firstname": "Petra",
"lastname": "Yton",
"externalId": "786YYH7",
"dateFormat": "dd MMMM yyyy",
"joiningDate": "04 March 2009"
}
{
"entityId":23
}
Update a Client
PUT https://thedomainname/api/v1/clients/{clientId}
PUT https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/23
Content-Type: application/json
Request Body:
{
"externalId": "786444UUUYYH7",
"dateFormat": "dd MMMM yyyy",
"joiningDate": "09 June 2006"
}
{ "entityId": 23}
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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/1/loans?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/1/loans?pretty=true&fields=openLoans,%20closedLoans,activeLoanCount
GET https://thedomainname/api/v1/clients/{clientId}/loans
{
"pendingApprovalLoans" : [ ],
"awaitingDisbursalLoans" : [ {
"id" : 17,
"externalId" : null,
"loanProductId" : 1,
"loanProductName" : "Agricultural Loan",
"loanStatusId" : 200,
"pendingApproval" : false,
"waitingForDisbursal" : true,
"open" : false,
"closed" : false,
"lifeCycleStatusText" : "Approved",
"lifeCycleStatusDate" : null
} ],
"openLoans" : [ ],
"closedLoans" : [ {
"id" : 1,
"externalId" : null,
"loanProductId" : 1,
"loanProductName" : "Agricultural Loan",
"loanStatusId" : 600,
"pendingApproval" : false,
"waitingForDisbursal" : false,
"open" : false,
"closed" : true,
"lifeCycleStatusText" : "Closed",
"lifeCycleStatusDate" : null
} ],
"anyLoanCount" : 2,
"pendingApprovalLoanCount" : 0,
"awaitingDisbursalLoanCount" : 1,
"activeLoanCount" : 0,
"closedLoanCount" : 1
}
Retrieve a Client's Notes
Note: Notes are returned in descending createOn order.
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/2/notes?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/2/notes?pretty=true&fields=note,createdOn,createdByUsername
GET https://thedomainname/api/v1/clients/{clientId}/notes
[ {
"id" : 20,
"clientId" : 2,
"loanId" : null,
"loanTransactionId" : null,
"noteTypeId" : 100,
"note" : "This is an extra note!",
"createdById" : 2,
"createdByUsername" : "super1",
"createdOn" : 1335066625000,
"updatedById" : 2,
"updatedByUsername" : "super1",
"updatedOn" : 1335066625000
}, {
"id" : 16,
"clientId" : 2,
"loanId" : null,
"loanTransactionId" : null,
"noteTypeId" : 100,
"note" : "loan only 1/2 amount expected\r\nyes",
"createdById" : 2,
"createdByUsername" : "super1",
"createdOn" : 1334726104000,
"updatedById" : 2,
"updatedByUsername" : "super1",
"updatedOn" : 1335137893000
} ]
Add a Client Note
POST https://thedomainname/api/v1/clients/{clientId}/notes
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/1/notes
Content-Type: application/json
Request Body:
{
"note": "a note about the client"
}
{
"entityId": 40
}
Retrieve a Client Note
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/2/notes/20?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/2/notes/20?pretty=true&fields=note,createdOn,createdByUsername
GET https://thedomainname/api/v1/clients/{clientId}/notes/{noteId}
{
"id" : 20,
"clientId" : 2,
"loanId" : null,
"loanTransactionId" : null,
"noteTypeId" : 100,
"note" : "This is an extra note!",
"createdById" : 2,
"createdByUsername" : "super1",
"createdOn" : 1335066625000,
"updatedById" : 2,
"updatedByUsername" : "super1",
"updatedOn" : 1335066625000
}
Update a Client Note
PUT https://thedomainname/api/v1/clients/{clientId}/notes/{noteId}
PUT https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/clients/2/notes/20
Content-Type: application/json
Request Body:
{
"note": "and here the note is updated nicely."
}
{
"entityId": 20
}
Loans
Field Descriptions |
| digitsAfterDecimal |
| Override the loan product default value for digitsAfterDecimal. |
| principal |
| Loan amount. |
| externalId |
| A place to put an external reference for this loan e.g. The ID another system uses. |
| inArrearsTolerance |
| numberOfRepayments |
| Number of installments to repay. Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks |
| interestRatePerPeriod |
| Interest Rate. Used like: interestRatePerPeriod% interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance |
| repaymentEvery |
| Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks |
| Each of the items below has an id, code and (english) value. Only the id (integer) is used when updating. All 3 are returned on GET (read) requests. The options are fully listed in Retrieve Loan Product Details Template. |
| repaymentFrequencyType |
| Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks Example Values: Days, Weeks, Months |
| interestRateFrequencyType |
| Used like: interestRatePerPeriod% interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance Example Values: Per month, Per year |
| amortizationType |
| Example Values: Equal principle payments, Equal installments |
| interestType |
| Used like: interestRatePerPeriod% interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance Example Values: Declining Balance, Flat |
| interestCalculationPeriodType |
| Example Values: Same as repayment period, Daily |
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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/template?clientId=1&productId=1&pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/template?clientId=1&pretty=true
GET https://thedomainname/api/v1/loans/template
{
"clientId" : 1,
"clientName" : "Patrick O'Meara",
"productId" : 1,
"productName" : "Agricultural Loan",
"selectedProduct" : {
"id" : 1,
"name" : "Agricultural Loan",
"description" : "An agricultural loan given to farmers to help buy crop, stock and machinery. With an arrears tolerance setting of 1,000 CFA, loans are not marked as 'in arrears' or 'in bad standing' if the amount outstanding is less than this. Interest rate is described using monthly percentage rate (MPR) even though the loan typically lasts a year and requires one repayment (typically at time when farmer sells crop)",
"principal" : {
"currencyCode" : "XOF",
"digitsAfterDecimal" : 0,
"amount" : 100000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "100000 CFA"
},
"inArrearsTolerance" : {
"currencyCode" : "XOF",
"digitsAfterDecimal" : 0,
"amount" : 1000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "1000 CFA"
},
"numberOfRepayments" : 1,
"repaymentEvery" : 12,
"interestRatePerPeriod" : 1.750000,
"annualInterestRate" : 21.000000,
"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"
},
"createdOn" : 1334232874000,
"lastModifedOn" : 1334232874000,
"currencyOptions" : [ {
"code" : "KES",
"name" : "Kenyan Shilling",
"decimalPlaces" : 2,
"displaySymbol" : "KSh",
"nameCode" : "currency.KES",
"displayLabel" : "Kenyan Shilling (KSh)"
}, {
"code" : "BND",
"name" : "Brunei Dollar",
"decimalPlaces" : 2,
"displaySymbol" : "BND",
"nameCode" : "currency.BND",
"displayLabel" : "Brunei Dollar (BND)"
}, {
"code" : "LBP",
"name" : "Lebanese Pound",
"decimalPlaces" : 2,
"displaySymbol" : "L£",
"nameCode" : "currency.LBP",
"displayLabel" : "Lebanese Pound (L£)"
}, {
"code" : "GHC",
"name" : "Ghana Cedi",
"decimalPlaces" : 2,
"displaySymbol" : "GHC",
"nameCode" : "currency.GHC",
"displayLabel" : "Ghana Cedi (GHC)"
}, {
"code" : "USD",
"name" : "US Dollar",
"decimalPlaces" : 2,
"displaySymbol" : "$",
"nameCode" : "currency.USD",
"displayLabel" : "US Dollar ($)"
}, {
"code" : "XOF",
"name" : "CFA Franc BCEAO",
"decimalPlaces" : 0,
"displaySymbol" : "CFA",
"nameCode" : "currency.XOF",
"displayLabel" : "CFA Franc BCEAO (CFA)"
} ],
"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"
} ],
"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"
} ]
},
"expectedDisbursementDate" : [ 2012, 6, 1 ],
"repaymentSchedule" : null,
"allowedProducts" : [ {
"id" : 1,
"name" : "Agricultural Loan"
}, {
"id" : 2,
"name" : "Brunei Loan"
}, {
"id" : 3,
"name" : "IL Loan"
}, {
"id" : 4,
"name" : "IBL Mabeshte"
}, {
"id" : 5,
"name" : "Salary Loan"
}, {
"id" : 6,
"name" : "daily-declining-balance"
} ]
}
Retrieve a Loan
Note: template=true parameter doesn't apply to this resource.
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/1?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/1?pretty=true&fields=id,principal,interestRatePerYear
GET https://thedomainname/api/v1/loans/{loanId}
{
"open" : false,
"openWithRepaymentMade" : false,
"closed" : true,
"interestRebateOutstanding" : false,
"pendingApproval" : false,
"waitingForDisbursal" : false,
"lifeCycleStatusText" : "Closed",
"lifeCycleStatusDate" : [ 2009, 11, 13 ],
"id" : 1,
"externalId" : null,
"loanProductName" : "Agricultural Loan",
"submittedOnDate" : [ 2009, 1, 5 ],
"approvedOnDate" : [ 2009, 1, 8 ],
"expectedDisbursementDate" : [ 2009, 1, 15 ],
"actualDisbursementDate" : [ 2009, 1, 15 ],
"undoDisbursalAllowed" : false,
"expectedFirstRepaymentOnDate" : null,
"interestCalculatedFromDate" : null,
"closedOnDate" : [ 2009, 11, 13 ],
"expectedMaturityDate" : [ 2009, 11, 15 ],
"principal" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 100000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "100000 CFA"
},
"interestRatePerYear" : 21.0,
"interestRatePerPeriod" : 1.75,
"interestPeriodFrequencyType" : 2,
"interestPeriodFrequencyText" : "MONTHS",
"interestMethodType" : 0,
"interestMethodText" : "DECLINING_BALANCE",
"amortizationMethodValue" : 1,
"amortizationMethodText" : "EQUAL_INSTALLMENTS",
"numberOfRepayments" : 1,
"repaymentFrequencyNumber" : 10,
"repaymentFrequencyTypeEnumOrdinal" : 2,
"repaymentFrequencyTypeText" : "MONTHS",
"interestRebateOwed" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"loanData" : {
"repaymentSchedule" : {
"periods" : [ {
"period" : 1,
"date" : [ 2009, 11, 15 ],
"disbursed" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"principal" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 100000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "100000 CFA"
},
"principalPaid" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 100000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "100000 CFA"
},
"principalOutstanding" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"interest" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 17500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "17500 CFA"
},
"interestPaid" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 17500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "17500 CFA"
},
"interestOutstanding" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"total" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 117500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "117500 CFA"
},
"totalPaid" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 117500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "117500 CFA"
},
"totalOutstanding" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"totalWaived" : null,
"totalArrears" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"arrearsFrom" : null,
"arrearsTo" : null,
"paidInFullOn" : [ 2009, 11, 13 ],
"lastAffectingPaymentOn" : [ 2009, 11, 13 ],
"fullyPaid" : true
} ]
},
"summary" : {
"originalPrincipal" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 100000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "100000 CFA"
},
"originalInterest" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 17500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "17500 CFA"
},
"originalTotal" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 117500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "117500 CFA"
},
"principalPaid" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 100000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "100000 CFA"
},
"principalOutstanding" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"interestPaid" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 17500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "17500 CFA"
},
"interestOutstanding" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"totalPaid" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 117500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "117500 CFA"
},
"totalOutstanding" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"totalInArrears" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
},
"totalWaived" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 0,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0 CFA"
}
},
"loanRepayments" : [ {
"id" : 2,
"date" : [ 2009, 11, 13 ],
"principal" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 100000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "100000 CFA"
},
"interest" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 17500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "17500 CFA"
},
"total" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 117500,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "117500 CFA"
},
"totalWaived" : null,
"overpaid" : null,
"transactionOffsetFromToday" : -929
} ]
},
"arrearsTolerance" : {
"currencyCode" : "XOF",
"currencyDigitsAfterDecimal" : 0,
"amount" : 1000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "1000 CFA"
},
"waiveAllowed" : false,
"makeRepaymentAllowed" : false,
"rejectAllowed" : false,
"withdrawnByApplicantAllowed" : false,
"undoApprovalAllowed" : false,
"disbursalAllowed" : false,
"anyActionOnLoanAllowed" : false,
"maxSubmittedOnOffsetFromToday" : -1241,
"maxApprovedOnOffsetFromToday" : -1238,
"maxDisbursedOnOffsetFromToday" : -1231,
"actualLoanTermInDays" : 302,
"actualLoanTermInMonths" : 9,
"loanTermInDays" : 304,
"loanTermInMonths" : 10
}
Create a New Loan/Submit a Loan Application
Arguments
- command
- String Optional, case-insensitive
- The default action is to Submit a New Loan Application ("Submitted and awaiting approval" status).
- If "?command=calculateLoanSchedule" is added to the URL then no update is made but the loan schedule (as would have been if the loan had been submitted) is returned. This gives the ability to try out various loan options and 'preview' the schedule before committing to it.
Mandatory Fields |
| clientId, productId, inArrearsTolerance, submittedOnDate, currencyCode, digitsAfterDecimal, principal, repaymentFrequencyType, repaymentEvery, numberOfRepayments, interestRatePerPeriod, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, expectedDisbursementDate |
POST https://thedomainname/api/v1/loans
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans
Content-Type: application/json
Request Body:
{
"clientId": 1,
"productId": 1,
"currencyCode": "USD",
"digitsAfterDecimal": "2",
"locale": "en_GB",
"principal": "100,000.00",
"inArrearsTolerance": "1,000.00",
"repaymentFrequencyType": 2,
"repaymentEvery": "1",
"numberOfRepayments": "12",
"interestRatePerPeriod": "1.75",
"interestRateFrequencyType": 2,
"amortizationType": 1,
"interestCalculationPeriodType": 1,
"interestType": 0,
"dateFormat": "dd MMMM yyyy",
"expectedDisbursementDate": "01 July 2007",
"submittedOnDate": "25 June 2007"
}
{
"entityId": 42
}
Approve, Undo Approval, Disburse, Undo Disbursal, Reject a Loan or Withdraw a Loan Application
Arguments
- command
- String Mandatory, case-insensitive
- 'approve' : Approve Loan
- 'disburse' : Disburse Loan
- 'reject' : Reject Loan
- 'withdrewbyclient' : Client Withdrew Loan Application
- 'undoapproval' : Undo Loan Approval
- 'undodisbursal' : Undo Loan Disbursal
Mandatory Fields |
| eventDate |
POST https://thedomainname/api/v1/loans/{loanId}
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/1?command=approve
Content-Type: application/json
Request Body:
{
"dateFormat": "dd MMMM yyyy",
"eventDate": "07 May 2012",
"note": "and event note is added"
}
{
"entityId": 37
}
Delete a Loan
Note: Only loans in "Submitted and awaiting approval" status can be deleted.
DELETE https://thedomainname/api/v1/loans/{loanId}
DELETE https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/1
Content-Type: application/json
No Request Body:
{
"entityId": 1
}
Retrieve Loan Repayment/Loan Waiver 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.
Example Request:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/10/transactions/template?command=repayment&pretty=trueGET https://thedomainname/api/v1/loans/{loanId}/transactions/template"
{
"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 / Loan Waiver
- command
- String Optional, case-insensitive
- 'repayment' : Make Loan Repayment.
- 'waiver' : Loan Waiver.
POST https://thedomainname/api/v1/loans/{loanId}/transactions
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/37/transactions?command=repayment
Content-Type: application/json
Request Body:
{
"locale": "en_GB",
"dateFormat": "dd MMMM yyyy",
"transactionDate": "14 May 2012",
"transactionAmount": "559.88",
"note": "Repayment at branch"
}
{
"entityId": 37
}
Retrieve a Repayment or Waiver Details
Example Request:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/10/transactions/20?pretty=trueGET https://thedomainname/api/v1/loans/{loanId}/transactions/{transactionId}
{
"id" : 10,
"date" : [ 2009, 1, 29 ],
"principal" : null,
"interest" : null,
"total" : {
"currencyCode" : "XOF",
"digitsAfterDecimal" : 0,
"amount" : 300000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "300000 CFA"
},
"totalWaived" : null,
"overpaid" : null,
"transactionOffsetFromToday" : -1218
}
Adjust a Repayment or Waiver
Note: there is no need to specify command={transactionType} parameter.
Mandatory Fields |
| transactionDate, transactionAmount |
POST https://thedomainname/api/v1/loans/{loanId}/transactions/{transactionId}
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loans/16/transactions/32
Content-Type: application/json
Request Body:
{
"locale": "en_GB",
"dateFormat": "dd MMMM yyyy",
"transactionDate": "25 May 2012",
"transactionAmount": "50,000.00",
"note": "adj note"
}
{
"entityId": 16
}
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. |
| 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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices?fields=id,name,openingDate&pretty=true
GET https://thedomainname/api/v1/offices
[ {
"id" : 1,
"name" : "Demo MFI Head Office",
"externalId" : "1",
"openingDate" : [ 2009, 1, 1 ],
"hierarchy" : ".",
"parentName" : null,
"parentId" : null
}, {
"id" : 2,
"name" : "B1",
"externalId" : null,
"openingDate" : [ 2012, 4, 1 ],
"hierarchy" : ".2.",
"parentName" : "Demo MFI Head Office",
"parentId" : 1
}, {
"id" : 3,
"name" : "B2",
"externalId" : null,
"openingDate" : [ 2012, 4, 4 ],
"hierarchy" : ".3.",
"parentName" : "Demo MFI Head Office",
"parentId" : 1
} ]
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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices/template?pretty=trueGET https://thedomainname/api/v1/offices/template
{
"openingDate" : [ 2012, 5, 28 ],
"allowedParents" : [ {
"id" : 1,
"name" : "Demo MFI Head Office"
}, {
"id" : 2,
"name" : "B1"
}, {
"id" : 3,
"name" : "B2"
} ]
}
Retrieve an Office
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices/1?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices/1?pretty=true&template=true
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices/1?pretty=true&fields=id,name,parentName
GET https://thedomainname/api/v1/offices/1
{
"id" : 1,
"name" : "Demo MFI Head Office",
"externalId" : "1",
"openingDate" : [ 2009, 1, 1 ],
"hierarchy" : ".",
"parentName" : null,
"parentId" : null
}
Create an Office
Mandatory Fields |
| name, openingDate, parentId |
POST https://thedomainname/api/v1/offices
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices
Content-Type: application/json
Request Body:
{
"name": "Example New Branch",
"dateFormat": "dd MMMM yyyy",
"openingDate": "01 July 2007",
"parentId": 2,
"externalId": "SYS54-88"
}
{
"entityId": 9
}
Update Office
PUT https://thedomainname/api/v1/offices/{officeId}
PUT https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/offices/1
Content-Type: application/json
Request Body:
{
"name": "Name is updated"
}
{
"entityId": 1
}
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 |
| digitsAfterDecimal |
| Override the default value for digitsAfterDecimal associated with the currencyCode selected. |
| principal |
| Loan amount. |
| inArrearsTolerance |
| numberOfRepayments |
| Number of installments to repay. Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks |
| interestRatePerPeriod |
| Interest Rate. Used like: interestRatePerPeriod% interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance |
| repaymentEvery |
| Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks |
| Each of the items below has an id, code and (english) value. Only the id (integer) is used when updating. All 3 are returned on GET (read) requests. The options are fully listed in Retrieve Loan Product Details Template. |
| repaymentFrequencyType |
| Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType e.g. 10 (repayments) Every 12 Weeks Example Values: Days, Weeks, Months |
| interestRateFrequencyType |
| Used like: interestRatePerPeriod% interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance Example Values: Per month, Per year |
| amortizationType |
| Example Values: Equal principle payments, Equal installments |
| interestType |
| Used like: interestRatePerPeriod% interestRateFrequencyType - interestType e.g. 12.0000% Per year - Declining Balance Example Values: Declining Balance, Flat |
| interestCalculationPeriodType |
| Example Values: Same as repayment period, Daily |
List Loan Products
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loanproducts?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loanproducts?pretty=true&fields=name,description,interestRateFrequencyType,amortizationType
GET https://thedomainname/api/v1/loanproducts
[ {
"id" : 1,
"name" : "Agricultural Loan",
"description" : "An agricultural loan given to farmers to help buy crop, stock and machinery. With an arrears tolerance setting of 1,000 CFA, loans are not marked as 'in arrears' or 'in bad standing' if the amount outstanding is less than this. Interest rate is described using monthly percentage rate (MPR) even though the loan typically lasts a year and requires one repayment (typically at time when farmer sells crop)",
"principal" : {
"currencyCode" : "XOF",
"digitsAfterDecimal" : 0,
"amount" : 100000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "100000 CFA"
},
"inArrearsTolerance" : {
"currencyCode" : "XOF",
"digitsAfterDecimal" : 0,
"amount" : 1000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "1000 CFA"
},
"numberOfRepayments" : 1,
"repaymentEvery" : 12,
"interestRatePerPeriod" : 1.750000,
"annualInterestRate" : 21.000000,
"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"
},
"createdOn" : 1334232874000,
"lastModifedOn" : 1334232874000
}, {
"id" : 2,
"name" : "Brunei Loan",
"description" : null,
"principal" : {
"currencyCode" : "BND",
"digitsAfterDecimal" : 2,
"amount" : 76000.00,
"defaultName" : "Brunei Dollar",
"nameCode" : "currency.BND",
"displaySymbol" : "BND",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "76000.00 BND"
},
"inArrearsTolerance" : {
"currencyCode" : "BND",
"digitsAfterDecimal" : 2,
"amount" : 50.00,
"defaultName" : "Brunei Dollar",
"nameCode" : "currency.BND",
"displaySymbol" : "BND",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "50.00 BND"
},
"numberOfRepayments" : 10,
"repaymentEvery" : 1,
"interestRatePerPeriod" : 6.000000,
"annualInterestRate" : 72.000000,
"repaymentFrequencyType" : {
"id" : 1,
"code" : "repaymentFrequency.periodFrequencyType.weeks",
"value" : "Weeks"
},
"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"
},
"createdOn" : 1334513601000,
"lastModifedOn" : 1334513601000
}...]
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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loanproducts/template?pretty=trueGET https://thedomainname/api/v1/loanproducts/template
{
"principal" : {
"currencyCode" : "KES",
"digitsAfterDecimal" : 2,
"amount" : 0.00,
"defaultName" : "Kenyan Shilling",
"nameCode" : "currency.KES",
"displaySymbol" : "KSh",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0.00 KSh"
},
"inArrearsTolerance" : {
"currencyCode" : "KES",
"digitsAfterDecimal" : 2,
"amount" : 0.00,
"defaultName" : "Kenyan Shilling",
"nameCode" : "currency.KES",
"displaySymbol" : "KSh",
"zero" : true,
"greaterThanZero" : false,
"displaySymbolValue" : "0.00 KSh"
},
"interestRatePerPeriod" : 0,
"annualInterestRate" : 0,
"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"
},
"currencyOptions" : [ {
"code" : "KES",
"name" : "Kenyan Shilling",
"decimalPlaces" : 2,
"displaySymbol" : "KSh",
"nameCode" : "currency.KES",
"displayLabel" : "Kenyan Shilling (KSh)"
}, {
"code" : "BND",
"name" : "Brunei Dollar",
"decimalPlaces" : 2,
"displaySymbol" : "BND",
"nameCode" : "currency.BND",
"displayLabel" : "Brunei Dollar (BND)"
}, {
"code" : "LBP",
"name" : "Lebanese Pound",
"decimalPlaces" : 2,
"displaySymbol" : "L£",
"nameCode" : "currency.LBP",
"displayLabel" : "Lebanese Pound (L£)"
}, {
"code" : "GHC",
"name" : "Ghana Cedi",
"decimalPlaces" : 2,
"displaySymbol" : "GHC",
"nameCode" : "currency.GHC",
"displayLabel" : "Ghana Cedi (GHC)"
}, {
"code" : "USD",
"name" : "US Dollar",
"decimalPlaces" : 2,
"displaySymbol" : "$",
"nameCode" : "currency.USD",
"displayLabel" : "US Dollar ($)"
}, {
"code" : "XOF",
"name" : "CFA Franc BCEAO",
"decimalPlaces" : 0,
"displaySymbol" : "CFA",
"nameCode" : "currency.XOF",
"displayLabel" : "CFA Franc BCEAO (CFA)"
} ],
"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"
} ],
"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"
} ]
}
Retrieve a Loan Product
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loanproducts/1?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loanproducts/1?pretty=true&template=true
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loanproducts/1?pretty=true&fields=name,description,numberOfRepayments
GET https://thedomainname/api/v1/loanproducts/{productId}
{
"id" : 1,
"name" : "Agricultural Loan",
"description" : "An agricultural loan given to farmers to help buy crop, stock and machinery. With an arrears tolerance setting of 1,000 CFA, loans are not marked as 'in arrears' or 'in bad standing' if the amount outstanding is less than this. Interest rate is described using monthly percentage rate (MPR) even though the loan typically lasts a year and requires one repayment (typically at time when farmer sells crop)",
"principal" : {
"currencyCode" : "XOF",
"digitsAfterDecimal" : 0,
"amount" : 100000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "100000 CFA"
},
"inArrearsTolerance" : {
"currencyCode" : "XOF",
"digitsAfterDecimal" : 0,
"amount" : 1000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "1000 CFA"
},
"numberOfRepayments" : 1,
"repaymentEvery" : 12,
"interestRatePerPeriod" : 1.750000,
"annualInterestRate" : 21.000000,
"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"
},
"createdOn" : 1334232874000,
"lastModifedOn" : 1334232874000
}
Create a Loan Product
Mandatory Fields |
| name, currencyCode, digitsAfterDecimal, principal, inArrearsTolerance, repaymentFrequencyType, repaymentEvery, numberOfRepayments, interestRatePerPeriod, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType |
POST https://thedomainname/api/v1/loanproducts
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loanproducts
Content-Type: application/json
Request Body:
{
"name": "A new loan product for me",
"description": "A description not exceeding 500 characters.",
"currencyCode": "USD",
"digitsAfterDecimal": "2",
"locale": "en_GB",
"principal": "100,000.00",
"inArrearsTolerance": "1,000.00",
"repaymentFrequencyType": 2,
"repaymentEvery": "1",
"numberOfRepayments": "12",
"interestRatePerPeriod": "1.75",
"interestRateFrequencyType": 2,
"amortizationType": 1,
"interestType": 0,
"interestCalculationPeriodType": 1
}
{
"entityId": 9
}
Update a Loan Product
POST https://thedomainname/api/v1/loanproducts/{loanId}
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/loanproducts/1
Content-Type: application/json
Request Body:
{
"locale": "en_GB",
"principal": "100,000.00",
"inArrearsTolerance": "5,000.00"
}
{
"entityId": 1
}
Configuration
Application related configuration. For example, selecting 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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/configurations/currency?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/configurations/currency?pretty=true&fields=selectedCurrencyOptions
GET https://thedomainname/api/v1/configurations/currency
{
"selectedCurrencyOptions" : [ {
"code" : "XOF",
"name" : "CFA Franc BCEAO",
"decimalPlaces" : 0,
"displaySymbol" : "CFA",
"nameCode" : "currency.XOF",
"displayLabel" : "CFA Franc BCEAO (CFA)"
}, {
"code" : "ETB",
"name" : "Ethiopian Birr",
"decimalPlaces" : 2,
"displaySymbol" : null,
"nameCode" : "currency.ETB",
"displayLabel" : "Ethiopian Birr [ETB]"
} ],
"currencyOptions" : [ {
"code" : "AED",
"name" : "UAE Dirham",
"decimalPlaces" : 2,
"displaySymbol" : null,
"nameCode" : "currency.AED",
"displayLabel" : "UAE Dirham [AED]"
}, {
"code" : "AFN",
"name" : "Afghanistan Afghani",
"decimalPlaces" : 2,
"displaySymbol" : null,
"nameCode" : "currency.AFN",
"displayLabel" : "Afghanistan Afghani [AFN]"
}, ...
]
}
Update Currency Configuration
Updates the list of currencies permitted for use.
PUT https://thedomainname/api/v1/configurations/currency
PUT https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/configurations/currency
Content-Type: application/json
Request Body:{
"currencies": ["KES", "BND", "LBP", "GHC", "USD", "XOF", "AED", "AMD"]
}
{
"currencies": [
"KES",
"BND",
"LBP",
"GHC",
"USD",
"XOF",
"AED",
"AMD"
]
}
Additional Fields
In Mifos X, any number of "Sets" of "Additional Fields" can be configured for a Mifos X database table ("Type").
For example, portfolio_client is the database table that holds client data. Typically, MFI's want more client related fields than is provided by Mifos X out-of-the-box. The MFI might add a Set called "Additional Info" containing some fields that are typically input when creating a client. They might then add another Set called "Highly Improbable Info" containing some fields that are only input in exceptional circumstances.
The additional fields resource allows you to retrieve and update any Additional Fields data that has been configured in Mifos X.
The Mifos X Individual Lending client application uses a JQuery plugin called stretchydata which, itself, uses this additional fields resource to provide a pretty flexible additional fields User Interface (UI).
List Additional Fields Sets
Lists the Sets of additional fields have been defined in Mifos X.
Arguments
- type
- optional
- The Additional Fields Type (Mifos X database table) to restrict the output to
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/additionalfields?type=portfolio_client&pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/additionalfields?pretty=true
GET https://thedomainname/api/v1/additionalfields
[ {
"id" : 1,
"name" : "Additional Information",
"type" : "portfolio_client"
}, {
"id" : 8,
"name" : "Additional Information",
"type" : "portfolio_loan"
}, {
"id" : 9,
"name" : "Highly Improbable Info",
"type" : "portfolio_client"
} ]
Retrieve Additional Fields
Returns the Set of Additional Fields data for the ID provided. The ID is the id field of the Type table e.g. portfolio_client might have an id value of 4. The output is a JSON formatted "Generic Resultset". The Generic Resultset contains Column Heading as well as Data information. The Column Heading information may include allowed values (columnValues array).
GET https://thedomainname/api/v1/additionalfields/{type}/{set}/{id}
{
"columnHeaders" : [ {
"columnName" : "Ethnic Group",
"columnType" : "String",
"columnLength" : 50,
"columnDisplayType" : "List",
"columnValues" : [ "Bedouin", "Berber", "Italian", "Miknasa", "Mrazig", "Other", "Unknown" ]
}, {
"columnName" : "Ethnic Group Other",
"columnType" : "String",
"columnLength" : 50,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "Household Location",
"columnType" : "String",
"columnLength" : 50,
"columnDisplayType" : "List",
"columnValues" : [ "East Sikkim", "North Sikkim", "South Sikkim", "West Sikkim", "Other" ]
}, {
"columnName" : "Household Location Other",
"columnType" : "String",
"columnLength" : 50,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "Religion",
"columnType" : "String",
"columnLength" : 50,
"columnDisplayType" : "List",
"columnValues" : [ "Protestant", "Catholic", "Muslim", "Animist", "Atheist", "Other", "Unknown" ]
}, {
"columnName" : "Religion Other",
"columnType" : "String",
"columnLength" : 50,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "Knowledge of Person",
"columnType" : "String",
"columnLength" : 50,
"columnDisplayType" : "List",
"columnValues" : [ "Staff member", "Spouse of staff member", "Son/daughter of staff member", "Friend of staff member", "Not known by any staff member", "Other" ]
}, {
"columnName" : "Gender",
"columnType" : "String",
"columnLength" : 10,
"columnDisplayType" : "List",
"columnValues" : [ "Female", "Male" ]
}, {
"columnName" : "Whois",
"columnType" : "Text",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
} ],
"data" : [ {
"row" : [ "Bedouin", null, "East Sikkim", null, "Animist", "Agnostic", "Friend of staff member", "Female", "A person of honesty & clear thought" ]
} ]
}
Update Additional Fields
Updates (or creates) the Set of Additional Fields data for the ID provided. The ID is the id field of the Type table e.g. portfolio_client might have an id value of 4.
POST https://thedomainname/api/v1/additionalfields/{type}/{set}/{id}
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/additionalfields/portfolio_client/Additional Information/2
Content-Type: application/json
Request Body:
{
"Ethnic_Group":"Berber",
"Ethnic_Group_Other":"",
"Household_Location":"East Sikkim",
"Household_Location_Other":"",
"Religion":"Animist",
"Religion_Other":"jjjjjjj",
"Knowledge_of_Person":"Son/daughter of staff member",
"Gender":"Female",
"Whois":"its\r\nme of\r\ncourse\r\nyes\r\nend and the end of it all"
}
{
"entityId": 2
}
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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/reports?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/reports?pretty=true&exportCSV=true
GET https://thedomainname/api/v1/reports
{
"columnHeaders" : [ {
"columnName" : "report_id",
"columnType" : "INT",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "report_name",
"columnType" : "VARCHAR",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "report_type",
"columnType" : "VARCHAR",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "report_subtype",
"columnType" : "VARCHAR",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "report_category",
"columnType" : "VARCHAR",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "parameter_id",
"columnType" : "INT",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "report_parameter_name",
"columnType" : "VARCHAR",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "parameter_name",
"columnType" : "VARCHAR",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
} ],
"data" : [ {
"row" : [ "29", "Client Listing", "Table", null, null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "42", "Client Listing - Additional and Unlikely", "Table", null, null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "30", "Client Loans Listing", "Table", null, null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "43", "Client Loans Listing - Additional", "Table", null, null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "41", "Clients by Surname (a bit silly)", "Chart", "Pie", null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "39", "Loan Disbursals in Previous Year", "Chart", "Bar", null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "39", "Loan Disbursals in Previous Year", "Chart", "Bar", null, "7", null, "currencyIdSelectOne" ]
}, {
"row" : [ "40", "Loan Repayments in Previous Year", "Chart", "Bar", null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "40", "Loan Repayments in Previous Year", "Chart", "Bar", null, "7", null, "currencyIdSelectOne" ]
}, {
"row" : [ "34", "Loans - Active Loans Portfolio Status", "Table", null, null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "34", "Loans - Active Loans Portfolio Status", "Table", null, null, "6", null, "currencyIdSelectAll" ]
}, {
"row" : [ "31", "Loans Awaiting Disbursal", "Table", null, null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "35", "Portfolio at Risk", "Table", null, null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "35", "Portfolio at Risk", "Table", null, null, "6", null, "currencyIdSelectAll" ]
}, {
"row" : [ "32", "Upcoming Repayments", "Table", null, null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "32", "Upcoming Repayments", "Table", null, null, "6", null, "currencyIdSelectAll" ]
}, {
"row" : [ "38", "Upcoming Repayments Summary By Month, Currency and Loan Risk", "Table", null, null, "5", null, "selectOfficeId" ]
}, {
"row" : [ "38", "Upcoming Repayments Summary By Month, Currency and Loan Risk", "Table", null, null, "6", null, "currencyIdSelectAll" ]
} ]
}
Running a Report
Runs a report and returns the report output.
Note: Pentaho details yet to be provided
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.
- 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 .
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/reports/Client%20Listing?R_officeId=1&pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/reports/Client%20Listing?R_officeId=1&pretty=true&exportCSV=true
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/reports/selectOfficeId?R_officeId=1&pretty=true& parameterType=true
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/reports/selectOfficeId?R_officeId=1&pretty=true& parameterType=true&exportCSV=true
GET https://thedomainname/api/v1/reports/{reportName}
{
"columnHeaders" : [ {
"columnName" : "Office/Branch",
"columnType" : "VARCHAR",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "Name",
"columnType" : "VARCHAR",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
}, {
"columnName" : "Joining Date",
"columnType" : "DATE",
"columnLength" : null,
"columnDisplayType" : null,
"columnValues" : [ ]
} ],
"data" : [ {
"row" : [ "Demo MFI Head Office", "O'Meara, Patrick", "2009-01-04" ]
}, {
"row" : [ "Demo MFI Head Office", "O'Meara, Dennis", "2009-01-04" ]
}, {
"row" : [ "Demo MFI Head Office", "Smith, John", "2009-01-11" ]
}, {
"row" : [ "Demo MFI Head Office", "O'Meara, Jimmy", "2009-01-11" ]
}, {
"row" : [ "Demo MFI Head Office", "Sunnyville vegetable growers Ltd", "2009-01-24" ]
}, {
"row" : [ "Demo MFI Head Office", "Traoré, Kalilou", "2009-02-04" ]
}, {
"row" : [ "Demo MFI Head Office", "Koné, Sidi", "2009-02-11" ]
}, {
"row" : [ "Demo MFI Head Office", "Yattabaré, Moustapha", "2009-02-18" ]
}, {
"row" : [ "Demo MFI Head Office", "Mali fruit sales ltd.", "2009-02-18" ]
}, {
"row" : [ "Demo MFI Head Office", "Djenne co-op group", "2009-02-25" ]
}, {
"row" : [ "Demo MFI Head Office", "test, test", "2012-04-19" ]
}, {
"row" : [ "Demo MFI Head Office", "Ziffle, Fred", "2012-04-21" ]
}, {
"row" : [ "Demo MFI Head Office", "omara, safik", "2012-04-24" ]
}, {
"row" : [ "Demo MFI Head Office", "HF Test", "2012-04-24" ]
}, {
"row" : [ "Demo MFI Head Office", "HF Test 2", "2012-04-24" ]
}, {
"row" : [ "Demo MFI Head Office", "Kumar, Shiva", "2011-10-01" ]
}, {
"row" : [ "Demo MFI Head Office", "Yton, Petra", "2006-06-09" ]
}, {
"row" : [ "Demo MFI Head Office", "Yton, Petra", "2006-06-09" ]
}, {
"row" : [ "sub branch 1", "Lee, Jacques", "2012-04-03" ]
}, {
"row" : [ "sub branch 1", "Asare-Frimpong, Patrick", "2012-04-18" ]
}, {
"row" : [ "sub branch 2", "t, test", "2012-04-18" ]
}, {
"row" : [ "Majmoua", "client, firstMajmoua", "2011-12-01" ]
}, {
"row" : [ "Intrasoft Technologies", "Said, Zayyad", "2012-04-02" ]
}, {
"row" : [ "Hugo technologies", "typical individual lending client", "2010-06-02" ]
} ]
}
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 of permissions allowed.
POST https://thedomainname/api/v1/authentication?username={username}&password={password}
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/authentication?username=super1&password=demo
Content-Type: application/json
No Request Body
{
"username": "super1",
"userId": 2,
"base64EncodedAuthenticationKey": "c3VwZXIxOmRlbW8=",
"authenticated": true,
"permissions": [
"USER_ADMINISTRATION_SUPER_USER_ROLE",
"REPORTING_SUPER_USER_ROLE",
"PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE",
"ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE"
]
}
Users
An API capability to support user administration.
Retrieve list of users
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/users?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/users?pretty=true&fields=id,username,email,officeName
GET https://thedomainname/api/v1/users
[ {
"id" : 6,
"officeId" : 1,
"officeName" : "change super user",
"username" : "committee1",
"firstname" : "Committee",
"lastname" : "Member",
"email" : "fake@email.com"
}, {
"id" : 5,
"officeId" : 1,
"officeName" : "change super user",
"username" : "dataentry1",
"firstname" : "Data Entry",
"lastname" : "User",
"email" : "fake@email.com"
}...]
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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/users/template?pretty=trueGET https://thedomainname/api/v1/users/template
{
"allowedOffices" : [ {
"id" : 1,
"name" : "Demo MFI Head Office"
}, {
"id" : 2,
"name" : "sub branch 1"
}, {
"id" : 8,
"name" : "moi aussi"
}, {
"id" : 3,
"name" : "sub branch 2"
}, {
"id" : 4,
"name" : "sub branch 3"
}],
"availableRoles" : [ {
"id" : 1,
"name" : "Super user",
"description" : "This role provides all application permissions.",
"availablePermissions" : [ ],
"selectedPermissions" : [ ]
}, {
"id" : 2,
"name" : "Field officer",
"description" : "A field officer role allows the user to add client and loans and view reports but nothing else.",
"availablePermissions" : [ ],
"selectedPermissions" : [ ]
}, {
"id" : 3,
"name" : "Data Entry (Portfolio only)",
"description" : "This role allows a user full permissions around client and loan functionality but nothing else.",
"availablePermissions" : [ ],
"selectedPermissions" : [ ]
}, {
"id" : 4,
"name" : "Credit Committe Member",
"description" : "This role allows a user to approve reject or withdraw loans (with reporting).",
"availablePermissions" : [ ],
"selectedPermissions" : [ ]
}, {
"id" : 5,
"name" : "Manager",
"description" : "This role allows a manager to do anything related to portfolio management and also view all reports.",
"availablePermissions" : [ ],
"selectedPermissions" : [ ]
} ]
}
Retrieve a User
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/users/1?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/users/1?pretty=true&template=true
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/users/1?pretty=true&fields=username,officeName
GET https://thedomainname/api/v1/users/1
{
"id" : 1,
"officeId" : 1,
"officeName" : "Demo MFI Head Office",
"username" : "mifos",
"firstname" : "App",
"lastname" : "Administrator",
"email" : "demomfi@mifos.org",
"selectedRoles" : [ {
"id" : 1,
"name" : "Super user",
"description" : "This role provides all application permissions.",
"availablePermissions" : [ ],
"selectedPermissions" : [ {
"id" : 1,
"name" : "User administration ALL",
"description" : "An application user will have permission to execute all tasks related to user administration.",
"code" : "USER_ADMINISTRATION_SUPER_USER_ROLE"
}, {
"id" : 4,
"name" : "Reporting ALL",
"description" : "An application user will have permission to execute and view all reports.",
"code" : "REPORTING_SUPER_USER_ROLE"
}, {
"id" : 3,
"name" : "Portfolio management ALL",
"description" : "An application user will have permission to execute all tasks related to portfolio management.",
"code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE"
}, {
"id" : 2,
"name" : "Organisation adminsitration ALL",
"description" : "An application user will have permission to execute all tasks related to organisation administration.",
"code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE"
} ]
} ]
}
Create a User
Adds new application user.
Note: Password information is not required (or processed). Password details 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://thedomainname/api/v1/users
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/users
Content-Type: application/json
Request body:
{
"username": "Another New User zll",
"firstname": "Test",
"lastname": "User",
"email": "whatever@mifos.org",
"officeId": 1,
"roles": [2,3]
}
{
"entityId": 11
}
Update a User
Note: When updating a password you must provide the repeatPassword parameter also.
PUT https://thedomainname/api/v1/users/{userId)
PUT https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/users/3
Content-Type: application/json
Request body:
{
"firstname": "Test",
"roles": [2],
"password": "window75",
"repeatPassword": "window75"
}
{
"entityId": 3
}
Delete a User
Removes the user and the associated roles and permissions.
DELETE https://thedomainname/api/v1/users/{userId}
DELETE https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/users/20
Content-Type: application/json
No Request Body
{
"entityId": 20
}
Roles
An API capability to support management of application roles for user administration.
List Roles
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/roles?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/roles?pretty=true&fields=name
GET https://thedomainname/api/v1/roles
[ {
"id" : 1,
"name" : "Super user",
"description" : "This role provides all application permissions."
}, {
"id" : 2,
"name" : "Field officer",
"description" : "A field officer role allows the user to add client and loans and view reports but nothing else."
}, {
"id" : 3,
"name" : "Data Entry (Portfolio only)",
"description" : "This role allows a user full permissions around client and loan functionality but nothing else."
}, {
"id" : 4,
"name" : "Credit Committe Member",
"description" : "This role allows a user to approve reject or withdraw loans (with reporting)."
}, {
"id" : 5,
"name" : "Manager",
"description" : "This role allows a manager to do anything related to portfolio management and also view all reports."
} ]
Retrieve Role 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:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/roles/template?pretty=trueGET https://thedomainname/api/v1/roles/template
{
"availablePermissions" : [ {
"id" : 1,
"name" : "User administration ALL",
"description" : "An application user will have permission to execute all tasks related to user administration.",
"code" : "USER_ADMINISTRATION_SUPER_USER_ROLE"
}, {
"id" : 2,
"name" : "Organisation adminsitration ALL",
"description" : "An application user will have permission to execute all tasks related to organisation administration.",
"code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE"
}, {
"id" : 3,
"name" : "Portfolio management ALL",
"description" : "An application user will have permission to execute all tasks related to portfolio management.",
"code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE"
}, {
"id" : 4,
"name" : "Reporting ALL",
"description" : "An application user will have permission to execute and view all reports.",
"code" : "REPORTING_SUPER_USER_ROLE"
}...]
}
Retrieve a Role
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/roles/1?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/roles/1?pretty=true&template=true
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/roles/1?pretty=true&fields=name,selectedPermissions
GET https://thedomainname/api/v1/roles/{roleId}
{
"id" : 1,
"name" : "Super user",
"description" : "This role provides all application permissions.",
"selectedPermissions" : [ {
"id" : 1,
"name" : "User administration ALL",
"description" : "An application user will have permission to execute all tasks related to user administration.",
"code" : "USER_ADMINISTRATION_SUPER_USER_ROLE"
}, {
"id" : 4,
"name" : "Reporting ALL",
"description" : "An application user will have permission to execute and view all reports.",
"code" : "REPORTING_SUPER_USER_ROLE"
}, {
"id" : 3,
"name" : "Portfolio management ALL",
"description" : "An application user will have permission to execute all tasks related to portfolio management.",
"code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE"
}, {
"id" : 2,
"name" : "Organisation adminsitration ALL",
"description" : "An application user will have permission to execute all tasks related to organisation administration.",
"code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE"
} ]
}
Create a New Role
Mandatory Fields |
| name, description, permissions |
POST https://thedomainname/api/v1/roles
POST https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/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.",
"permissions": [1, 2, 3]
}
{
"entityId": 8
}
Update a Role
PUT https://thedomainname/api/v1/roles/{roleId}
PUT https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/roles/8
Content-Type: application/json
Request body:
{
"name": "Updated Role Name",
"permissions": [1]
}
{
"entityId": 8
}
Permissions
An API capability to support management of application permissions for user administration.
List Application Permissions
Example Requests:
https://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/permissions?pretty=truehttps://ec2-176-34-174-133.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/permissions?pretty=true&fields=id,code
GET https://thedomainname/api/v1/permissions
[ {
"id" : 1,
"name" : "User administration ALL",
"description" : "An application user will have permission to execute all tasks related to user administration.",
"code" : "USER_ADMINISTRATION_SUPER_USER_ROLE"
}, {
"id" : 2,
"name" : "Organisation adminsitration ALL",
"description" : "An application user will have permission to execute all tasks related to organisation administration.",
"code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE"
}, {
"id" : 3,
"name" : "Portfolio management ALL",
"description" : "An application user will have permission to execute all tasks related to portfolio management.",
"code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE"
}, {
"id" : 4,
"name" : "Reporting ALL",
"description" : "An application user will have permission to execute and view all reports.",
"code" : "REPORTING_SUPER_USER_ROLE"
}, ... ]