Get All Cheque Clearing Requests
Query all pending cheque clearing requests system-wide.
Command: GetAllChequeClearingRequestsQuery
Type: Query
Implementation: CB.Administration.Api/Commands/BPMCore/Tellering/AdministrationCoreTelleringChequeCommandHandlers.cs
Overviewβ
Retrieves all pending cheque clearing requests across all accounts. Used by operations teams to monitor and process batch clearing.
Requestβ
POST /api/bpm/cmd
{
"commandName": "GetAllChequeClearingRequestsQuery",
"data": {
"branchId": 5,
"page": 1,
"pageSize": 50
}
}
Parametersβ
| Parameter | Type | Required | Description |
|---|---|---|---|
| branchId | long | No | Filter by branch (omit for all branches) |
| page | int | No | Page number (default: 1) |
| pageSize | int | No | Records per page (default: 50) |
Response (200 OK)β
{
"commandName": "GetAllChequeClearingRequestsQuery",
"status": "Success",
"data": {
"page": 1,
"pageSize": 50,
"totalRecords": 150,
"totalPages": 3,
"clearingRequests": [
{
"chequeClearingId": "550e8400-e29b-41d4-a716-446655440000",
"accountNumber": "1001234567",
"clientName": "John Doe",
"branchName": "Main Branch",
"chequeNo": "CH123456",
"amount": 50000.00,
"currencyCode": "NGN",
"transactionType": "DEPOSIT",
"state": "PENDING",
"transactionDate": "2025-12-29T14:30:00Z",
"daysPending": 2,
"remarks": "Customer cheque deposit"
},
{
"chequeClearingId": "660e8400-e29b-41d4-a716-446655440000",
"accountNumber": "1001234568",
"clientName": "Jane Smith",
"branchName": "Main Branch",
"chequeNo": "CH789012",
"amount": 75000.00,
"currencyCode": "NGN",
"transactionType": "WITHDRAWAL",
"state": "PENDING",
"transactionDate": "2025-12-30T10:15:00Z",
"daysPending": 1,
"payeeName": "ABC Suppliers Ltd",
"remarks": "Payment to supplier"
}
]
}
}
Use Casesβ
- Batch Clearing: Process daily clearing from NIBSS/clearing house
- Operations Monitoring: Track all pending cheques
- Exception Handling: Identify aged or problematic cheques
- Branch Reports: Generate branch-specific clearing reports
- Reconciliation: Match with clearing house reports
- Audit: Review all uncleared transactions
Examplesβ
Example 1: Get All Pending (All Branches)β
{
"commandName": "GetAllChequeClearingRequestsQuery",
"data": {
"page": 1,
"pageSize": 100
}
}
Example 2: Get Pending for Specific Branchβ
{
"commandName": "GetAllChequeClearingRequestsQuery",
"data": {
"branchId": 5,
"page": 1,
"pageSize": 50
}
}
Example 3: Large Page for Batch Processingβ
{
"commandName": "GetAllChequeClearingRequestsQuery",
"data": {
"pageSize": 500
}
}
Integrationβ
TypeScriptβ
interface ClearingRequest {
chequeClearingId: string;
accountNumber: string;
clientName: string;
branchName: string;
chequeNo: string;
amount: number;
currencyCode: string;
transactionType: 'DEPOSIT' | 'WITHDRAWAL';
state: string;
transactionDate: string;
daysPending: number;
payeeName?: string;
remarks: string;
}
async function getAllClearingRequests(branchId?: number, page: number = 1): Promise<ClearingRequest[]> {
const response = await fetch('https://api.banklingo.com/api/bpm/cmd', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${getAuthToken()}`
},
body: JSON.stringify({
commandName: 'GetAllChequeClearingRequestsQuery',
data: { branchId, page, pageSize: 100 }
})
});
const result = await response.json();
return result.data.clearingRequests;
}
// Daily clearing batch processing
async function processDailyClearing() {
console.log('Γ°ΕΈββ Starting daily clearing batch...\n');
// Get all pending cheques
const requests = await getAllClearingRequests();
console.log(`Found ${requests.length} pending cheques\n`);
// Group by type
const deposits = requests.filter(r => r.transactionType === 'DEPOSIT');
const withdrawals = requests.filter(r => r.transactionType === 'WITHDRAWAL');
console.log(`Γ°ΕΈβΒ₯ Deposits: ${deposits.length} (${deposits.reduce((sum, d) => sum + d.amount, 0).toLocaleString()})`);
console.log(`Γ°ΕΈβΒ€ Withdrawals: ${withdrawals.length} (${withdrawals.reduce((sum, w) => sum + w.amount, 0).toLocaleString()})\n`);
// Get clearing confirmations from NIBSS/clearing house
const clearingConfirmations = await getClearingConfirmationsFromNIBSS();
// Process clearings
for (const request of requests) {
const confirmation = clearingConfirmations.find(c => c.chequeNo === request.chequeNo);
if (confirmation && confirmation.status === 'CLEARED') {
try {
await clearCheque(request.chequeClearingId, confirmation.reference);
console.log(`Γ’Εβ¦ Cleared: ${request.chequeNo} - ${request.amount.toLocaleString()}`);
} catch (error) {
console.error(`Γ’ΒΕ Failed to clear ${request.chequeNo}: ${error.message}`);
}
} else if (confirmation && confirmation.status === 'RETURNED') {
try {
await bounceCheque(request.chequeClearingId, confirmation.returnReason, confirmation.reference);
console.log(`Γ°ΕΈββ Bounced: ${request.chequeNo} - ${confirmation.returnReason}`);
} catch (error) {
console.error(`Γ’ΒΕ Failed to bounce ${request.chequeNo}: ${error.message}`);
}
}
}
console.log('\nΓ’Εβ¦ Daily clearing batch complete');
}
// Generate clearing report
async function generateClearingReport(branchId?: number) {
const requests = await getAllClearingRequests(branchId);
const report = {
totalPending: requests.length,
totalAmount: requests.reduce((sum, r) => sum + r.amount, 0),
byType: {
deposits: requests.filter(r => r.transactionType === 'DEPOSIT').length,
withdrawals: requests.filter(r => r.transactionType === 'WITHDRAWAL').length
},
byAge: {
sameDay: requests.filter(r => r.daysPending === 0).length,
oneDayOld: requests.filter(r => r.daysPending === 1).length,
twoDaysOld: requests.filter(r => r.daysPending === 2).length,
aged: requests.filter(r => r.daysPending > 3).length
},
agedCheques: requests.filter(r => r.daysPending > 5)
};
return report;
}
C#β
Code Removed
Implementation details removed for security.
Contact support for implementation guidance.
Best Practicesβ
For Operations Teamsβ
- Daily Processing: Run clearing batch daily at scheduled time
- Monitor Aged: Flag cheques pending > 5 days
- Reconciliation: Match with clearing house reports
- Exception Handling: Manual review for problematic cheques
- Audit Trail: Maintain logs of all clearing activities
For Reportingβ
- Daily Reports: Generate summary of pending cheques
- Branch Analysis: Track pending by branch
- Trend Analysis: Monitor clearing patterns over time
- Exception Reports: Highlight aged or high-value items
- Compliance: Regular reporting to regulators
Related Commandsβ
GetUnclearedChequeQuery- Account-specific pending chequesInitiateClearChequeCommand- Clear pending chequesInitiateBounceChequeCommand- Bounce returned chequesInitiateChequeDepositCommand- Creates clearing requestsInitiateChequeWithdrawalCommand- Creates clearing requests