[sevDesk](https://sevdesk.de) is an accounting software in which you write your invoices. Once X-Sitter knows your sevDesk account, you transfer the statement of a [client billing](/billing/client-billing.md) to sevDesk with one click: it appears there as a **draft invoice** with all lines – nothing to type twice.

On the page **Accounting › sevDesk** (*Buchhaltung › sevDesk*) you store the API token of your sevDesk account, choose the defaults for the invoices and assign each client its contact in sevDesk.

![Screenshot: sevDesk page with the cards "Connection" (API token, Test Connection, contact person) and "Defaults for invoices" (tax rule, unit of the positions)](/accounting/images/sevdesk-connection.png)

## Before you start
- Your user needs the permissions **Accounting** (*Buchhaltung*) and **sevDesk** in the area **Accounting** of the rights tree. Users who already had the permission **sevDesk export** (*sevDesk-Export*) of the client billing got it automatically – otherwise ask your administrator.
- You need a sevDesk account and its **API token**: in sevDesk under *Einstellungen › Benutzer*, at the user, field *API-Token* (32 characters).
- Your clients exist as contacts in sevDesk. It is easiest if the sevDesk customer number of a contact is the customer number of the client in X-Sitter – then X-Sitter assigns them for you.

## Step by step

### 1. Connect sevDesk
1. Open **Accounting › sevDesk** (*Buchhaltung › sevDesk*).
2. In the card **Connection** (*Verbindung*), enter the **API token** (*API-Token*).
3. Click **Test Connection** (*Verbindung testen*). If the token works, you see "Connection OK: n users, n units, n contacts" (*Verbindung steht: … Benutzer, … Einheiten, … Kontakte*).
4. Click **Save** (*Speichern*) at the bottom of the page. The token is stored encrypted and never shown again; the field then shows "saved (•••• last 4 characters)". Leave the field empty to keep the stored token.

After saving, the selection fields are filled from your sevDesk account.

### 2. Set the defaults for invoices
1. In the card **Connection**, choose the **Contact person (sevDesk user)** (*Ansprechpartner (sevDesk-Benutzer)*). sevDesk needs this field – the user is named on the invoice as contact person.
2. In the card **Defaults for invoices** (*Vorgaben für Rechnungen*), choose the **Tax rule** (*Steuerregel*) of your invoices, e.g. *1 – Umsatzsteuerpflichtige Umsätze*. The tax rate of every line comes from the statement.
3. Choose the **Unit of the positions** (*Einheit der Positionen*), e.g. *Stück*.
4. Click **Save**.

### 3. Assign the sevDesk contacts
The card **Clients → sevDesk contacts** (*Mandanten → sevDesk-Kontakte*) lists all your active clients with their customer number.

1. Click **Assign by customer number** (*Per Kundennummer zuordnen*). Every client without a contact gets the sevDesk contact with the same customer number. You see "n clients have been assigned by customer number." (*… Mandanten wurden über die Kundennummer zugeordnet.*). A number that exists more than once in sevDesk stays open.
2. For the remaining clients, choose the **sevDesk contact** (*sevDesk-Kontakt*) in the list. **not mapped** (*nicht zugeordnet*) removes the assignment.
3. Click **Save**. You see "The settings have been saved" (*Die Einstellungen wurden gespeichert*).

![Screenshot: Card "Clients → sevDesk contacts" with clients, customer numbers, the assigned sevDesk contacts and the button "Assign by customer number"](/accounting/images/sevdesk-contacts.png)

Only clients with a sevDesk contact get the sevDesk buttons on their billing. Clients you do not invoice via sevDesk simply stay **not mapped**.

### 4. Transfer statements
Open the [client billing](/billing/client-billing.md#hand-the-statement-over-to-sevdesk) of the client, load the statement and click **Transfer to sevDesk** (*An sevDesk übertragen*). The draft invoice is created in sevDesk; you check, finalize and send it there.

The card **Latest transfers** (*Letzte Übertragungen*) lists the last 20 transfers with date, client, the number of the statement in X-Sitter and a link to the invoice in sevDesk.

![Screenshot: Card "Latest transfers" with date, client, statement number and the link to the invoice in sevDesk](/accounting/images/sevdesk-transfers.png)

## Fields and options
| Field | Meaning | Required |
|---|---|---|
| **API token** (*API-Token*) | Token of a sevDesk user. Stored encrypted; empty = keep the stored token. **Remove token** (*Token entfernen*) deletes it after a confirmation – transfers are no longer possible then. | yes |
| **Contact person (sevDesk user)** (*Ansprechpartner (sevDesk-Benutzer)*) | sevDesk user named on the invoice. If sevDesk cannot be reached, enter the user ID. | yes, for transfers |
| **Tax rule** (*Steuerregel*) | Tax rule of every invoice: 1 taxable sales (default), 2 exports, 3 intra-community supplies, 4 tax-free sales §4 UStG, 5 reverse charge §13b UStG, 11 small business §19 UStG. | yes |
| **Unit of the positions** (*Einheit der Positionen*) | sevDesk unit of all lines, from your account (default *Stück*). | yes |
| **sevDesk contact** (*sevDesk-Kontakt*) | Contact (organisation or person) the client is invoiced to. "(no longer in sevDesk)" (*nicht mehr in sevDesk*) marks a stored contact your account no longer has. | for every client you invoice via sevDesk |

## What the draft invoice contains
- Invoice type *RE* (normal invoice), status **draft**, currency EUR.
- Invoice date = date of the statement, delivery period = service period of the statement; header text "Leistungszeitraum DD.MM.YYYY - DD.MM.YYYY".
- One line per line of the statement with net price and its tax rate.
- sevDesk assigns the invoice number. The number of the statement and the customer number in X-Sitter are in the internal note of the invoice.
- Sending and finalizing happens in sevDesk.

## Good to know / Troubleshooting
- The lists of users, units and contacts are read live from sevDesk every time you open the page. A contact you create in sevDesk is available after reloading the page.
- A statement is only transferred again after you confirm it, so no invoice is created twice by accident.

| Message | Cause | Solution |
|---|---|---|
| No authorization (*Keine Berechtigung*) | The permission **sevDesk** is missing. | Ask your administrator. |
| *sevDesk antwortet nicht: … HTTP 401 …* (sevDesk does not answer) | The token is wrong or was revoked in sevDesk. | Check the token in sevDesk, enter it again and click **Test Connection**. |
| *Bitte zuerst einen API-Token eingeben.* (enter an API token first) | **Test Connection** with an empty field and no stored token. | Enter the token. |
| *Hinterlege zuerst den sevDesk-Token.* (store the sevDesk token first) | **Assign by customer number** without a stored token. | Save the token first. |
| "0 clients have been assigned by customer number." | The customer numbers differ or exist more than once in sevDesk. | Maintain the customer numbers in sevDesk or choose the contact by hand. |
| *Die Einstellungen wurden gespeichert, sevDesk war aber nicht erreichbar: …* (saved, but sevDesk could not be reached) | sevDesk did not answer while saving. | The settings are saved; the names of unit and contact person appear after the next successful load. |
