Skip to main content

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​

ParameterTypeRequiredDescription
branchIdlongNoFilter by branch (omit for all branches)
pageintNoPage number (default: 1)
pageSizeintNoRecords 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​

  1. Daily Processing: Run clearing batch daily at scheduled time
  2. Monitor Aged: Flag cheques pending > 5 days
  3. Reconciliation: Match with clearing house reports
  4. Exception Handling: Manual review for problematic cheques
  5. Audit Trail: Maintain logs of all clearing activities

For Reporting​

  1. Daily Reports: Generate summary of pending cheques
  2. Branch Analysis: Track pending by branch
  3. Trend Analysis: Monitor clearing patterns over time
  4. Exception Reports: Highlight aged or high-value items
  5. Compliance: Regular reporting to regulators