MohB

All apps › Documentation: Finance

Technical documentation

Architecture, data protection and API.

For IT contacts, data protection officers, accountants and developers who connect a mailbox or a script.

Architecture at a glance

  • Web app for the interface and its API. Every request carries the active company.
  • Reading in the background: a scheduled job picks up new receipts every five minutes and tries each one up to three times.
  • Database: MariaDB. Receipt files are stored per company outside the public web area, on the same server.
  • Reading receipts: Portuguese QR codes are read on the server, without AI. Everything else is read by Claude (Anthropic) through the Anthropic API.
  • Exchange rates: daily reference rates of the European Central Bank, fetched by currency and date only.
  • Login: the shared MohB account (single sign-on). Roles per company: Owner, MohB advisor and Staff.
  • Hosting: servers in the EU. Fonts and charts are delivered by the app itself; no ad networks, no third-party tracking.

Separation of companies

Every record belongs to one company, and every database query names that company explicitly. A person only reaches the companies they are a member of; a request for another company's record answers "not found" or "no access". Automated tests check this through the real API and also scan the code for queries without the company filter.

RoleSees and does
OwnerEverything, including people and roles
MohB advisorEverything; manages staff only, not owners or advisors
StaffReceipts page only: upload, check, edit receipts

Data protection and records

WhatWhere it is kept
Receipt file and its SHA-256 fingerprintPer company, outside the public web area
Values read from the receipt, and the raw reading resultOn the receipt
Origin: upload (with the uploader's username) or source, date received, email subjectOn the receipt
Bank transactions as exported by the bank (date, text, reference, counterparty, amounts, balance)Per company, after your upload
Cost statements with items, and who created themPer company
Source tokensOnly as SHA-256 fingerprint

What goes to Anthropic for reading: the receipt (as text if the PDF contains text, otherwise the PDF or image), your company name, address and country, your Hints for reading, the list of your categories and, for receipts that came by email, the email subject. Values from a Portuguese QR code are passed along so the reading uses them.

  • No bank connection. The app never logs in to your bank. It only knows the CSV files you upload.
  • No invoices. MohB Finance creates cost statements and the amount for an invoice line. Invoices stay in certified invoicing software.
  • Company profile: if your company is linked to your MohB company profile, display name, legal details, document language, logo and brand colour are a copy of it. The copy is refreshed when it is older than 15 minutes; if the profile cannot be reached, the last copy stays.

Safety nets

  • Same file once: a file already stored for the company is not stored again. Duplicates by content (same vendor and amount, dates at most three days apart) are marked and left out of all totals.
  • Billed stays billed: receipts on a final cost statement can only be changed in notes and project, until the statement is set back to draft.
  • All or nothing: a bank upload is saved completely or not at all. Transactions already known are not added twice.
  • Hand beats machine: an EUR amount entered by hand is never overwritten by the bank or the exchange rate. A rejected match is not suggested again.
  • Limited retries: reading stops after three failed attempts and waits for a person.
  • Role guards: nobody changes their own role, and the last owner of a company stays.
  • Request protection: changes are accepted only from the app itself, not from forms on other sites. A strict content security policy limits what the page may load.
  • Backup: database and receipt files are backed up every night and kept for 14 days.

Inbound API

Endpoint: https://finance.mohb.de/api/import.php. For mailbox imports, folder syncs and scripts. A token can only deliver receipts to its company; it cannot read anything.

Authentication

Create a source under Settings → Inbound (owners and advisors). The token is shown once; the server keeps only its SHA-256 fingerprint. Send it as a bearer token. Revoke stops it immediately.

curl -H "Authorization: Bearer mf_…" \
  -F "file=@invoice.pdf" \
  -F 'meta={"source_ref": "msg-123", "source_date": "2026-11-05T09:12:00Z", "source_subject": "Your invoice"}' \
  https://finance.mohb.de/api/import.php

Request

FieldMeaning
fileThe receipt: PDF, JPEG, PNG, WebP or an email as HTML
metaOptional JSON: source_ref (your own reference), source_date (when it arrived), source_subject (email subject, also used for reading and rules)

Answers

StatusMeaning
201Stored as a new receipt: {"id": …, "duplicate": false}
200This file is already there: {"id": …, "duplicate": true}
400File missing
401Token missing, unknown or revoked
405Only POST is accepted
413File too large
415File type not supported

Sending the same file again is safe: it returns the existing receipt. The endpoint is rate-limited.