Calculate Late Payment Interest
calculate_late_payment_interestSimple interest on an overdue invoice: amount x annual rate x days overdue / 365, plus a flat late fee. Mode "annual" (contract rate per year), "monthly" (rate per month, converted x12), or "uk" (UK Late Payment of Commercial Debts Act: 8% + Bank of England base rate, plus fixed compensation of GBP 40/70/100 by debt size). Same math as revexos.com/late-payment-interest-calculator. Whether interest can be charged depends on the contract and jurisdiction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| amount | Yes | Invoice amount outstanding. | |
| due_date | Yes | Invoice due date, YYYY-MM-DD. | |
| flat_fee | No | annual/monthly modes: flat late fee to add. Default 0. | |
| paid_date | No | Payment date or the date to calculate to, YYYY-MM-DD. Default today. | |
| annual_rate_pct | No | annual mode: rate per year in %. | |
| monthly_rate_pct | No | monthly mode: rate per month in %, e.g. 1.5. | |
| uk_base_rate_pct | No | uk mode: Bank of England base rate in % on the relevant reference date (30 June or 31 December before the debt became overdue). |