Functional Weave
Code in Rust

finance.late-payment-interest@1.0.0

README.md

3,580 bytes · view raw

# finance.late-payment-interest

What a UK business can claim when a business customer pays late, under the Late
Payment of Commercial Debts (Interest) Act 1998: statutory interest, and a fixed
sum of compensation for each debt.

**When interest runs.** Statutory interest starts on the day after the
relevant day, the date payment was due (s.4(2)), and runs to the day of payment.
So a debt due on 31 January and paid on 22 March 2026 is 50 days late. Paid on
or before the due date, nothing is due and the reference fields are null.

**The rate** is 8% a year over the reference rate, and the reference rate is
fixed once, when interest starts: the Bank of England's official dealing rate
(Bank Rate) in force on 30 June, for interest that starts to run between 1 July
and 31 December, or on 31 December, for interest that starts between 1 January
and 30 June (Late Payment of Commercial Debts (Rate of Interest) (No. 3) Order
2002, SI 2002/1675, article 4). It does not move when Bank Rate moves
afterwards. A debt due on 29 June 2023 is referenced to 31 December 2022 (3.5%,
so 11.5%); one due a day later starts on 1 July and is referenced to 30 June
2023 (5%, so 13%).

**The interest** is simple, one day's interest being 1/365 of a year's, in leap
years too, as gov.uk describes it. It is worked out exactly and rounded half-up
to the penny once: debt x rate x days / (10000 x 365). The gov.uk worked example
rounds the daily figure first (GBP 1,000 at 8.5% is "23p a day", so GBP 11.50
for 50 days); exactly, it is GBP 11.64. Keeping the full precision is the
defensible reading of the Act, and the difference is shown in the vectors.

**The fixed sum** (s.5A, in force from 7 August 2002) is GBP 40 for a debt under
GBP 1,000, GBP 70 from GBP 1,000 up to but not including GBP 10,000, and GBP 100
from GBP 10,000; once per debt, once interest starts to run. Reasonable recovery
costs above the fixed sum (s.5A(2A), from 2013) are a matter of evidence, not
arithmetic, and are not included.

The debt must be in GBP: the Act's fixed sums are sterling amounts. Whether a
debt qualifies at all (a business-to-business contract, no substantial
contractual remedy agreed instead) is a legal question the caller answers
first. Where no due date was agreed, the relevant day is 30 days after the later
of delivery and the invoice (s.4); pass that date as `dueDate`.

## Data and sources

- Bank Rate comes from finance.uk-bank-rate: every change from 8 November 2001
  (4%, the rate on the first reference date the 2002 Order can use, 30 June
  2002) to 18 December 2025 (3.75%), from the Bank of England's "Official Bank
  Rate history", https://www.bankofengland.co.uk/boeapps/database/Bank-Rate.asp,
  checked on 23 September 2026.
- `data/fixed-sums.json`: the three fixed sums of s.5A(2), from 7 August 2002.
- Late Payment of Commercial Debts (Interest) Act 1998, ss.4 and 5A:
  https://www.legislation.gov.uk/ukpga/1998/20
- SI 2002/1675, article 4 (the rate and the reference dates):
  https://www.legislation.gov.uk/uksi/2002/1675/article/4/made
- gov.uk, "Late commercial payments: charging interest and debt recovery":
  https://www.gov.uk/late-commercial-payments-interest-debt-recovery/charging-interest-commercial-debt

When Bank Rate changes, finance.uk-bank-rate publishes a new version and this
capability picks it up through its `^1.0.0` range; nothing here changes. Both
data files declare their effective dates, so a `history=current` build keeps
only the rows still in force and refuses a date before its horizon rather than
answering with today's figure.