GET /accounts - Account functions
This endpoint retrieves general ledger accounts as well as customer and supplier accounts from DATEV Rechnungswesen. The maesn API maps the account number and description to the unified model. Since some fields returned by DATEV are DATEV-specific, they are not mapped to the unified model. However, they are still available in the raw response when usingrawData=true.
DATEV-specific fields
The three DATEV-specific fields are:- mainFunction: the function type
- mainFunctionNumber: the function number
- functionExtension: the additional detail or extension
mainFunction, mainFunctionNumber, and functionExtension.
Interpreting account functions
To help interpret these values, DATEV publishes yearly Kontenfunktions-Tabellen for SKR03 and SKR04. These tables list the available account functions for a given year and provide the reference needed to understand the values returned in the API. DATEV account-function tables use the formatZZ YY XXX, where:
ZZ= function typeYY= main function numberXXX= function extension
mainFunction corresponds to the function type (ZZ), mainFunctionNumber to the main function number (YY), and functionExtension to the function extension (XXX).
Main function values
The followingmainFunction values are relevant:
0= no type1= automatic input tax invoice (AV)2= automatic VAT invoice (AM)3= general function (F)4= collective function (S)6= collective function, automatic input tax (SAV)7= collective function, automatic VAT (SAM)8= standard function deactivated
GET /journalEntries and GET /trialBalance - Accounting reasons
When working with journal entries and trial balance data from DATEV Rechnungswesen, you may notice calculation discrepancies between the two datasets. This is because the two endpoints have a different data scope: journal entries cover all accounting areas, while the trial balance is restricted to a single accounting area (see below). These sections first explain the underlying DATEV concept (accounting areas), and then how this concept affects the data returned by the API.Background: DATEV accounting areas
This section describes how accounting areas work inside DATEV Rechnungswesen itself — independent of the API. Accounting reasons (Rechnungslegungszwecke) allow journal entries to be assigned to different accounting areas (Bereiche). Common use cases include:- Commercial law (Handelsrecht)
- Tax law (Steuerrecht)
- IFRS
- Other specialized accounting purposes
API data scope: What each endpoint returns
This section describes how the accounting areas above determine which data the API endpoints return. In the API, the journal entries batch is represented as an accounting sequence. Each journal entry references its batch through theaccountingSequenceId and it exposes the accounting area via the accountingReason field.
Important
- The
accounting_sequence_idandaccountingReasonare DATEV-specific field. They are not currently mapped to the unified model and are available in the raw response ofGET /journalEntries(GET /asyncTask) when usingrawData=true. - The
GET /trialBalanceresponse, in contrast, contains no accounting area oraccountingReasonfields at all: the amounts it returns are already implicitly restricted to accounting area 1 by DATEV. This restriction is applied before the data is returned and can neither be observed in the response nor changed via a request parameter
GET /trialBalance):
- Provides aggregated sums and balances per account
- These values are calculated exclusively from journal entries assigned to accounting area 1 (Bereich 1) — in the DATEV standard configuration, this is commercial law (Handelsrecht)
- However, users can rename or redefine accounting areas in DATEV Rechnungswesen (see DATEV Hilfe-Dokument 9226437. In that case, the trial balance still returns area 1, but area 1 may then represent tax law, calculation, or a custom-defined area
GET /journalEntries):
- Returns all journal entries, regardless of their accounting reason
- Provides detailed transaction-level data
Available accounting reasons
The followingaccountingReason values are possible:
commercial_law- Commercial/financial accounting (Handelsrecht)tax_law- Tax accounting (Steuerrecht)ifrs- International Financial Reporting Standardsreserved1- Reserved for future usereserved2- Reserved for future usefor_calculation- For calculation purposesindependent_from_accounting_reason- Independent from accounting reason
Calculate trial balance for target account number using GET /journalEntries
While you can retrieve trial balance data directly using theGET /trialBalance endpoint, you may want to verify or double-check the balance for a specific account number. To do this using journal entries:
Verification workflow (assumes the DATEV standard configuration, where area 1 = commercial law):
- Retrieve all journal entries using
GET /journalEntriesandGET /asyncTaskwithrawData=true - Filter entries for your target account number
- From the raw data, access the
accountingReasonfield attached to each journal entry - Select only entries with
accountingReasonequal tocommercial_law - Calculate the total for these filtered entries
- If the client has redefined accounting area 1 (e.g. to tax law, calculation, or a custom area), the trial balance reflects that redefined area. In this case, filter on the
accountingReasonthat corresponds to the client’s area 1 instead ofcommercial_law