Reverse loan account transaction
Creates an immutable compensating transaction and preserves reversal lineage. The reversal’s effective date is DERIVED from the payment being reversed and is not accepted in the request; a body carrying effectiveDate is refused 422. Idempotency is enforced in the use case on the required X-Idempotency key: a reused key with different facts yields 409. A malformed loan account UUID yields 422; an unknown transaction yields 404; a payment already reversed yields 409. A partial prepayment reverses too: a new transaction brings back the schedule it retired and frees the payments recorded before it. A payoff does not, nor does a partial paid through a collected quote (404). A partial of a month a close decided is REFUSED 422 with LENDER-0356 when the tenant’s business date runs ahead of the wall clock. A reversal is REFUSED 422 when the loan account carries a payment whose effective timestamp is strictly later than the reversed payment’s, or equal to it and recorded after it, or a schedule version dated strictly later than it or recorded at or after it was recorded. A payment whose whole amount stayed held cash, dated on a day after the payoff that settled the contract, is reversed: the contract stays settled and only that held cash goes back. When the payment left held cash the client already refunded the borrower, a settled contract whose ending payment is reversed reopens and the refunded part opens as a returned-payment receivable of the borrower in the same transaction, answered in returnedPaymentReceivableId; a product whose chart of accounts declares no returned-payment rules REFUSES it 422 with LENDER-0988, naming how much was refunded: the operator recovers that money outside the Lender. The problem document names which fact blocks, in errors[0].message: REVERSAL_REFUSED_LATER_PAYMENT (the borrower paid again — use the compensating-adjustment path), REVERSAL_REFUSED_LATER_SCHEDULE_VERSION (the schedule was re-agreed — the remedy is a new schedule version, or, when the later version is a partial prepayment, to reverse it first), or REVERSAL_REFUSED_LATER_FACTS_EXIST (both). A partial prepayment is REFUSED 422 with LENDER-0629 when the contract changed before it (a tranche, or a reschedule or renegotiation of a contract with fees): the reversal would not restore the books. An automatic prepayment discount is REFUSED 422 on its own: reversing its due day’s settlement reverses it too.
Encabezados
Parámetros de ruta
Cuerpo
Respuesta
OK

