Terminate a contract
End an active loan contract under an explicit product or legal basis, with component disposition, case governance, and a dedicated undo command.
Contract termination is a terminal command for a configured contractual or legal basis. It is not withdrawal before funding, normal payoff, charge-off, or a shortcut around balance disposition.
When it applies
Examples can include a qualifying financed-purchase cancellation or another basis defined in the product agreement. The policy states eligible states, time window, required evidence, treatment of principal, interest, and fees, merchant or customer money movement, and whether undo is allowed.
For an application not yet funded, use the withdrawnByApplicant or reject lifecycle commands. Termination is for an active contract whose posted history must be unwound or settled explicitly.
Settle the money first
Termination cannot claim that money returned merely because a refund was approved. Reconcile the original payout, merchant refund, down payment, customer payments, reversals, charges, interest, and any credit balance in the case before executing:
- a merchant return posts through
payoutRefundormerchantIssuedRefund; - customer money owed back posts through
creditBalanceRefundwith itsREFUNDfunding; and - cash still in flight must reach its terminal state.
For a fully cancelled Juniper purchase, that means the merchant payout return, the $240 down-payment disposition, and any posted installments are all settled or explicitly disposed before the termination command runs.
Execute
Termination is a governed loan-level command. A human call carries LendEasy-Case naming an open case when case management is enabled; without it the call is rejected before execution.
curl -X POST "$BASE/v1/loans/7204?command=contractTermination" \
-H "Authorization: Bearer $TOKEN" \
-H "LendEasy-Tenant: demo-lender" \
-H "LendEasy-Case: case_JUN_CANCEL_3" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: jun-termination-2026-08-24" \
-d '{}'
{
"officeId": 1,
"clientId": 412,
"loanId": 7204,
"resourceId": 7204
}
The command validates that the loan’s balances and dependent money movements permit termination; an unreconciled component is a named rejection, not a partial termination. Maker-checker can park the command for a second approver, and every execution writes a governance record readable at GET /v1/loans/7204/governance-records.
Controls
- Required case, evidence, reason, and approvals are present on the case.
- No conflicting bankruptcy, dispute, or fraud restriction is bypassed.
- All component totals reconcile before and after.
- Customer and merchant notices use pinned templates and facts.
- Autopay and future funding stop only after the state transition commits.
Result
The loan enters its terminated state with the effective date; the disposition of each component is readable from the loan’s transactions, and the governance record ties the command to its case and actor. Historical statements, payments, and interactions remain readable.
Undo
POST /v1/loans/7204?command=undoContractTermination is the dedicated compensating command, available only for policy-defined bases and before incompatible later activity. It restores contract state; actual returned or resent money always uses explicit funding and payment operations. If safe undo is impossible, a corrective action package agreed in the case is required.