# Export and lock

> Office guide: preview, export and download the payroll file, then lock the period once payroll has processed it.

URL: https://timetracking.tech/developers/help/office/export-and-lock
Last updated: 2026-10-24

After approval, approved hours, leave and expenses go to payroll as a file. The export is final for the days it contains. Locking closes the period afterwards. Both steps are irreversible.

Developer background: [Export mappings](https://timetracking.tech/developers/data-out/export-mappings), [Presets](https://timetracking.tech/developers/data-out/presets), [Periods and locking](https://timetracking.tech/developers/concepts/periods-and-locking).

## What goes into an export

- Approved days in the period, split into hour types (normal, overtime, evening/night/weekend surcharges, public holiday) by your rule set ("Regelset" under "Regels & koppelingen"). See [Hour types and rule packs](https://timetracking.tech/developers/concepts/hour-types-and-rule-packs).
- Fixed allowances of the placement ("Looncomponenten en toeslagen").
- Approved expenses (km, travel time, public transport, parking, meals, other).
- Approved leave, working days only (Mon–Fri, excluding public holidays).

Draft and submitted days are **not** included. They stay in the week and go into a later export once approved.

## Steps

1. **Open "Export".** Select the week and the payroll format (export mapping), e.g. "SD Worx — variabele looncomponenten (concept)", "Generiek CSV (per dag)" (generic CSV per day) or one of your own formats. Your default format ("Standaard") is preselected.
2. **Preview.** Click "Toon voorbeeld" (show preview). You see the rows, the number of approved days included, and:
   - **Issues** (errors): required values missing, wrong format. Fix them first; the export is blocked while issues exist. Typical cause: an employee without an employee number ("Personeelsnummer", needed for payroll).
   - **Warnings**: compliance hints from the rule set, e.g. "Break 0 min, at least 30 min required". They do not block the export; check them.
   - **Pending**: days in the period that are not approved yet and therefore not included.
3. **Export.** Click "Download het bestand" (download the file). This creates the export run, and the included days become "exported". They can never be changed again.
4. **Download again if needed.** "Eerdere exports deze week" (earlier exports this week) lists every run with "Download" (the payroll file), "XLSX" and "JSON".
5. **Upload the file to payroll** (e.g. SD Worx). Wait until payroll has processed it.
6. **Lock the period** (admin only). Click "Periode vergrendelen" (lock period). This only works when every day with hours in the period is exported and no submitted or approved expenses are left ("Kan pas als alle uren in deze week zijn geëxporteerd").

## Export formats (admin)

Admins can make their own export formats, for example for Loket, Nmbrs or AFAS, or to fill in the real SD Worx wage codes. Click "Exportformaten beheren" (manage export formats) on the "Export" page.

1. Under "Nieuw exportformaat" (new export format), choose "Beginnen vanaf" (start from) a standard preset or an existing format, give it a "Naam" and click "Aanmaken en bewerken" (create and edit).
2. In "Exportformaat bewerken" (edit export format) set the file:
   - "Bestandstype" (file type): "CSV (.csv)" or "Tekst (.txt)";
   - "Scheidingsteken" (delimiter): "Puntkomma ;", "Komma ,", "Tab" or "Pipe |";
   - "Tekenset" (character set): "UTF-8", "UTF-8 met BOM (Excel)" or "Windows-1252";
   - "Regeleinde" (line ending): "Windows (CRLF)" or "Unix (LF)";
   - "Samenvoegen per" (group by): leave empty for one line per day and hour type, or pick fields such as employee number + hour type to sum per period. "Minuten en bedragen worden bij samenvoegen opgeteld" (minutes and amounts are added up).
3. Under "Kolommen" (columns), add a column per field of your payroll system's import file. For each column choose the "Bron" (source: "Personeelsnummer", "Naam medewerker", "Opdrachtgever", "Plaatsingsnummer", "Datum", "Uursoort", "Minuten (uren)", "Bedrag (centen)", "Soort (uren/vergoeding)" or a "Vaste waarde" fixed value) and an "Omzetting" (conversion), e.g. "Uren als decimaal (7,50)", "Uren als u:mm (7:30)", "Minuten (450)", "Bedrag in euro (12,34)", "Datumformaat", "Vertalen via codetabel", "HOOFDLETTERS", "Aanvullen tot vaste lengte".
4. Under "Codetabel: uursoort → looncomponent" (code table: hour type → wage component), enter the "Code in salarispakket" (code in your payroll package) for each hour type. Yellow codes are still placeholders ("Gele codes zijn nog plaatshouders"): replace them with the real codes from your payroll consultant.
5. Under "Validatie vóór export" (validation before export), add checks such as required columns or a "Patroon (regex)". Errors block the final export.
6. Check the "Live voorbeeld" (live preview, with sample rows) and save. Errors show as "Ongeldige mapping".
7. Back in "Exportformaten", click "Maak standaard" (make default) to preselect the format on the "Export" page.

Earlier exports stay downloadable: each run keeps a copy of the format it was made with ("Eerdere exports blijven downloadbaar"). A format can be deleted ("Verwijderen"). Only admins can create or change formats ("Alleen beheerders kunnen exportformaten aanmaken of wijzigen").

About "Windows-1252": the dashboard download ("Download" in "Eerdere exports") still delivers the file as UTF-8. The exact Windows-1252 file is available over the API: `GET /exports/runs/{id}/file` returns it with `charset=windows-1252`. Characters outside that character set (for example €, curly quotes, long dashes) become "?". If your payroll system needs Windows-1252, have the file fetched over the API, or check accented names after upload.

Export formats cannot be created over the API yet (Planned). The JSON structure is documented in [Export mappings](https://timetracking.tech/developers/data-out/export-mappings).

## Corrections after export

Exported and locked days never change. If an exported day was wrong, record the difference as a new entry in the current open week, with a note referring to the original date (for example "Correctie 1 dec: +0:30"). It goes into the next export.

## Common problems

| Message / problem | Cause | Fix |
|---|---|---|
| "Geen goedgekeurde uren in deze week." | Nothing approved yet | Approve days first ([Weekly close](https://timetracking.tech/developers/help/office/weekly-close)) |
| Export blocked: validation issue(s) | Missing employee number, unknown wage code, value out of range | Fix master data; an admin fixes wage codes or validation rules in the export format |
| "This period was just exported; refresh before exporting again" | Same week exported less than a minute ago | Refresh; check "Eerdere exports" before exporting again |
| "Nothing approved to export in this period" | Everything approved is already exported | Nothing to do, or approve the remaining days |
| Lock refused: "N day(s) in this period are not exported yet" | Approved, submitted or draft days with hours remain | Approve and export them, or ask the employee to remove empty drafts |
| Lock refused: expenses not exported | Submitted or approved expenses remain | Approve and export, or reject them |
| Hours in the SD Worx file show "[CODE_NORMAAL]" | Wage codes are placeholders in the concept preset | An admin copies the SD Worx preset in "Exportformaten beheren", fills in the real codes, and makes it the default |

## Automate it

[CLI](https://timetracking.tech/developers/tools/cli#tt-export): `tt export --week 2026-11-30` (preview) and `--commit -o file.csv`. Earlier runs and their exact files are available over the API: `GET /exports/runs` and `GET /exports/runs/{id}/file` ([API reference](https://timetracking.tech/developers/api/reference)). Locking over the API needs an `admin`-scope key (`tt lock --week … --yes`); otherwise lock in the dashboard.
