An import template describes how the columns of a customer's order file (CSV or Excel) are mapped to the order fields of X-Sitter. You create the template once with a sample file. After that, you can [import](/orders/import-orders.md) as many files in this format as you like.

![Screenshot: Page "Create / edit template" with configuration, data preview and field mapping](/orders/images/order-import-templates-create.png)

## Before you start
- Your user needs the permission to edit order import templates. Ask your administrator.
- Optional: the client the template should be used for. See [Clients](/company/clients.md).
- A sample file from the customer (.csv or .xlsx).

## Step by step

### Create a template
1. Open **Orders › Create template** (*Aufträge › Vorlage erstellen*).
2. Under **Configuration** (*Konfiguration*) choose **Load template** (*Vorlage laden*) to change an existing template, or create a new one (*Neue Vorlage erstellen*).
3. Choose the **Import file (.csv, .xlsx)** (*Import-Datei (.csv, .xlsx)*).
4. In **Skip lines (Start)** (*Zeilen überspringen (Start)*) enter the number of lines before the header line that are ignored.
5. For CSV files open **Advanced CSV Settings** (*Erweiterte CSV-Einstellungen*) if needed: **Separator** (*Trennzeichen*, default `;`), text delimiter (*Text-Begrenzer*, default `"`) and **Escape** (default `\`).
6. Click **Load preview** (*Vorschau laden*). The **Data Preview** (*Daten-Vorschau*) shows the file. The structure is recognised automatically:
   - **Rows** (*Zeilen*) – the first line is the header, every following line is one order line.
   - **Block** – the first column marks head and position lines, usually with `HEAD`/`H` and `POS`/`P`.
7. Under **Field mapping** (*Feld-Zuordnung*) assign the columns of the file to the X-Sitter fields (see table below).
8. Enter a **Template name** (*Vorlagenname*), for example "Format customer Miller".
9. In **Client Assignment** (*Zuweisung Mandant*) choose the client the orders belong to, or **General / No assignment** (*Allgemein / Keine Zuweisung*).
10. Click **Save template** (*Vorlage speichern*).

![Screenshot: Configuration block with file, skip lines and the opened advanced CSV settings](/orders/images/order-import-templates-configuration.png)

![Screenshot: Field mapping with columns assigned to order number, SKU and quantity](/orders/images/order-import-templates-mapping.png)

### Manage templates
Open **Orders › Import - Templates** (*Aufträge › Import - Vorlagen*). The list shows **Name**, **Structure** (*Struktur*: block or rows), **created** (*erstellt*) and **updated** (*aktualisiert*). Actions:
- **Use** (*Benutzen*) – opens the [upload](/orders/import-orders.md) with this template preselected.
- Edit – opens the template.
- **Delete** (*Löschen*) – asks whether the template should really be deleted permanently.

![Screenshot: Template overview with the "Use" and "Delete" actions](/orders/images/order-import-templates-list.png)

## Fields and options

| Field | Meaning | Required |
|---|---|---|
| **Order number** (*Auftragsnummer*) | Groups the lines into orders. Rows without an order number are skipped. | yes |
| **Order number (external)** (*Bestellnummer (Extern)*) | The customer's or shop's order number. | no |
| **Order date** (*Auftragsdatum*) | Date of the order; different date formats are recognised. | no |
| **Customer number** (*Kundennummer*) | Customer number of the recipient. | no |
| **Shipping method** (*Versandart*) | Carrier name, max. 32 characters. | no |
| Delivery address: company, first name, last name, street, addition, postcode, city, country (ISO 2-letter), country (name), e-mail, phone (*Lieferadresse: …*) | The recipient. | no |
| **Remarks** (*Bemerkungen*) | Remark for the order. | no |
| **Position**, **Item Number (SKU)** (*Artikelnummer (SKU)*), **EAN**, **Item description** (*Artikelbezeichnung*), **Quantity** (*Menge*) | The order lines. | – |

## Good to know / Troubleshooting

| Message | Cause | Solution |
|---|---|---|
| **No file uploaded** (*Keine Datei hochgeladen*) | No file chosen. | Choose a file. |
| **There are no templates available yet** (*Es sind noch keine Vorlagen vorhanden*) | No template exists. | Create a template. |
| *Bitte Vorlage wählen oder speichern* | You tried to import without a saved template. | Save the template first. |

!!!
A template without a client assignment creates the orders for your own company. If several clients send the same file format, create one template per client so the orders land with the right client.
!!!
