diff --git a/APIFolder/api.htm b/APIFolder/api.htm index e485f017f..6664ad4c7 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -17,7 +17,7 @@
@@ -25,15 +25,15 @@- Much of the presentation ideas here have been taken from the very good API reference (https://stripe.com/docs/api) -
The Mifox X API is organized around REST. @@ -175,8 +169,10 @@ is there a retrieve waive and an Adjust Waiver as well? HTTP verbs, which can be understood by off-the-shelf HTTP clients. JSON will be returned in all responses from the API, including errors. -
- + ++ Much of the presentation ideas here have been taken from the very good API reference (https://stripe.com/docs/api) +
https://thedomainname/
curl https://api.stripe.com/v1/charges \
+ curl https://api.stripe.com/api/v1/charges \
-u vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE:
@@ -277,12 +270,9 @@ is there a retrieve waive and an Adjust Waiver as well?
credentials (adding a colon after your API key will prevent
it from asking you for a password).
-
-
A sample test API key has been provided in all
the examples on the page, so you can test out any example right away.
-
A Loan product is a template that is used when creating a loan. Much of the template definition can be changed during loan creation. +
+Example Request: + http://localhost:8080/mifosng-provider/api/v1/loanproducts +
+ +GET https://thedomainname/api/v1/loanproducts
+ {
+ "products": [
+ {
+ "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)",
+ "principalMoney": {
+ "currencyCode": "XOF",
+ "currencyDigitsAfterDecimal": 0,
+ "amount": 100000,
+ "defaultName": "CFA Franc BCEAO",
+ "nameCode": "currency.XOF",
+ "displaySymbol": "CFA",
+ "zero": false,
+ "greaterThanZero": true,
+ "displaySymbolValue": "100000 CFA"
+ },
+ "interestRatePerPeriod": 1.75,
+ "interestRatePeriod": 2,
+ "annualInterestRate": 21,
+ "interestMethod": 0,
+ "interestRateCalculatedInPeriod": 0,
+ "numberOfInterestFreePeriods": 0,
+ "repaidEvery": 12,
+ "repaymentPeriodFrequency": 2,
+ "numberOfRepayments": 1,
+ "amortizationMethod": 1,
+ "inArrearsTolerance": {
+ "currencyCode": "XOF",
+ "currencyDigitsAfterDecimal": 0,
+ "amount": 1000,
+ "defaultName": "CFA Franc BCEAO",
+ "nameCode": "currency.XOF",
+ "displaySymbol": "CFA",
+ "zero": false,
+ "greaterThanZero": true,
+ "displaySymbolValue": "1000 CFA"
+ },
+ "createdOn": "2012-04-12T00:00:00.000+10:00",
+ "lastModifedOn": "2012-04-12T00:00:00.000+10:00",
+ "possibleCurrencies": [],
+ "possibleAmortizationOptions": [],
+ "possibleInterestOptions": [],
+ "possibleInterestRateCalculatedInPeriodOptions": [],
+ "repaymentFrequencyOptions": [],
+ "interestFrequencyOptions": [],
+ "interestRebateAllowed": false,
+ "flexible": false
+ },
+ {
+ "id": 2,
+ "name": "curr loan",
+ "description": "asdff",
+ "principalMoney": {
+ "currencyCode": "ETB",
+ "currencyDigitsAfterDecimal": 2,
+ "amount": 100000,
+ "defaultName": "Ethiopian Birr",
+ "nameCode": "currency.ETB",
+ "displaySymbol": null,
+ "zero": false,
+ "greaterThanZero": true,
+ "displaySymbolValue": "100000.00 null"
+ },
+ "interestRatePerPeriod": 0,
+ "interestRatePeriod": 2,
+ "annualInterestRate": 0,
+ "interestMethod": 0,
+ "interestRateCalculatedInPeriod": 0,
+ "numberOfInterestFreePeriods": 0,
+ "repaidEvery": 1,
+ "repaymentPeriodFrequency": 2,
+ "numberOfRepayments": 5,
+ "amortizationMethod": 1,
+ "inArrearsTolerance": {
+ "currencyCode": "ETB",
+ "currencyDigitsAfterDecimal": 2,
+ "amount": 0,
+ "defaultName": "Ethiopian Birr",
+ "nameCode": "currency.ETB",
+ "displaySymbol": null,
+ "zero": true,
+ "greaterThanZero": false,
+ "displaySymbolValue": "0.00 null"
+ },
+ "createdOn": "2012-04-15T00:00:00.000+10:00",
+ "lastModifedOn": "2012-04-15T00:00:00.000+10:00",
+ "possibleCurrencies": [],
+ "possibleAmortizationOptions": [],
+ "possibleInterestOptions": [],
+ "possibleInterestRateCalculatedInPeriodOptions": [],
+ "repaymentFrequencyOptions": [],
+ "interestFrequencyOptions": [],
+ "interestRebateAllowed": false,
+ "flexible": false
+ }
+ ]
+ }
+
+ Returns a template that contains the loan product fields and allowed value lists. This helps build a maintenance User Interface. +
+Example Request: + http://localhost:8080/mifosng-provider/api/v1/loanproducts/template +
+ +GET https://thedomainname/api/v1/loanproducts/template
+ {
+ "id": null,
+ "name": null,
+ "description": null,
+ "principalMoney": {
+ "currencyCode": "XOF",
+ "currencyDigitsAfterDecimal": 0,
+ "amount": 0,
+ "defaultName": "CFA Franc BCEAO",
+ "nameCode": "currency.XOF",
+ "displaySymbol": "CFA",
+ "zero": true,
+ "greaterThanZero": false,
+ "displaySymbolValue": "0 CFA"
+ },
+ "interestRatePerPeriod": 0,
+ "interestRatePeriod": 2,
+ "annualInterestRate": 0,
+ "interestMethod": 0,
+ "interestRateCalculatedInPeriod": 1,
+ "numberOfInterestFreePeriods": 0,
+ "repaidEvery": 1,
+ "repaymentPeriodFrequency": 2,
+ "numberOfRepayments": 0,
+ "amortizationMethod": 1,
+ "inArrearsTolerance": {
+ "currencyCode": "XOF",
+ "currencyDigitsAfterDecimal": 0,
+ "amount": 0,
+ "defaultName": "CFA Franc BCEAO",
+ "nameCode": "currency.XOF",
+ "displaySymbol": "CFA",
+ "zero": true,
+ "greaterThanZero": false,
+ "displaySymbolValue": "0 CFA"
+ },
+ "createdOn": null,
+ "lastModifedOn": null,
+ "possibleCurrencies": [
+ {
+ "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]"
+ }
+ ],
+ "possibleAmortizationOptions": [
+ {
+ "id": 1,
+ "value": "Equal installments"
+ },
+ {
+ "id": 0,
+ "value": "Equal principle payments"
+ }
+ ],
+ "possibleInterestOptions": [
+ {
+ "id": 0,
+ "value": "Declining Balance"
+ },
+ {
+ "id": 1,
+ "value": "Flat"
+ }
+ ],
+ "possibleInterestRateCalculatedInPeriodOptions": [
+ {
+ "id": 0,
+ "value": "Daily"
+ },
+ {
+ "id": 1,
+ "value": "Same as repayment period"
+ }
+ ],
+ "repaymentFrequencyOptions": [
+ {
+ "id": 0,
+ "value": "Days"
+ },
+ {
+ "id": 1,
+ "value": "Weeks"
+ },
+ {
+ "id": 2,
+ "value": "Months"
+ }
+ ],
+ "interestFrequencyOptions": [
+ {
+ "id": 2,
+ "value": "Per month"
+ },
+ {
+ "id": 3,
+ "value": "Per year"
+ }
+ ],
+ "interestRebateAllowed": false,
+ "flexible": false
+ }
+
+ Returns loan product fields. It also returns allowed value lists which help build a maintenance User Interface. +JPW - includes validation values (might be ok or option), enum? +
+Example Request: + http://localhost:8080/mifosng-provider/api/v1/loanproducts/1 +
+ +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)",
+ "principalMoney": {
+ "currencyCode": "XOF",
+ "currencyDigitsAfterDecimal": 0,
+ "amount": 100000,
+ "defaultName": "CFA Franc BCEAO",
+ "nameCode": "currency.XOF",
+ "displaySymbol": "CFA",
+ "zero": false,
+ "greaterThanZero": true,
+ "displaySymbolValue": "100000 CFA"
+ },
+ "interestRatePerPeriod": 1.75,
+ "interestRatePeriod": 2,
+ "annualInterestRate": 21,
+ "interestMethod": 0,
+ "interestRateCalculatedInPeriod": 0,
+ "numberOfInterestFreePeriods": 0,
+ "repaidEvery": 12,
+ "repaymentPeriodFrequency": 2,
+ "numberOfRepayments": 1,
+ "amortizationMethod": 1,
+ "inArrearsTolerance": {
+ "currencyCode": "XOF",
+ "currencyDigitsAfterDecimal": 0,
+ "amount": 1000,
+ "defaultName": "CFA Franc BCEAO",
+ "nameCode": "currency.XOF",
+ "displaySymbol": "CFA",
+ "zero": false,
+ "greaterThanZero": true,
+ "displaySymbolValue": "1000 CFA"
+ },
+ "createdOn": "2012-04-12T00:00:00.000+10:00",
+ "lastModifedOn": "2012-04-12T00:00:00.000+10:00",
+ "possibleCurrencies": [
+ {
+ "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]"
+ }
+ ],
+ "possibleAmortizationOptions": [
+ {
+ "id": 1,
+ "value": "Equal installments"
+ },
+ {
+ "id": 0,
+ "value": "Equal principle payments"
+ }
+ ],
+ "possibleInterestOptions": [
+ {
+ "id": 0,
+ "value": "Declining Balance"
+ },
+ {
+ "id": 1,
+ "value": "Flat"
+ }
+ ],
+ "possibleInterestRateCalculatedInPeriodOptions": [
+ {
+ "id": 0,
+ "value": "Daily"
+ },
+ {
+ "id": 1,
+ "value": "Same as repayment period"
+ }
+ ],
+ "repaymentFrequencyOptions": [
+ {
+ "id": 0,
+ "value": "Days"
+ },
+ {
+ "id": 1,
+ "value": "Weeks"
+ },
+ {
+ "id": 2,
+ "value": "Months"
+ }
+ ],
+ "interestFrequencyOptions": [
+ {
+ "id": 2,
+ "value": "Per month"
+ },
+ {
+ "id": 3,
+ "value": "Per year"
+ }
+ ],
+ "interestRebateAllowed": false,
+ "flexible": false
+ }
+
+ POST https://thedomainname/api/v1/loanproducts
+ http://localhost:8080/mifosng-provider/api/v1/loanproducts
+
+
+Content-Type: application/json
+Request Body:
+new loan product json here
+
+
+ POST https://thedomainname/api/v1/loanproducts/{loanId}
+ http://localhost:8080/mifosng-provider/api/v1/loanproducts/1
+
+
+Content-Type: application/json
+Request Body:
+update loan product json here
+
+
+ GET https://thedomainname/v1/additionalfields
+ GET https://thedomainname/api/v1/additionalfields
{
"additionalFieldsSets": [
{
@@ -493,15 +979,13 @@ The Mifos X Individual Lending client application uses a JQuery plugin called st
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).
-Example Request: http://localhost:8080/mifosng-provider/api/v1/additionalfields/portfolio_client/Additional Information/2 @@ -510,7 +994,7 @@ Returns the Set of Additional Fields data for the ID provided. The ID is the id
GET https://thedomainname/v1/additionalfields/{type}/{set}/{id}
+ GET https://thedomainname/api/v1/additionalfields/{type}/{set}/{id}
{
"columnHeaders": [
{
@@ -631,20 +1115,18 @@ Returns the Set of Additional Fields data for the ID provided. The ID is the id
-
+
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.
- Arguments
- None
- POST https://thedomainname/v1/additionalfields/{type}/{set}/{id}
+ POST https://thedomainname/api/v1/additionalfields/{type}/{set}/{id}
http://localhost:8080/mifosng-provider/api/v1/additionalfields/portfolio_client/Additional Information/2
@@ -698,7 +1180,7 @@ The Mifos X Individual Lending client application uses a JQuery plugin called st
-
+
List Reports
@@ -719,7 +1201,7 @@ The Mifos X Individual Lending client application uses a JQuery plugin called st
- GET https://thedomainname/v1/reports
+ GET https://thedomainname/api/v1/reports
{
"columnHeaders": [
{
@@ -790,7 +1272,7 @@ The Mifos X Individual Lending client application uses a JQuery plugin called st
-
+
Running a Report
@@ -818,7 +1300,7 @@ The Mifos X Individual Lending client application uses a JQuery plugin called st
- GET https://thedomainname/v1/reports/{reportName}
+ GET https://thedomainname/api/v1/reports/{reportName}
{
"columnHeaders": [
{