# DATEV verbinden

`GET https://{tenant}.stamp.eu/rest/datev/connect`

Returns the DATEV OAuth2 authorization URL.
The frontend redirects the user to this URL.

The connection data (Beraternummer, Mandantennummer, etc.) is stored in
cache until the callback processes it. The callback happens on the
central callback domain and redirects back to the tenant frontend.

## Query-Parameter

| Name | Typ | Pflicht |
| --- | --- | --- |
| `berater_nummer` | string | ja |
| `mandanten_nummer` | string | ja |
| `target_system` | `lug`, `lodas` | ja |
| `notification_email` | string \| null | nein |

## Antworten

### 200

| Feld | Typ | Pflicht |
| --- | --- | --- |
| `url` | string | ja |
| `redirect_uri` | string | ja |

### 401: Unauthenticated

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `message` | string | ja | Error overview. |

### 422: Validation error

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `message` | string | ja | Errors overview. |
| `errors` | object | ja | A detailed description of each field that failed validation. |
