You cannot send a new currency and an invoice referencing it in a single XML. The import will fail with an error:
Nepodařilo se načíst kurz platný k datu '11.09.2026'.
HibernateException: object references an unsaved transient instance
At the time the invoice is processed, the currency has not yet been saved, so Flexi cannot look up its exchange rate.
Solution
Split the import into two requests — first the currency, then the document:
<winstrom version="1.0">
<mena>
<kod>XYZ</kod>
<nazev>Nová měna</nazev>
<kurz>25.0</kurz>
<jednotka>1</jednotka>
</mena>
</winstrom>
In the second request, you can then reference the currency as usual:
<winstrom version="1.0">
<faktura-vydana>
<typDokl>code:FAKTURA</typDokl>
<mena>code:XYZ</mena>
<kurz>25.0</kurz>
<bezPolozek>true</bezPolozek>
<sumZklZaklMen>100.0</sumZklZaklMen>
</faktura-vydana>
</winstrom>
⚠️ For a document in a foreign currency, the exchange rate is required — without it, the import will fail with the message U dokladu v cizí měně musí být vyplněn kurz. In addition, amounts must be entered in fields with the Men suffix (sumZklZaklMen, sumCelkemMen); Flexi will automatically calculate the domestic-currency equivalents using the exchange rate.
💡 Another option is to create the currency in a single XML together with an invoice that does not yet use it, and only issue a document in this currency in a subsequent request. Exchange rates can also be maintained separately in the kurz records.
