The ABRA Flexi REST API offers an equivalent of invoking the Accounting → Initialize Next Period menu. The initialization can be called repeatedly, just as in the desktop application.
How to Call the Service
The service is available via the method GET at /c/{firma}/ucetni-obdobi/inicializace-noveho-obdobi.{přípona}, with supported formats being json and xml.
GET https://demo.flexibee.eu/c/demo/ucetni-obdobi/inicializace-noveho-obdobi.json
If the following accounting period does not exist, a 400 is returned with code uzaverkaNeexistujeNasledujici:
{
"winstrom": {
"@version": 1,
"success": false,
"message": "Neexistuje následující účetní období. Prosím založte ho."
}
}
Once the accounting period has been created, the initialization can be called repeatedly.
Required Parameters
Parameter | Meaning | Required Account Type |
| Ledger opening account |
|
| Ledger closing account |
|
| Profit/loss transfer account |
|
| Profit/loss pending approval account |
|
The expected values are account codes from the chart of accounts that have the corresponding druhUctuK value — for example ucetZav=702000. You can also specify the prefixed form, i.e. ucetZav=code:702000. For more information on the account type, see the /ucet record.
ℹ️ For companies using tax records (daňová evidence), the double-entry accounting account parameters are not required.
If any of the required parameters is missing, a 400 is returned with code missing_param_exception:
{
"winstrom": {
"@version": 1,
"success": false,
"message": "K provedení operace je vyžadován parametr 'ucetOtv'"
}
}
If an incorrect account was selected (for example ucetZav=701000), the following error is returned:
{
"winstrom": {
"@version": 1,
"success": false,
"message": "Parametr 'ucetZav' má nepodporovanou hodnotu! Zvolte jednu z následujících možností: [Zvolený účet musí mít druhUctuK 'druhUctu.uzavknih']"
}
}
Optional Parameters
ucetniObdobi— the identifier of the period to be closed. If not specified, the current period is closed.preceneni— perform revaluation of bank accounts and cash registers as well as revaluation of unpaid documents (true/false).preceneniNeuhrazenychDokladu— perform revaluation of unpaid documents only (true/false).preceneniBankAPokladen— perform revaluation of bank accounts and cash registers only (true/false).preceneniVynechatBanAPokSChybnouMenou— exclude banks and cash registers with transactions in an unsupported currency from revaluation (true/false).prevodSkladu— perform stock transfer (true/false).vynechatNulove— skip cards with a zero balance (true/false).dnyBezPohybu— number of days without movement for exclusion (whole number).zrusitStare— remove unused old cards in the new accounting period (true/false).typDokl— document type for generating liabilities from lease installments.kontrolaZaokrouhleni— the valuefalsesuppresses the VAT rounding check on document types.kurz[KOD_MENY]andkurzMnozstvi[KOD_MENY]— exchange rate for revaluation.
The default value for all boolean parameters is false.
📝 The Confirm card exclusion option available in the desktop application is not supported by the REST API.
Rounding Check
If any document types have non-standard rounding settings, the following error is returned:
{
"winstrom": {
"@version": 1,
"success": false,
"message": "Následující typy dokladů mají nestandardně nastavené zaokrouhlení DPH (očekávané je zaokrouhlení na setiny nebo jednotky, viz § 37 ZDPH):\nFAKTURA: nastaveno \"0.1\"\nOBP: nastaveno \"0.1\"\nNásledující typy dokladů mají nestandardně nastavený způsob zaokrouhlení DPH (očekávané je zaokrouhlení matematicky, viz § 37 ZDPH):\nFAKTURA: nastaveno \"nahoru\"\nOBP: nastaveno \"nahoru\"\nZÁLOHA: nastaveno \"nahoru\""
}
}
This error can be suppressed with the kontrolaZaokrouhleni=false parameter (equivalent to clicking the Yes button in the desktop application), or you can fix the rounding on the document types.
Document Type Check
If liabilities exist for the following accounting period, the typDokl parameter is required. If it is not specified in that case, the following error is returned:
{
"winstrom": {
"@version": 1,
"success": false,
"message": "K provedení operace je vyžadován parametr 'typDokl'"
}
}
The selected document type must have a document series saved:
{
"winstrom": {
"@version": 1,
"success": false,
"message": "Vyplněný typ dokladu nemá zadanou řadu dokladu a žádná není specifikovaná."
}
}
The document type series must then have an annual numbering series entry saved for the following accounting period:
{
"winstrom": {
"@version": 1,
"success": false,
"message": "Vybraná řada typu dokladu nemá zadanou roční položku číselné řady k následujícímu účetnímu období."
}
}
Exchange Rate Check for Revaluation
If document revaluation is enabled via the preceneni=true parameter, a check of the exchange rates for revaluation follows. Before calling the initialization, you can call a subresource that returns a list of currencies with the rate that will be used for revaluation:
GET https://demo.flexibee.eu/c/demo/ucetni-obdobi/meny-pro-preceneni.json
Optionally, you can add the ?ucetniObdobi=IDENTIFIKÁTOR_OBDOBÍ parameter. If the exchange rate or rate amount is missing for any currency (i.e., it is 0.0), it must be entered when initializing the period.
Sample response
{
"meny-pro-preceneni": {
"datumPreceneni": "2024-12-31T00:00:00+01:00",
"meny": {
"mena": [
{
"symbol": "",
"kod": "DEM",
"kurz": "0.0",
"kurzMnozstvi": "1.0"
},
{
"symbol": "€",
"kod": "EUR",
"kurz": "24.725",
"kurzMnozstvi": "1.0"
},
{
"symbol": "",
"kod": "THB",
"kurz": "65.107",
"kurzMnozstvi": "100.0"
}
]
}
}
}
During initialization, the system will attempt to download revaluation exchange rates from the central bank. The exchange rate can also be defined using URL parameters in the form ?kurz[KOD_MENY]=HODNOTA_KURZU&kurzMnozstvi[KOD_MENY]=HODNOTA_KURZOVEHO_MNOZSTVI:
GET https://demo.flexibee.eu/c/demo/ucetni-obdobi/inicializace-noveho-obdobi.json?…&preceneni=true&kurz[EUR]=24.52&kurzMnozstvi[EUR]=1.0&kurz[HUF]=6.12&kurzMnozstvi[HUF]=100.0
Both values — the rate and the rate amount — must be specified for each currency. The saved values can then be found in the /c/{firma}/kurz-pro-preceneni record by the combination of platiOdData and mena.
If any exchange rates are missing during initialization, an error is returned listing the missing currencies:
{
"winstrom": {
"@version": 1,
"success": false,
"message": "Nebyly zadány všechny potřebné kurzy platné k poslednímu dni účetního období,\nkteré jsou nutné pro přecenění neuhrazených pohledávek/závazků:\nEUR: Euro, USD: Americký dolar"
}
}
Transactions in an Incorrect Currency
If revaluation of bank accounts and cash registers is enabled via the preceneni=true or preceneniBankAPokladen=true parameter, all transactions in the revalued bank accounts and cash registers are checked. If a transaction is found in a currency other than the domestic currency or the currency in which the bank or cash register is maintained, the following error is returned:
{
"winstrom": {
"@version": 1,
"success": false,
"message": "Následující bankovní účty a pokladny nelze přecenit:\n• <seznam všech chybných bank nebo pokladen>\nPřeceňovány mohou být pouze bankovní účty a pokladny, které mají pohyb v měně, ve které jsou vedeny nebo v tuzemské měně."
}
}
This error can be suppressed with the preceneniVynechatBanAPokSChybnouMenou=true parameter — all incorrect banks and cash registers will then be excluded from the revaluation calculation.
Example Call No. 1
1. First, we call the currencies for revaluation
GET https://demo.flexibee.eu/c/demo/ucetni-obdobi/meny-pro-preceneni.json?ucetniObdobi=2024
2. If the query returns currencies without a rate, we save the rate
POST https://demo.flexibee.eu/c/demo/kurz.json
The request body for the /kurz record might look like this:
{
"winstrom": {
"kurz": {
"platiOdData": "2024-12-31",
"nbStred": "25.75",
"kurzMnozstvi": 1,
"mena": "code:EUR"
}
}
}
3. Then we perform the initialization
GET https://demo.flexibee.eu/c/demo/ucetni-obdobi/inicializace-noveho-obdobi.json?ucetniObdobi=2024&ucetOtv=701000&ucetZav=702000&ucetPre=710000&ucetVys=431001
Example Call No. 2
Initialization can also be performed directly with the exchange rate filled in:
GET https://demo.flexibee.eu/c/demo/ucetni-obdobi/inicializace-noveho-obdobi.json?ucetniObdobi=2024&ucetOtv=701000&ucetZav=702000&ucetPre=710000&ucetVys=431001&preceneni=true&kurz[EUR]=25&kurzMnozstvi[EUR]=1
Result
If the initialization has all the required data, it starts a background process and returns status 202 Accepted. You can check the /c/{firma}/ucetni-obdobi resource to see whether the initialization has finished — the lastUpdate item of the current accounting period is updated.
