Calculate Late Payment Interest: Upload an Invoice, Get a PDF
Upload an invoice, set an end date: the bot calculates German late payment interest under section 288 BGB and returns a traceable PDF breakdown.
See it live The bot reads an uploaded invoice and extracts the invoice number, due date and amount. Using the type of claim and an end date, it calculates statutory late payment interest under German law from a stored table of base rates under section 247 of the German Civil Code (BGB). The bot is available as a ready-made template in e! by Lexemo, under “Templates” in the left-hand menu. See it live
Note: The calculation is general information, not legal advice for an individual case. It assumes the entire principal is unpaid, with no partial payments, and that default began on the day after the due date; it does not assess the legal requirements for default.
Introduction and the limits of the calculation
The bot has four sections and a completion screen. It opens with a text field that tells users up front what the bot does and where its limits are: the stored rate table covers 2023 to 2026 (as of 15 October 2026), and there is no live data retrieval. For later periods, the table in the prompt is updated.

Uploading the invoice
A File Upload node takes in the unpaid invoice. It accepts PDF as well as JPG and PNG images, is required, and is capped at one file. That keeps every extracted detail tied to a single invoice. The file goes straight to the following AI step (“Use in AI Output”).

Type of claim and end date
Two required fields supply what the invoice itself doesn’t say. The “Type of claim” dropdown records whether a consumer is involved. That decides the margin added to the base rate: 5 percentage points with a consumer involved, 9 percentage points for payment claims with no consumer involved (section 288(1) and (2) BGB). The date field sets the calculation end date, the day up to which interest is calculated.


Extracting the invoice details
The first AI step reads the invoice and returns exactly one JSON object with five fields: invoice number, invoice date, due date, gross amount and goods or services. Dates come in YYYY-MM-DD format, the amount as a number without a currency symbol. The technical JSON keys stay German so the existing Variable Mapper keeps working.
If a value is missing, use an empty string. Do not invent values.
A gap in the invoice stays visible instead of being filled with an assumption.

A Variable Mapper (vm_rechnung) splits the JSON response into separate variables. Invoice number, due date and amount are then available individually for the overview, the calculation and the PDF template.

A Text Field then shows the extracted values as a table, so users can check the amount and dates against their invoice before the calculation runs.

Calculating the interest
The second AI step does the maths. It receives the invoice details as JSON, the type of claim and the end date. The base rates under section 247 BGB sit directly in the system prompt, half-year by half-year from H1 2023 to H2 2026. The prompt also keeps the output in English while German law still applies:
The applicable law remains German law; do not substitute UK, US or other national interest rules.
That makes the calculation verifiable: every rate used is in the prompt, with a link to the Deutsche Bundesbank and the check date of 15 October 2026. The last row is explicitly approved only for the second half of 2026.
Before calculating, the prompt validates the inputs. If a positive amount, an unambiguous due date, the end date or the type of claim is missing, the bot names the gap and returns no amount. If the table lacks a base rate for even one day, it refuses to produce an incomplete total and asks for the table to be updated.
The calculation rules are spelled out:
- Period from the day after the due date to the end date, inclusive, each calendar day counted once
- Split into segments at every half-year and year boundary
- Actual/Actual day count: actual days divided by 365, or 366 in a leap year
- Margin of 9 percentage points with no consumer involved, 5 with a consumer (section 288 BGB)
- No compound interest, reminder charges or fixed compensation; only the total interest is rounded
Segment interest = gross amount * (base rate + margin) / 100 * segment days / days in that year.
This is the node to edit when a new half-year starts: add one row to the table, update the check date, done.

Creating the PDF
A Create PDF node builds the file. The template has a fixed header (“Calculation using the base rate under section 247 BGB”, invoice number) and a table with invoice number, due date, amount, type of claim and end date. The full interest calculation from the AI step follows below. A footer states the source and date of the rate table and that this is not legal advice.

User view
Users upload an invoice, choose the type of claim, set the end date and click “Next” to move on. Extraction and calculation run automatically in the background.
The “Late Payment Interest and Base Rate Calculator” start screen states right away which period the rate table covers, so it’s clear before the upload which claims the bot can calculate.

Invoice and details
In the example, an invoice for EUR 1,190.00 is uploaded as a PDF; PDF, JPG, JPEG and PNG are accepted. In the next step, the user selects “Consumer involved (plus 5 percentage points)” and 15 October 2026 as the end date.


Reviewing the extracted invoice details
Before anything is calculated, the bot shows the extracted values for review:
| Field | Shown in the example |
|---|---|
| Invoice number | RE-2026-0042 |
| Invoice date | 2026-09-01 |
| Due date | 2026-09-15 |
| Gross amount in EUR | 1,190.00 |
| Goods or services | Setup of a digital workflow |

Late payment interest calculation
The result opens with the invoice number, invoice and due dates written out in full, the calculation period (16 September to 15 October 2026, inclusive) and the type of claim with its margin. The table shows the period, days, base rate, margin, late payment interest rate and interest per segment, plus a total row. If the base rate changes within the period, each half-year gets its own row.
| Period | Days | Base rate | Margin | Late payment interest rate | Segment interest |
|---|---|---|---|---|---|
| 16 September 2026 to 15 October 2026 | 30 | 1.52% | 5.00% | 6.52% | EUR 6.38 |
A check line confirms that the segment days match the total calculation period. Principal: EUR 1,190.00. Total interest: EUR 6.38. Principal plus interest: EUR 1,196.38.

Completion
The “Calculation complete” screen offers Late-Payment-Interest.pdf for download. “Restart” begins a new run for the next invoice.
