Welcome to the ForesightFin Member Reports API documentation. This API provides endpoints for retrieving member-related financial data, including active loans, investments, loan repayment summaries, member profiles, and overall account summaries. Below you will find comprehensive information to help you integrate and utilize these endpoints effectively.
All API endpoints are accessible under the following base URL:
Note: The provided code snippets do not include authentication mechanisms. It is recommended to implement secure authentication (e.g., OAuth 2.0, API keys) to protect your endpoints.
Retrieve a list of active loan IDs for a specific member and station.
/active-loans
GET
memberNumber
(string, required): The unique identifier for the member.stationId
(string, required): The identifier for the station.200 OK
[
12345,
67890,
23456
]
500 Internal Server Error
Retrieve a list of investments for a specific member, station, and investment code.
URL: /investments
Method: GET
URL Params:
memberNumber
(string, required): The unique identifier for the member.stationId
(string, required): The identifier for the station.investmentCode
(integer, required): The code representing the type of investment. Must be one of the following:
Enum Value | Code |
---|---|
DEPOSITS | 96 |
SIGHT_DEPOSITS | 92 |
SAVINGS | 98 |
SHARES | 97 |
ADDITIONAL_SHARES | 95 |
Success Response:
200 OK
[
{
"receiptDate": "2023-01-15",
"debit": 1000.0,
"credit": 500.0,
"runningBalance": 500.0
},
{
"receiptDate": "2023-02-15",
"debit": 1000.0,
"credit": 600.0,
"runningBalance": 900.0
}
]
Retrieve detailed information about a specific loan repayment summary for a member at a station.
/loan-repayment-summary
GET
memberNumber
(string, required): The unique identifier for the member.stationId
(string, required): The identifier for the station.loanId
(integer, required): The unique identifier for the loan.200 OK
[
{
"loanId": 101,
"loanDescription": "Personal Loan",
"receiptDate": "2023-01-15",
"transIndicator": "P",
"disbursedAmount": 5000.0,
"requestedAmount": 4500.0,
"paidAmount": 500.0,
"principalPaid": 300.0,
"interestPaid": 200.0,
"principalAmount": 4500.0,
"cumulativePrincipalPaid": 300.0,
"cumulativeInterestPaid": 200.0,
"outstandingPrincipal": 4200.0,
"outstandingInterest": 1800.0,
"interestAmount": 500.0
}
]
Retrieve the profile information of a member based on their phone number.
/member-profile
GET
phoneNumber
(string, required): The phone number of the member in E.164 format (e.g., +255657822049
).200 OK
{
"surname": "Doe",
"otherName": "John",
"memberNo": "MEM123",
"stationId": "STN456",
"saccoName": "Foresight SACCO"
}
Retrieve an account summary for a member that includes balances for savings, shares, deposits, and outstanding loans.
URL: /account-summary
Method: GET
URL Params:
memberNumber
(string, required): The unique identifier for the member.stationId
(string, required): The identifier for the station.Success Response:
200 OK
{
"savingsBalance": 400000,
"sharesBalance": 50000,
"depositsBalance": 0,
"outstandingLoans": [
{
"loanId": 23523,
"loanDescription": "MKOPO-VIFAA",
"outstandingPrincipal": 1075000,
"outstandingInterest": 0
}
]
}
Error Responses:
404 Not Found
500 Internal Server Error
Example Request:
GET https://api.foresightfin.app/account-summary?memberNumber=MEM123&stationId=STN456
The API uses standard HTTP status codes to indicate the success or failure of an API request:
Note: The API currently does not provide detailed error messages in the response body. It is recommended to enhance error responses with meaningful messages for better debugging and user experience.
For testing purposes, you can use the following phone numbers to retrieve member profiles:
+255657822049
+255762415356
Ensure that these phone numbers exist in the database to receive successful responses.
For any questions or support related to the ForesightFin Member Reports API, please contact the developer.
Thank you for using the ForesightFin Member Reports API!