ml-connector
DATEVAvalara

DATEV and Avalara integration

DATEV runs accounting and tax filing for German and Austrian businesses. Avalara AvaTax calculates sales, use, and VAT tax across jurisdictions. Connecting the two lets DATEV invoice and booking data be priced for tax by AvaTax before it is posted, so each booking carries a verified rate and tax code. ml-connector reads the source data from DATEV, calculates the tax in Avalara, and returns the result inside the EXTF CSV or DXSO XML file it submits back to DATEV. It handles the very different authentication and transport on each side and moves the data on the cadence you set.

How DATEV works

DATEV is split between on-premise DATEV Rechnungswesen and the cloud DATEV Unternehmen Online. It is not a conventional REST API. The accounting:clients product reads the client metadata that keys every other call, and accounting:documents uploads invoice PDFs to the cloud, but finalized bookings only move as asynchronous file jobs: EXTF CSV to the on-premise ledger and DXSO XML to the cloud. Authentication is OAuth 2.0 Authorization Code with PKCE through Login mit DATEV, with 15-minute access tokens that must be refreshed. There are no webhooks, so job results are read by polling, and posted journal entries and the full chart of accounts cannot be read back.

How Avalara works

Avalara AvaTax is a tax calculation service, not an ERP, so it holds no vendors, purchase orders, GL accounts, or payments. Its central object is the transaction, created with POST to the transactions endpoint, which returns the calculated tax inline because the API is synchronous. Each transaction carries a company code, a document code that acts as the idempotency key, customer and address details, and line items tagged with an Avalara tax code. Authentication is HTTP Basic using an account ID and license key. AvaTax does not push events; its notifications resource is pull-only, and list endpoints use OData top and skip paging.

What moves between them

The flow runs from DATEV into Avalara and back into DATEV. ml-connector reads invoice and booking data from DATEV documents and prepared bookings, then sends each as an AvaTax transaction with its addresses and line items so Avalara returns the tax amount, rate, and jurisdiction. The calculated tax code and amount are written back into the EXTF CSV or DXSO XML file that ml-connector submits to DATEV, so the booking posts with verified figures in its tax key and amount fields. Cadence follows your posting schedule rather than a push, since neither system emits events. Avalara is the system of record for tax determination, and DATEV remains the system of record for the booking itself.

How ml-connector handles it

ml-connector stores both credential sets encrypted. It runs the DATEV OAuth Authorization Code flow with PKCE, sends the bearer token and the X-DATEV-Client-Id header on every DATEV call, and refreshes the 15-minute token using the client_id alone when a call returns 401. For Avalara it builds the HTTP Basic header from the account ID and license key. Because neither side pushes events, ml-connector polls: it submits each EXTF or DXSO file as a job and polls the job status with exponential backoff and jitter until DATEV reports complete or failed. DATEV tax keys (Steuerschluessel) are mapped to Avalara tax codes first, and AvaTax transactions reuse the DATEV document number as the document code so a retry updates the uncommitted transaction in place rather than duplicating it. EXTF files use the DATEV duplicate check on filename plus document type, so ml-connector generates stable filenames for retry-safe resubmission and writes UTF-8 with precomposed characters to avoid silent rejection. AvaTax 429 responses are retried with backoff, and every record carries a full audit trail and can be replayed if a DATEV submission fails.

A real-world example

A mid-sized German wholesale distributor with about 200 staff runs DATEV for its books through its tax advisor and sells into several EU countries. Before the integration, staff calculated the correct VAT treatment for cross-border and mixed-rate orders by hand before entering bookings, and errors surfaced late when the advisor reviewed the EXTF batch. With DATEV and Avalara connected, each invoice is sent to AvaTax for tax determination, the verified rate and tax code are written into the booking file, and the batch reaches the advisor already priced correctly. The manual VAT lookup is gone, and bookings arrive with consistent tax codes across every jurisdiction.

What you can do

  • Send DATEV invoice and booking data to Avalara AvaTax as transactions for real-time tax calculation.
  • Write the calculated tax codes and amounts back into the EXTF CSV or DXSO XML booking file submitted to DATEV.
  • Map DATEV tax keys to Avalara tax codes so each booking line posts with a valid rate and code.
  • Bridge DATEV OAuth with PKCE and 15-minute tokens to Avalara HTTP Basic license-key authentication.
  • Poll DATEV job status with backoff and keep a full audit trail and replay on every record, since neither system pushes events.

Questions

Which direction does data move between DATEV and Avalara?
Source data moves from DATEV into Avalara, and the calculated tax moves back into DATEV. ml-connector reads invoices and bookings from DATEV, sends each to AvaTax for tax determination, and writes the returned rate and tax code into the EXTF or DXSO file it submits to DATEV. Avalara is the tax authority and DATEV remains the system of record for the booking.
How are the two different authentication methods handled?
DATEV uses OAuth 2.0 Authorization Code with PKCE through Login mit DATEV, while Avalara AvaTax uses HTTP Basic with an account ID and license key. ml-connector stores both encrypted, sends the DATEV bearer token plus the client ID header and refreshes the 15-minute token automatically, and builds the Avalara Basic header on each call. The two credential models run side by side without manual steps.
Does the integration use webhooks or polling?
Polling, because neither system pushes events. DATEV has no outbound webhooks and processes booking files as asynchronous jobs, so ml-connector submits each file and polls its job status with exponential backoff until DATEV reports complete or failed. Avalara AvaTax is synchronous and returns the calculated tax inline on each transaction call, so no callback is needed there.

Related integrations

Connect DATEV and Avalara

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started