Business Rules — Extraordinary Amortization
This page consolidates the invariants that govern the creation, settlement and cancellation of an extraordinary amortization. Refer to it whenever the endpoint pages cite an error code, a field or a condition that needs additional context.
Reference date (reference_date)
The reference_date is provided by the caller in the creation request and is the only temporal reference used by the service — the system never uses date.today(). All date-dependent logic (classification of overdue instalments, pro-rata Present Value discount, selection of instalments eligible for early_amortization and nominal_amount) starts from this field. The Present Value lookup on security-service receives this same reference_date.
Amortization types
The 7 supported types and how each distributes the amount across the instalments in installment_list:
| Type | Distribution rule across the selected instalments | Allows partial payment |
|---|---|---|
equal_amount | Proportional to the Present Value, overdue first and then future | No |
first_installments | Sequential across the first N selected instalments (by due date), N = number_of_installments | No |
present_amount | Explicit per instalment; discount orders interest → penalty → principal | No |
matured_installments | Only instalments already fallen due, by due date | No |
early_amortization | A single future instalment, up to its Present Value | Yes |
nominal_amount | Future instalments at nominal value (principal + interest), by due date, without Present Value | Yes |
full_amortization | Proportional to Present Value across every selected instalment, no cascade; each instalment is settled in full | No |
installment_list (an array of integer installment_number) is required for every type — omitting it returns EVC100002. The service resolves each installment_number to the corresponding instalment of the security and fetches the Present Value per selected instalment; the amortization_type only defines how the amount is distributed across those instalments.
Early amortization (early_amortization)
early_amortization allows partial payment (as does nominal_amount). All of the following conditions apply:
- Exactly 1 instalment in
installment_list— otherwise,EVC100015. - The target instalment must not be overdue — otherwise,
EVC100016. - The
amountmust be ≤ the Present Value of the instalment — otherwise,EVC100017. - Partial payment is allowed. The state
paid_amount > 0 AND paid_amount < expected_amountis derived from the columns; there is no new status enum value.pending_conciliationrepresents both "not paid" and "partially paid"; the transition topaidonly occurs whentotal_paid_amount >= total_expected_amount - tolerance_amount.
Nominal value amortization (nominal_amount)
nominal_amount settles future instalments at their nominal value — principal plus interest at maturity — without bringing them to the Present Value of the reference_date. All of the following conditions apply:
- Every instalment in
installment_listmust have adue_dateon or after thereference_date— an overdue instalment returnsEVC100030. - The
amountis distributed by due date, covering each instalment at its nominal value until it is exhausted; the last instalment reached may receive a partial amount. - The
amountmust be ≤ the sum of the nominal values of the selected instalments — otherwise,EVC100031. - Partial payment is allowed at settlement, with the same derived state described for
early_amortization.
Full settlement (full_amortization)
full_amortization uses the declared amount to settle every instalment in installment_list, regardless of each one's Present Value:
- The
amountis split across the instalments proportionally to their Present Value on thereference_date, with no cascade — no instalment is left without a share. - Each
event_conciliationis created withexpected_amountequal to its share anddiscount_amountequal to the difference between the Present Value and the share. - The
amountcannot exceed the sum of the selected instalments' Present Values — otherwise,EVC100035. - At liquidation, paying the share settles the instalment in full on security-service: the paid amount is recorded as paid and the difference as the instalment's discount. The same applies to
present_amount.
Consistency between amount and the distribution
After distributing the amount, the service validates the result for every type, in this order:
amountgreater than the sum of the distributed instalments' Present Values →EVC100035(Present-Value-priced types;early_amortizationandnominal_amountkeepEVC100017andEVC100031).- Any selected instalment would end with an
expected_amountof zero →EVC100034. No event is created with zero-valued children; select only instalments theamountcovers. - The sum of the distributed
expected_amountdiffers fromamountby more than R$ 0.01 →EVC100033. Forpresent_amount,amountmust equal the sum of the Present Values minustotal_discount.
The expected_amount values are stored in cents, with the rounding residual on the last instalment, so the event's total_expected_amount always equals the sum of its children.
Settlement flow
Internal orchestration. Settlement of extraordinary events is executed by QI Tech (account-liquidation-api) upon detecting the payment — the integrator does not call any endpoint at this stage, nor receives a webhook dedicated to the status transitions. The rules below describe the internal behaviour so you understand what happens after creation.
Ordinary settlement emits the full total (rule 4). Ordinary settlement on the due_date continues to emit the instalment's full total_amount via SQS; there is no subtraction of paid_amount. The event reconciles the partially-paid state in its own early_amortization engine.
Cancellation and finalization
Internal orchestration. Cancellation and finalization are triggered by a daily routine — the integrator does not call any endpoint to cancel or finalize an extraordinary amortization, and there is no tenant-facing webhook dedicated to these transitions. The description below is informative.