Skip to content

Mortgage Page

Route: /mortgage (mortgage.html) Nav label: Mortgage Last Updated: 2026-08-11


What It Does

Mortgage payoff calculator and balance history. Shows how extra principal affects the payoff timeline and total interest.


Data Source

mortgage_statements, not bank_transactions. Fifth Third statements are parsed by parse_fifth_third_mortgage() and land in their own table, which is where balance, rate, and the principal/interest/escrow split come from. 9 statements loaded.

Column Use
statement_date History x-axis, ordering
balance Outstanding principal
interest_rate Annual rate
min_payment Required payment. Derived when absent, see below
principal_paid, interest_paid, escrow_paid Payment composition
next_payment_due, total_paid

/api/mortgage-latest additionally reads the most recent bank_transactions row with category = 'Mortgage' and type = 'debit' to show what actually left the checking account. That part is only as current as the loaded BofA checking statements, since the payment originates there by ACH.

Escrow is held separate

Amortization runs on principal and interest only. Escrow is passed through so scenario totals show the real monthly outlay without escrow inflating interest math. min_pi_payment on the latest response is the payment net of escrow.

min_payment fallback

When a statement has no min_payment, it is derived as principal + interest + escrow. If those are also zero, a standard 360-month payment is computed from balance and rate.


API Endpoints

Endpoint Purpose
GET /api/mortgage-latest Newest mortgage_statements row plus the latest actual mortgage debit
GET /api/mortgage-history One row per statement_date (DISTINCT ON, newest id wins a tie), annotated with actual principal paid
GET /api/mortgage-calc Amortization. Query args: balance, rate, min_payment, extra, escrow, all floats defaulting to 0

/api/mortgage-calc takes everything from the query string, so the page can model a hypothetical without touching stored data.


The Targets page runs the same _amortize() helper and presents mortgage payoff as one of the five financial targets, including computed "pay off in 15 years" and "pay off in 10 years" extra payments. This page is the calculator, that page is the goal tracker.

Lender

Fifth Third Bank. Payments originate from BofA checking via ACH.