# UK Late Payment Interest (`landlordtools/uk-late-payment-interest`) Actor

Calculate interest, compensation and totals for one business invoice. See README for assumptions and limits.

- **URL**: https://apify.com/landlordtools/uk-late-payment-interest.md
- **Developed by:** [LandlordTools](https://apify.com/landlordtools) (community)
- **Categories:** Business, Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 calculations

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## UK Late Payment Interest

Estimate late-payment interest, fixed compensation and totals for one UK business-to-business invoice in GBP. Submit invoice dates and an amount; receive one JSON result in the dataset and the key-value store's `OUTPUT` record.

The calculation uses simple interest at 8 percentage points above the applicable Bank of England reference rate. [1], [3] Fixed compensation is £40 for debts below £1,000, £70 from £1,000 to £9,999.99, and £100 from £10,000. [2]

**Not legal advice.** The Actor estimates amounts; it does not determine eligibility or review contracts. GOV.UK says statutory interest cannot be claimed where a contract provides a different interest rate. [1]

### Input

```json
{
  "amount": 2400,
  "invoiceDate": "2026-03-01",
  "termsDays": 30,
  "paidDate": "2026-06-15",
  "businessToBusiness": true
}
```

- `amount`: required JSON number, £0.01–£1,000,000,000, at most two decimal places.
- `invoiceDate`: required real calendar date in `YYYY-MM-DD` format, years 1000–9999.
- `businessToBusiness`: required; must explicitly be `true`.
- `dueDate` or `termsDays`: optional; supply at most one. `termsDays` adds 0–999 calendar days to `invoiceDate`. Omitting both uses this calculator's 30-day assumption; supply the actual due date where available.
- `paidDate`: optional payment date or projection end date. Defaults to today's date in Europe/London.

Unknown fields are rejected. Do not supply names or contact details.

### Example output

Selected fields for the input above, run on 2 October 2026:

```json
{
  "currency": "GBP",
  "dueDate": "2026-03-31",
  "paidDate": "2026-06-15",
  "asOfDate": "2026-10-02",
  "lateFrom": "2026-04-01",
  "daysLate": 76,
  "settled": true,
  "baseRate": 3.75,
  "annualRate": 11.75,
  "referenceDate": "2025-12-31",
  "estimate": false,
  "dailyInterest": 0.7726027397260274,
  "interest": 58.72,
  "compensation": 70,
  "claim": 128.72,
  "totalDue": 128.72,
  "total": null,
  "note": "Not legal advice. This is a calculation estimate; eligibility and contract terms need separate review."
}
```

The complete result also includes the invoice amount, dates, reference period, on-time flags and source URLs. The full example is in `examples/output.json`.

The Actor treats `paidDate` before today's London date as paid principal: `totalDue` contains interest plus compensation, and `total` is `null`. Today or a future date is treated as unpaid or projected: `totalDue` includes the principal. This is an input convention, so use dates accordingly. `claim` always means interest plus compensation; `dailyInterest` is the calculation rate, including for historical paid invoices.

On-time results have zero interest and compensation. Money totals are rounded to two decimal places after calculation; `dailyInterest` retains its precision.

### Reference rates and limits

The reference rate is selected from the half-year containing the first day late and retained throughout that calculation. The January–June reference uses Bank Rate on the preceding 31 December; July–December uses Bank Rate on 30 June. [3] Bank Rate history supplies the underlying observations. [4]

**Rates must be updated each 1 January and 1 July.** The maintainer must add the next half-year row to `reference-rates.json` using the corresponding reference date, then run the tests. Updates are manual; the Actor does not fetch live rates. [3], [4]

The bundled table covers first-late dates from 1 January 2020 through 31 December 2026. Earlier late debts are rejected. Later first-late dates reuse the final row and return `estimate: true` with a warning. A payment date beyond table coverage alone does not change the reference rate or set that flag.

The Actor accepts one invoice per run. Partial payments, multiple invoices, contract-specific interest and additional recovery costs are outside its calculation model.

### Local use

With Node.js 22 or later, run `node cli.js examples/input.json` for a dependency-free calculation, or `npm test` to run the calculator, Actor and timezone regression checks. The example's `asOfDate` changes with the run date. Deployment uses the included Actor metadata and Dockerfile.

### Sources

1. [GOV.UK: Interest on late commercial payments](https://www.gov.uk/late-commercial-payments-interest-debt-recovery/charging-interest-commercial-debt). Accessed 2 October 2026.
2. [GOV.UK: Claim debt recovery costs](https://www.gov.uk/late-commercial-payments-interest-debt-recovery/claim-debt-recovery-costs). Accessed 2 October 2026.
3. [GOV.UK: A users guide to the recast Late Payment Directive, pages 7–8](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/360834/bis-14-1116-a-users-guide-to-the-recast-late-payment-directive.pdf). Accessed 2 October 2026.
4. [Bank of England: Bank Rate history](https://www.bankofengland.co.uk/boeapps/database/Bank-Rate.asp). Accessed 2 October 2026.

[1]: https://www.gov.uk/late-commercial-payments-interest-debt-recovery/charging-interest-commercial-debt

[2]: https://www.gov.uk/late-commercial-payments-interest-debt-recovery/claim-debt-recovery-costs

[3]: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/360834/bis-14-1116-a-users-guide-to-the-recast-late-payment-directive.pdf

[4]: https://www.bankofengland.co.uk/boeapps/database/Bank-Rate.asp

# Actor input Schema

## `amount` (type: `number`):

A JSON number from 0.01 to 1000000000, with at most two decimal places.

## `invoiceDate` (type: `string`):

Calendar date in YYYY-MM-DD format.

## `dueDate` (type: `string`):

Optional agreed due date. Omit termsDays when using this field.

## `termsDays` (type: `integer`):

Optional whole number added to invoiceDate. Omit dueDate when using this field. If both fields are absent, the calculator assumes 30 days.

## `paidDate` (type: `string`):

Optional YYYY-MM-DD. Defaults to today in Europe/London. A date before today means the principal is already paid; today or later means unpaid or projected.

## `businessToBusiness` (type: `boolean`):

Must explicitly be true. Other invoice types are not supported.

## Actor input object example

```json
{
  "amount": 2400,
  "invoiceDate": "2026-03-01",
  "termsDays": 30,
  "paidDate": "2026-06-15",
  "businessToBusiness": true
}
```

# Actor output Schema

## `result` (type: `string`):

No description

## `output` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "amount": 2400,
    "invoiceDate": "2026-03-01",
    "termsDays": 30,
    "paidDate": "2026-06-15",
    "businessToBusiness": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("landlordtools/uk-late-payment-interest").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "amount": 2400,
    "invoiceDate": "2026-03-01",
    "termsDays": 30,
    "paidDate": "2026-06-15",
    "businessToBusiness": True,
}

# Run the Actor and wait for it to finish
run = client.actor("landlordtools/uk-late-payment-interest").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "amount": 2400,
  "invoiceDate": "2026-03-01",
  "termsDays": 30,
  "paidDate": "2026-06-15",
  "businessToBusiness": true
}' |
apify call landlordtools/uk-late-payment-interest --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,landlordtools/uk-late-payment-interest"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/RrNH9YOqqd7X26Zas/builds/FliBTV2KGzzNz4sQj/openapi.json
