---
title: "Create a DATEV export"
description: "DATEV exports API"
---

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

# Create a DATEV export

{/* Generated by apps/docs/scripts/generate.ts from contracts/api/openapi.yaml. Do not edit. */}
<div class="cvo-op">
<div class="cvo-op-main">

<div class="cvo-op-header">
<div class="cvo-op-path-row">
<span class="cvo-method" data-method="post">POST</span>
<code class="cvo-op-path-code">/v1/datev-exports</code>
</div>
</div>

Exports the invoices of one period to DATEV: one EXTF CSV (`datev-extf`), or one invoice data package (`datev-ledger`) split into as many parts as DATEV's limits require.

The export takes the invoices of one direction whose Invoice issue date (BT-2) is in the range. It runs in the background. The response is the export's id. `GET /v1/datev-exports/{id}` shows the outcome: each invoice written, or left out with the writer's code and reason, and the gate's verdict on each. Fetch the files from `GET /v1/datev-exports/{id}/download`.

An invoice you issued goes into the file only with an accepting verdict. An invoice you received goes in whatever the verdict, because it is the sender's invoice and yours to book; its `verdict` says when the gate rejected it.

### What is taken

- By default, only invoices not yet exported. DATEV does not detect duplicate imports.
- With `includeExported: true`, invoices that an earlier, successful export of the same format already holds are taken again and marked `resent`.
- For an edited invoice, only the newest version.

### Corrections

A correction is an invoice with a confirmed class (`PUT /v1/invoices/{id}/correction`), or a newer version of an exported invoice. It is booked against the version of the original that an earlier export of the same format holds, and never changes that booking:
- `non-financial`: nothing is booked.
- `financial`: the difference only.
- `replacement`: the original is reversed, and the correction is booked as a new invoice.

In the CSV, the original's invoice number is in Belegfeld 1 and the correction's in Belegfeld 2 (when it has 12 characters or fewer). In the package, a reversal or a lower difference is a negative amount under the original's invoice number.

When the original went out only in the other format, or in an export that has not finished, the export answers 409 `reconciliation_needed` with the list in `reconcile`. Ask again with their ids in `reconciled` to take them. A newer version of an exported invoice with no confirmed class is listed the same way; confirmed here, it is booked as a replacement.

### Refused before anything is recorded

- A CSV without DATEV settings.
- A CSV range that crosses the start of a fiscal year (one CSV holds one fiscal year).
- A range with nothing to export.
- Corrections whose original's way to DATEV is not confirmed (`reconciliation_needed`).

## Request body

`application/json`, required

## Response

A `202` answer carries these fields.

## Status codes

| Status | Meaning |
|---|---|
| `202` | The export was recorded and queued. The file is not in the response. |
| `400` | The body is not a valid export request (`invalid_datev_export`), or a CSV range crosses the start of a fiscal year (`range_crosses_fiscal_year`, the message says where to split it). Nothing was recorded. |
| `401` | No usable credential was sent (`invalid_credentials`). |
| `409` | A CSV was requested without DATEV settings (`no_datev_settings`), the range has nothing to export (`nothing_to_export`), or corrections need confirming (`reconciliation_needed`, with the list in `reconcile`). Nothing was recorded. |

</div>
<div class="cvo-op-aside">

</div>
</div>

Source: https://docs.certinvo.com/reference/api/datev-exports/create-a-datev-export/index.mdx
