The document import fails with the following error:
Nebyl nalezen záznam dle parametrů: stat=CZ.
The message isn't referring to the document itself, but to a code list — Flexi couldn't find the record referenced in your XML, because it only looks among records for the state specified on the document.
Typical cause
The document has a domestic statDph (code:CZ), but an item references a Slovak VAT return line by code — or vice versa. VAT return lines are maintained separately for each state, so a Slovak line won't be found under the Czech state.
The error relates to the field that caused it — it's listed in the response under the for attribute:
<error for="clenDph" messageCode="daoZaznamyParamNeexistuje">Nebyl nalezen záznam dle parametrů: stat=CZ.</error>
Solution
Use VAT lines for the same state as the one on the document — for a document with
statDph, this meanscode:CZCzech lines.If it's a Slovak document, specify
<statDph>code:SK</statDph>on it; then the Slovak lines will pass validation.If you reference the line by its internal number instead of its code, the state-based restriction won't apply — this is useful for debugging, when you need to determine whether the state is really the issue.
💡 The list of VAT lines along with their states can be retrieved from the cleneni-dph record: /c/{firma}/cleneni-dph.xml?detail=custom:id,kod,nazev,stat&limit=0.
