A change in exchange rate on a foreign-currency document does not automatically update the amounts in the domestic currency. For Flexi to recalculate the document, the previous value must be submitted along with the new one — the previousValue attribute.
Writing the request
{
"winstrom": {
"faktura-vydana": [{
"id": "code:FAKTURA123",
"kurz": "24.645",
"kurz@previousValue": "24.70",
"datVyst": "2026-05-28",
"datVyst@previousValue": "2026-06-18"
}]
}
}
🚨 Without previousValue, the exchange rate change will not be saved at all. The request will complete with success=true, but the rate and amounts will remain unchanged — the document will silently keep its original value. When the previous value is provided, the rate is changed and the domestic-currency amounts are recalculated (on the test document of 100 in foreign currency: rate 25 → base 2,500 CZK, after changing to rate 30 → 3,000 CZK).
Why it works this way
The previousValue attribute triggers a reaction to change in ABRA Flexi — that is, the same logic that runs when a user overwrites the value in the application. Without it, fields with linked recalculation won't reflect the change, since the system has no reason to trigger the recalculation.
In XML it is written as an attribute; in JSON as an additional key:
XML: <kurz previousValue="24.70">24.645</kurz>
JSON: "kurz": "24.645", "kurz@previousValue": "24.70"
(funguje i tvar "kurz-previousValue")
ℹ️ You can specify multiple previous values in a single request. If the amounts don't recalculate the way you expect, the cause is often a rounding item — for documents with items, the total sum is checked.
