Skip to content

REST API for developers

Guide: export for your tax advisor

The invoices of a period as a ZIP with all files and an overview, e.g. automatically each month.

Contents

Goal and prerequisites

At the end, you have a ZIP with the invoices of a month that you can pass on to your tax advisor, the same export as in the web application.

  • A plan with the export for your tax advisor: Starter, Pro, Business (see pricing).
  • An API key in the environment variable API_KEY; curl, jq and unzip, or Python 3 with requests.
  • Invoices in your account: created and exported via the API or the web application, or imported incoming invoices (Guide: invoice lifecycle).
  • The export counts towards no quota.

1. Check the plan

permissions.tax_advisor_export in GET /api/v1/account/ shows whether your plan includes the export.

curl (Shell)
curl -sS "https://www.e-rechnungsfreund.de/api/v1/account/" \
  -H "Authorization: Api-Key $API_KEY" \
  | jq '.permissions.tax_advisor_export'
Python (requests)
import os

import requests

BASE_URL = "https://www.e-rechnungsfreund.de"
HEADERS = {"Authorization": f"Api-Key {os.environ['API_KEY']}"}

account = requests.get(f"{BASE_URL}/api/v1/account/", headers=HEADERS, timeout=30)
account.raise_for_status()
if not account.json()["permissions"]["tax_advisor_export"]:
    raise SystemExit("The plan does not include the export for the tax advisor.")

Without the permission, the export in step 2 is answered with 403:

Example response: POST /api/v1/exports/tax-advisor/ → 403 Forbidden
JSON
{
  "type": "https://www.e-rechnungsfreund.de/api/errors/permissiondenied",
  "title": "PermissionDenied",
  "status": 403,
  "detail": "Your current plan does not include the export for your tax advisor."
}

2. Request the export

POST /api/v1/exports/tax-advisor/ with the period date_from and date_to (invoice date, both inclusive, at most 366 days) and direction: both (default), outgoing or incoming.

curl (Shell)
DOWNLOAD_URL=$(curl -sS -X POST "https://www.e-rechnungsfreund.de/api/v1/exports/tax-advisor/" \
  -H "Authorization: Api-Key $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date_from": "2026-10-01", "date_to": "2026-10-31", "direction": "both"}' \
  | jq -r .download_url)
Python (requests)
export = requests.post(
    f"{BASE_URL}/api/v1/exports/tax-advisor/",
    json={
        "date_from": "2026-10-01",
        "date_to": "2026-10-31",
        "direction": "both",
    },
    headers=HEADERS,
    timeout=30,
)
if export.status_code == 429:
    raise SystemExit(f"Started too recently, retry in {export.headers['Retry-After']} s")
export.raise_for_status()  # 403 = plan without the export, 400 = invalid period
link = export.json()
print(link["invoice_count"], "invoices, valid until", link["expires_at"])
Example response: POST /api/v1/exports/tax-advisor/ → 200 OK
JSON
{
  "export": "tax_advisor",
  "invoice_count": 2,
  "filename": "steuerberater_2026-10-01_2026-10-31_both.zip",
  "download_url": "https://www.e-rechnungsfreund.de/api/v1/downloads/tax-advisor-export/a4ba056c-b2d9-4f13-8daa-3e34b81bb1f9/?token=…",
  "expires_at": "2026-11-02T08:05:00.000000Z",
  "single_use": true,
  "date_from": "2026-10-01",
  "date_to": "2026-10-31",
  "direction": "both"
}
  • The response contains no file but download_url, a signed link to the ZIP. invoice_count is the number of invoices in the period.
  • At most one export every 60 seconds; otherwise 429 with Retry-After.

3. Download the ZIP

Open the link without an API key. It can be used once and expires after 5 minutes (expires_at); then request a new export.

curl (Shell)
# no API key: the link itself grants access, once
curl -sS --fail-with-body -o tax-advisor-export.zip "$DOWNLOAD_URL"
Python (requests)
archive = requests.get(link["download_url"], timeout=300)  # no API key
archive.raise_for_status()
with open(link["filename"], "wb") as f:
    f.write(archive.content)

Do not log the link or pass it on: until it is used, anyone with the link can download the ZIP.

4. Check the contents

curl (Shell)
unzip -l tax-advisor-export.zip
Python (requests)
import zipfile

with zipfile.ZipFile(link["filename"]) as zf:
    for name in zf.namelist():
        print(name)
  • ausgehend/: the stored ZUGFeRD PDF or XRechnung XML of each outgoing invoice.
  • eingehend/: the original file of each incoming invoice.
  • uebersicht.csv: one line per invoice in the period, also for invoices without a stored file (with a note in the last column).

Columns of the overview: Invoice number, Invoice date, Direction, Party, Net, VAT, Gross, Currency, Status, Paid on, File name, Note

The ZIP is put together from the stored files; no invoice is created or exported again. An outgoing invoice without a generated file is listed in the overview, but has no file in the ZIP.

Complete script on GitHub: tax_advisor_export.sh, tax_advisor_export.py

Next steps