> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maesn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve accounting data from DATEV Rechnungswesen

> Gain exclusive early access to reading data from DATEV

## Fetch data from Datev in 5 steps

**Required**: End users must have the `Datenservice Export Rechnungswesen` enabled in their DATEV accounts
Speak to your customer success manager at Maesn to learn how to enable this service.

<Steps>
  <Step title="Authorize end user" titleSize="h3">
    Your end user must first authorize your application to access their data in DATEV Rechnungswesen Export through [maesn Connect](/guides/maesn-connect).
  </Step>

  <Step title="Retrieve companies" titleSize="h3">
    Fetch all the companies associated to your end users's DATEV account using the GET [/companies](/api-reference/auth/get-companies) endpoint. The user will need to select a company to proceed, as the company ID will be needed for subsequent steps.
    Note that you can use the [interactive authentication flow](/authentication#interactive-authentication-flow) to eliminate this step.
  </Step>

  <Step title="Get user info (optional)" titleSize="h3">
    Fetch the user info associated to your end users's DATEV account using the GET [/userInfo](/api-reference/user-endpoints/user/user-info) endpoint. Display the retrieved information in your application's UI as required by DATEV (see 'general requirements' below).
  </Step>

  <Step title="Retrieve the data you need" titleSize="h3">
    Fetch the data you always dreamed of retrieving from the API instead of CSV exports:

    * Retrieve GL accounts using the GET [/accounts](/api-reference/accounting-endpoints/accounts/get-accounts) endpoint
    * Retrieve fiscal years through the GET [/fiscalYears](/api-reference/accounting-endpoints/fiscalyears/get-fiscal-years) endpoint
    * Retrieve booking data using the GET [/journalEntries](/api-reference/accounting-endpoints/journalentries/get-journal-entries) endpoint
    * Retrieve payment terms through the GET [/paymentTerms](/api-reference/accounting-endpoints/paymentterms/get-payment-terms) endpoint
    * Retrieve sums and balances for your accounts using the GET [/trialBalance](/api-reference/accounting-endpoints/trialbalance/get-trial-balance) endpoint
  </Step>

  <Step title="Check DATEV general requirements" titleSize="h3">
    Review the DATEV interface [requirements](https://developer.datev.de/en/guides/interface-requirements) to ensure that your application complies with DATEV’s specifications.
  </Step>
</Steps>

Optional:

<Steps>
  <Step title="Delete end user" stepNumber="0" titleSize="h3">
    If your user deletes their account, you may delete the end user from our API and revoke their token using the the POST [/delete-end-users](/api-reference/accounting-endpoints/tenants/delete-end-user). This step ensures both actions are handled on the backend.
  </Step>
</Steps>

## DATEV-Specific Technical Details

For technical insights and detailed explanations of DATEV-specific fields and behaviors (such as account functions, accounting reasons, and data relationships), [contact Maesn](https://www.maesn.com/contact/).
