Client work2025Training-management software (Digiforma)
DATEV integration
The platform that let a French training software send invoices to DATEV automatically. It passed DATEV’s technical review and is listed on the DATEV Marketplace.
- 15-min tokens
- per-client auth
- XML schema
- tech review
standard access_token
15:00
Expires after 15 minutes.
The challenge
A German customer wanted training invoices from Digiforma to reach DATEV without manual entry. Two constraints stood in the way. DATEV’s standard access tokens expire after 15 minutes, which rules out unattended automation. Long-lived authorizations exist, but each one covers a single client (Mandant): 90 clients means 90 authorizations to create, store and renew. And no integration reaches DATEV users without passing DATEV’s technical review.
Results
- Passed DATEV’s technical review after several rounds.
- Listed on the DATEV Marketplace.
- Digiforma can now serve customers who run their accounting in DATEV.
What I built
- 01
One authorization per client
A Next.js platform where the customer connects DATEV through OAuth, client by client. Long-lived tokens are stored encrypted and refreshed on each use, so automations keep running.
- 02
No extra password
Users open the platform from the Digiforma Chrome extension through a time-limited magic link. There is no separate account to manage.
- 03
Invoices DATEV accepts
Invoice data is converted to XML and checked against DATEV’s document schema before sending, so errors are caught before they reach DATEV.
- 04
Built for the review
A chronological log of every call to DATEV, upload logs kept for a year, a disconnect button that revokes access, and a check that each client is reachable before it shows as connected.
Key decisions
For technical readers: key decisions
Refresh on use, not on a timer
DATEV asks integrations not to poll around the clock. Instead of a scheduled job, every call refreshes the access token first and saves the rotated refresh token, so an idle client costs nothing and an active one never sends an expired token.
Trade-off: One extra token call before each DATEV request.
One token per client, enforced by the database
DATEV allows a single valid refresh token per client dataset. Each authorization requests a scope tied to one client, and the token table has a unique key on that client, so a second token cannot exist. Tokens are encrypted with AES-256-GCM, and authorization headers are redacted from the logs.
Trade-off: A firm with 90 clients goes through 90 consent screens, so the token page shows each client’s status and expiry.
Validate the XML twice
Invoices are built as DATEV ledger XML and validated against DATEV’s schema when they are created, then again right before sending. The status and protocol of each upload job are stored, and a failed job can be resent.
Trade-off: Validation runs xmllint, which adds a system dependency to the Docker image.
Stack
- Next.js
- TypeScript
- Prisma
- PostgreSQL
- DATEV API
- OAuth 2.0
- XML / XSD