Retrieve Loan Transaction List
Overview
Retrieves the transaction history for a specific loan account including repayments, disbursements, and adjustments.
Endpoint
POST /api/bpm/cmd
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication |
| Content-Type | string | Yes | Must be application/json |
| X-Tenant-Id | string | Yes | Tenant identifier |
Request Body
{
"cmd": "RetrieveLoanTransactionListQuery",
"data": {
"pageNumber": 1,
"pageSize": 20,
"searchText": "Repayment",
"id": 12345,
"status": [1, 2],
"startDate": "2024-01-01",
"endDate": "2024-12-31",
"isExport": false
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| cmd | string | Yes | Must be "RetrieveLoanTransactionListQuery" |
| data | object | Yes | Query filter data |
| ↳ pageNumber | integer | No | Page number (default: 1) |
| ↳ pageSize | integer | No | Items per page (default: 10, max: 100) |
| ↳ searchText | string | No | Search text for transaction details |
| ↳ id | integer | No | Filter by specific transaction ID |
| ↳ status | array[integer] | No | Filter by transaction status (array of state enums) |
| ↳ startDate | string | No | Start date for filtering (ISO 8601 date string) |
| ↳ endDate | string | No | End date for filtering (ISO 8601 date string) |
| ↳ isExport | boolean | No | Set to true for export format (default: false) |
Response
Success Response (200 OK)
{
"success": true,
"message": "Loan transactions retrieved successfully",
"data": {
"loanId": "LA-2024-00001",
"transactions": [
{
"transactionId": "TXN-2024-00123",
"transactionType": "Repayment",
"transactionDate": "2024-02-15T10:30:00Z",
"principalAmount": 1800.00,
"interestAmount": 568.75,
"totalAmount": 2368.75,
"balanceBefore": 50000.00,
"balanceAfter": 48200.00,
"paymentMethod": "AutomaticDebit",
"referenceNumber": "REF-20240215-001",
"notes": "Monthly installment",
"createdBy": "system@bank.com"
}
],
"pagination": {
"currentPage": 1,
"pageSize": 20,
"totalPages": 3,
"totalRecords": 45
}
}
}
Status Codes
| Code | Description |
|---|---|
| 200 | Transactions retrieved successfully |
| 400 | Invalid query parameters |
| 401 | Unauthorized - Invalid or missing token |
| 404 | Loan not found |
| 500 | Internal server error |
Code Examples
C# Example
public async Task<LoanTransactionList> GetLoanTransactionsAsync(object queryData)
{
var commandRequest = new
{
cmd = "RetrieveLoanTransactionListQuery",
data = queryData
};
var json = JsonSerializer.Serialize(commandRequest);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync("/api/bpm/cmd", content);
response.EnsureSuccessStatusCode();
var responseJson = await response.Content.ReadAsStringAsync();
return JsonSerializer.Deserialize<LoanTransactionList>(json);
}
TypeScript Example
async function getLoanTransactions(loanId: string, page: number = 1): Promise<LoanTransactionList> {
const params = new URLSearchParams({
page: page.toString(),
pageSize: '20'
});
const response = await fetch(`/api/administration/loan/${loanId}/transactions?${params}`, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'X-Tenant-Id': tenantId
}
});
return await response.json();
}
Notes
- Transactions ordered by date (most recent first)
- Includes disbursement, repayments, and any adjustments
- Balance fields show loan position before and after transaction
- Use pagination for loans with many transactions