Skip to content

datev: rewrite adapter against official OpenAPI specs#247

Merged
keysersoft merged 1 commit into
mainfrom
keysersoft/datev-connector-plan
May 23, 2026
Merged

datev: rewrite adapter against official OpenAPI specs#247
keysersoft merged 1 commit into
mainfrom
keysersoft/datev-connector-plan

Conversation

@keysersoft
Copy link
Copy Markdown
Contributor

Summary

The DATEV connector was inferred from third-party docs and was wrong on every load-bearing field (auth URLs, scopes, missing required header, two non-existent tools). This PR replaces it with values extracted directly from the official DATEV OpenAPI specs at developer.datev.de/mediator/apis.

Adapter (packages/backend/src/adapters/de/datev.json)

Field Before After
authorizationUrl login.datev.de/connect/authorize (404) login.datev.de/openid/authorize
tokenUrl login.datev.de/connect/token (404) api.datev.de/token
Scopes openid offline_access accounting:documents:read accounting:documents:write datev:accounting:clients accounting:clients:read accounting:documents
X-DATEV-Client-Id not sent auto-injected via connector.headers (required on every endpoint per spec)
Tools 4 (2 invented, would 404) 6 read tools across accounting-clients v2 + accounting-documents v2

Upload tools (POST/PUT /clients/{id}/documents{,/stapled}) intentionally excluded — they need binary multipart, but the REST engine still serializes form-data field values via String(v). Tracked as future work.

Docs (content/guides/{en,de,it}/datev-to-mcp.mdx)

Rewritten to match the corrected adapter. Now covers:

  • DATEV portal app setup (Confidential client, Authorization Code Flow, redirect URI rules)
  • Sandbox vs production switching (different auth host AND different API base path platform-sandbox)
  • One-time OAuth dance via POST /api/connectors/:id/oauth/authorize
  • Why two list_clients tools exist (master list vs DUO-subscribed subset)
  • The DATEV partner / production-approval requirement
  • EXTF CSV as the pragmatic fallback for SMBs without a partner contract

Test plan

  • npm test --testPathPatterns=catalog.spec — 2209/2209 pass
  • node scripts/validate-adapters.mjs — 173/173 valid
  • node scripts/regenerate-catalog.mjs — no diff (catalog in sync)
  • Manual smoke test against DATEV sandbox after deploy (will follow up)

Previous adapter was inferred from third-party docs and was wrong on
every load-bearing field. Replaced with values extracted directly from
DATEV's official OpenAPI specs at developer.datev.de/mediator/apis.

Adapter changes (packages/backend/src/adapters/de/datev.json):
- Auth URLs: login.datev.de/openid/authorize + api.datev.de/token
  (was login.datev.de/connect/{authorize,token} — non-existent paths).
- Scopes: datev:accounting:clients accounting:clients:read accounting:documents
  (was openid offline_access accounting:documents:read/write — wrong namespacing).
- X-DATEV-Client-Id: auto-injected on every call via connector.headers
  (was missing — required by every DATEV endpoint per spec).
- Tools: 6 read tools wired to real endpoints across accounting-clients v2
  and accounting-documents v2. Dropped two invented tools that don't exist
  on the API (datev_list_documents, datev_get_document — the documents
  product is upload-only). Added datev_get_duo_version and the documents
  product's own client listing.
- Upload tools (POST/PUT/stapled) intentionally excluded: require binary
  multipart, REST engine still serializes form-data with String(v).

Docs (content/guides/{en,de,it}/datev-to-mcp.mdx): rewritten to match
the corrected adapter + document sandbox switching procedure and the
DATEV partner / production-approval requirement.

All 2209 catalog assertions pass.
@keysersoft keysersoft requested a review from D3nisty as a code owner May 23, 2026 12:09
@keysersoft keysersoft merged commit 1d88042 into main May 23, 2026
11 checks passed
@keysersoft keysersoft deleted the keysersoft/datev-connector-plan branch May 23, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant