Skip to content

Export internal bookkeeping

Internal bookkeeping export turns the period’s internal vouchers into an SIE file plus a PDF report. Generation is synchronous, so the file is ready to list as soon as the call returns.

  1. Generate the internal file. Requires GenerateInternalBookkeepingFile. Body is { type, fromDate, toDate } - type is the internal export type (e.g. SIE).

    Terminal window
    curl -X PUT "https://$HOST/bookkeeping-files/internal/generate" \
    -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
    -d '{ "type": "SIE", "fromDate": "2026-01-01", "toDate": "2026-01-31" }'

    This produces one BookkeepingFile record (status CREATED) covering the period’s not-yet-exported internal vouchers, with the SIE document and a PDF report attached.

  2. Find the generated file. List or search bookkeeping files (ReadBookkeepingFiles / SearchBookkeepingFiles) and read one by id (ReadBookkeepingFile):

    Terminal window
    curl "https://$HOST/bookkeeping-files" -H "Authorization: Bearer $JWT"

    The BookkeepingFile record carries both the document ids and the document file names:

    FieldHolds
    documentFileNameFile name of the SIE export file - use this to download.
    documentReportFileNameFile name of the PDF report that summarizes the export - use this to download.
    documentIdInternal id of the SIE document.
    documentReportIdInternal id of the PDF report document.
    documentFileNameRaw / documentReportFileNameRawOriginal (raw) file names.
  3. Download from the storage API. Pass the file name from the record to GET /storage/<fileName>. The file name is the reference - there is no separate document-download call.

    Terminal window
    # The SIE export file
    curl "https://$HOST/storage/$DOCUMENT_FILE_NAME" \
    -H "Authorization: Bearer $JWT" -o export.sie
    # The PDF summary report
    curl "https://$HOST/storage/$DOCUMENT_REPORT_FILE_NAME" \
    -H "Authorization: Bearer $JWT" -o report.pdf
  4. Mark it exported once you have pulled it, so it is not re-included next time. Requires ExportBookkeepingFile; only valid while the file is CREATED.

    Terminal window
    curl -X PUT "https://$HOST/bookkeeping-files/$FILE_ID/export" \
    -H "Authorization: Bearer $JWT"

How a client’s bookkeeping is exported is configured on the client. Read it with GET /clients/<id>/settings/bookkeeping and update it with PUT /clients/<id>/settings/bookkeeping (UpdateClients). The body nests the export configuration under an export object:

Terminal window
curl -X PUT "https://$HOST/clients/$CLIENT_ID/settings/bookkeeping" \
-H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{
"export": {
"method": "SIE",
"voucherSeries": "A",
"invoiceActivation": true,
"invoicePayment": true,
"invoicePaymentMethod": "...",
"invoicePaymentTolerance": true,
"invoiceRecourse": false,
"payout": true,
"bill": true
}
}'

export.method selects the export format and export.voucherSeries the voucher series; the boolean flags control which event types are exported. clientId and bookkeepingAccountsId are read-only and not accepted on PUT.