Skip to main content

Repay part of a loan principal

A principal prepayment reduces the loan principal by a specified amount and recalculates its future repayment schedule. The loan remains active. The agreed earned-interest collection and the bank's prepayment charge are collected in addition to the principal amount. A waiver reverses booked interest and removes unbooked obligations without collecting customer cash or adding principal.

The loan must be disbursed and active or have resolvable interest arrears, its product must allow prepayment, and the bank's financial date must be open. Settle overdue principal, fees, penalties and carried obligations first; due interest can be resolved here. Future installments with advance payments or charges still require bank review. Separate future interest and fee legs do not by themselves block this flow: future interest is recalculated and unpaid fees keep their amounts and due dates. The principal payment must be positive, have at most two decimal places, and be less than the remaining principal. Use full settlement to close the loan.

1. Request a quote​

Use the base URL and bearer token from your first request. Replace the example loan account number with the loan contract number, not the linked funding account number, and use a unique reference for this payment. Save this body as principal-payment.json:

{
"loanAccountNumber": "LOAN-001",
"principalAmount": 10000,
"repaymentOption": 0,
"reference": "example-principal-001",
"notes": "Agreed principal prepayment"
}
curl --fail-with-body --request POST \
"$COREWAVE_BASE_URL/api/loanaccount/v1/principalrepayment/quote" \
--header "Authorization: Bearer $COREWAVE_TOKEN" \
--header "request-reference: principal-quote-$(uuidgen)" \
--header 'Content-Type: application/json' \
--data-binary @principal-payment.json \
--output principal-quote.json

Read status before using data. A successful quote contains principalAmount, accruedInterestAmount, penaltyAmount, totalDebit, remainingPrincipal, installmentCount, quoteToken, reference, currencyCode, fundingSource, postingReferences and schedules. Each schedule row contains repaymentDate, principal, interest and fees. A quote moves no money and has an empty postingReferences list.

  • repaymentOption: 0 keeps the remaining installment count and contractual due dates, and recalculates payments on the smaller principal.
  • repaymentOption: 1 uses the earliest remaining contractual due dates to find a shorter tenure whose largest principal-and-interest installment does not exceed the largest remaining installment before this payment. Recurring fees are listed separately.
  • repaymentOption: 2 agrees new terms: provide newInstallmentCount (1–600), newFirstRepaymentDate after the bank financial date, and interestResolutionReason. Optionally provide newAnnualInterestRate (0–1,000%, up to four decimals) and newInterestMethod; zero rate makes future installments interest-free. Existing principal repayment frequency is retained.

The bank's loan interest model, repayment interval, calendar and configured recurring fees determine the new schedule. Review every date and amount. The principal amounts in the replacement schedule sum to remainingPrincipal. Future contractual interest is recalculated rather than treated as paid. Choose interestResolution: 0 to collect all quoted unpaid earned interest (the default), 1 to waive it, or 2 to collect accruedInterestToCollect and waive the remainder. A waiver or unbooked earned-interest resolution requires interestResolutionReason. Suspended interest is resolved once without an extra customer charge; any attributable EOD available-balance hold is released in the same settlement.

Review accruedInterestCollected, accruedInterestWaived, dueInterestReceivable, suspendedInterestReleased, availableBalanceHoldReleased and the future rate/method/start date. Approval follows the institution’s configured repayment policy; an institution with no approval policy can execute after reviewing the exact quote.

For example, a ₦10,000 principal reduction with ₦500 accrued interest and a ₦100 prepayment charge requires a ₦10,600 total debit. Only ₦10,000 reduces principal.

2. Confirm the reviewed quote​

After reviewing the quote, attach its exact token to the original request. This command requires jq:

jq -e --slurpfile quote principal-quote.json \
'if $quote[0].status == true and ($quote[0].data.quoteToken | type) == "string" then . + {quoteToken: $quote[0].data.quoteToken} else error("No successful quote to confirm") end' \
principal-payment.json > principal-confirmation.json &&
curl --fail-with-body --request POST \
"$COREWAVE_BASE_URL/api/loanaccount/v1/principalrepayment" \
--header "Authorization: Bearer $COREWAVE_TOKEN" \
--header "request-reference: principal-confirm-$(uuidgen)" \
--header 'Content-Type: application/json' \
--data-binary @principal-confirmation.json

Execution recalculates and checks the quote. If the balance, financial date, terms or schedule changed, request and review a fresh quote. Keep the original business reference for the same payment. Do not substitute a token from a different amount or schedule option.

Save data.postingReferences to match the principal, interest and charge journals to bank records. A successful response means the funding debit, principal reduction, charge and interest collection, payment record and replacement schedule committed together. The source is the loan's linked account or configured funding ledger. An account source needs sufficient available funds. For a ledger source, confirm cash collection and posting authority with the bank before submitting: the API records the ledger entries and does not collect money from an external account. The original schedule history remains available for audit. The bank may require staff processing instead of immediate API execution.

HTTP 202 means bank approval or AML review is pending and no payment has posted. For repayment approval, retain the returned approval identifier and let the bank complete its approval flow. For AML review, save data.approvalReference, wait for the bank’s decision, and release the unchanged payment using amlApprovalReference. Do not create a new payment reference to bypass either review. A financial-date or balance change may require a fresh quote and review.

Unpaid fees on the remaining installments retain their contracted amounts and due dates. They are shown in data.schedules[].fees and are not included in today’s debit. Shortening stops before it would remove a fee-bearing installment; the quoted installment count may therefore stay unchanged.

3. Reconcile an uncertain result​

Use the original reference:

curl --fail-with-body --get \
"$COREWAVE_BASE_URL/api/loanaccount/v1/principalrepayment/status" \
--data-urlencode 'Reference=example-principal-001' \
--header "Authorization: Bearer $COREWAVE_TOKEN" \
--header "request-reference: principal-status-$(uuidgen)"

data.processingStatus: "Completed" confirms that the debit and schedule change committed. The lookup also returns data.postingReferences for reconciliation. A 404 can mean processing or bank review has not finished. Keep the payment unresolved and contact the bank before sending a replacement. A duplicate or changed-quote rejection is not another payment receipt.

Retrieve the current schedule with the loan contract number from your original request:

LOAN_ACCOUNT_NUMBER="$(jq -er '.loanAccountNumber | select(type == "string" and length > 0)' principal-payment.json)" &&
curl --fail-with-body --get \
"$COREWAVE_BASE_URL/api/loanaccount/v1/viewloanschedule" \
--data-urlencode "AccountNumber=$LOAN_ACCOUNT_NUMBER" \
--header "Authorization: Bearer $COREWAVE_TOKEN" \
--header "request-reference: principal-schedule-$(uuidgen)"

Replaced schedules are excluded from this response; the bank retains their history. Read the loan and its current repayment schedule after completion. A partial principal payment does not close the loan or produce a full-settlement certificate. Principal prepayments cannot be undone using the full-settlement reversal action; contact the bank for a reviewed accounting adjustment.