Skip to main content

Set Collection Details

Overview​

SetCollectionDetailsCommand configures the direct debit collection settings for an approved loan and auto-generates the full repayment schedule. It can be called multiple times — each call replaces the previous schedule entirely.

Prerequisites: The loan must exist and its associated product must have interest rate and tenor configured. Call ValidateBankAccountNumberCommand beforehand to verify the debit account details.

Command Details​

  • Command: SetCollectionDetailsCommand
  • Type: Command (write operation)

API Endpoint​

POST /api/bpm/cmd

Request Structure​

FieldTypeRequiredDescription
loanRequestIdlongYesID of the loan quote (LoanQuote.Id)
repaymentDayInMonthintYesCalendar day (1–31) on which debit is attempted each month
repaymentCountintYesTotal number of installments (must be ≥ 1)
collectionStartDatestring (ISO 8601)YesDate of the first installment (e.g. "2025-09-01")
accountNumberstringYesBorrower's bank account number to debit
accountNamestringYesAccount holder's name
bankCodestringYesNIBSS bank code or internal bank code
collectionModeintYes0 = GSI, 1 = Direct Debit (see Collection Modes)
enableAutoDebitboolNoWhether automated debit should be enabled (default: false)
commentstringNoOptional officer comment

Collection Modes​

ValueNameDescription
0GSIGlobal Standing Instruction — NIBSS sweeps across all borrower accounts
1DirectDebitNIBSS direct debit mandate against the specified account

Try It Out​

POST/api/bpm/cmdSetCollectionDetailsCommand
Request Body

Response Structure​

{
"response": {
"isSuccessful": true,
"statusCode": "00",
"message": "Collection details set successfully and repayment schedule generated.",
"data": {
"loanQuoteId": 1001,
"accountNumber": "0123456789",
"accountName": "John Doe",
"bankCode": "000013",
"bankName": "GTBank",
"repaymentDayInMonth": 15,
"repaymentCount": 12,
"collectionStartDate": "2025-09-15T00:00:00Z",
"collectionMode": 1,
"enableAutoDebit": true,
"schedulePreview": [
{
"installmentNumber": 1,
"dueDate": "2025-09-15",
"principalAmount": 41666.67,
"interestAmount": 5000.00,
"totalDue": 46666.67,
"outstandingBalance": 458333.33
}
]
}
},
"responseCode": "00",
"responseDescription": "Success"
}

Validation Rules​

RuleError CodeMessage
Bank code does not exist08"The bank code does not exist"
repaymentDayInMonth outside 1–3109"The repayment day must be between 1 and 31"
repaymentCount < 109"The repayment count cannot be less than 1"
Loan not found04"Loan request not found"
Loan product has no disbursed amount09Disbursement amount validation error

Schedule Regeneration​

Each call to this command deletes and recreates the repayment schedule. This means:

  • Calling it a second time corrects any errors from the first call
  • Once the Hangfire background job has created mandates, regenerating the schedule does not automatically recreate or cancel those mandates — mandate management must be done separately