Skip to main content

Company Settings - API

How to Create a New Company Setting Effective from a Specific Date via REST API, or a New Initial Setting Before an Existing One

Written by Petr Pech

Company settings, which you can find in the app under Company → Settings, are managed in ABRA Flexi based on validity periods — each record in the nastaveni evidence is valid from a specific date. Via the REST API, you can both read the settings and create additional settings valid from a chosen date, as well as new initial settings preceding an already existing one.


Retrieving company settings

Settings are available in both XML and JSON. You can get the full content with full detail level using the GET method:

GET /c/{firma}/nastaveni.xml?detail=full

The XML output looks as follows:

<?xml version="1.0" encoding="utf-8"?>
<winstrom version="1.0">
<!-- Nastavení -->
<nastaveni>
<!-- ID (celé číslo) -->
<id>1</id>
<!-- Poslední změna (datum a čas) -->
<lastUpdate>2020-12-08T15:49:29.868+01:00</lastUpdate>
<!-- Změny budou platné od data (datum) -->
<platiOdData></platiOdData>
<!-- Jméno (řetězec) - max. délka: 255 -->
<nazFirmy>Demo firma</nazFirmy>
...
</nastaveni>
<nastaveni>
<id>2</id>
<nazFirmy>Demo firma s.r.o.</nazFirmy>
...
</nastaveni>
</winstrom>

You can get an overview of the validity periods themselves by limiting the detail level:

GET /c/{firma}/nastaveni.xml?detail=custom:id,platiOdData

Settings are thus stored as individual versions, similar to the desktop application:


New settings valid from a specific date

If we are creating new settings valid from a specific date, we need to specify the original settings on which the new settings should be based. The puvodniNastaveni property is used for this purpose. Any other information that is not specified will remain the same as in the original settings.

<winstrom version="1.0"> 
<nastaveni>
<puvodniNastaveni>
<id>1</id>
</puvodniNastaveni>
<platiOdData>2026-12-29</platiOdData>
<uliceNazev>Přestěhovaná</uliceNazev>
<!-- Další vlastnosti evidence "nastaveni", které chceme uložit. -->
</nastaveni>
</winstrom>

Send the request using the PUT or POST method to /c/{firma}/nastaveni.xml.


Initial (first) settings

If we want to create initial company settings preceding an already existing initial settings record, we need to specify two additional properties inside the puvodniNastaveni element:

Property

Meaning

prvniNastaveni

Flag indicating that we are creating the first settings. Value true.

prvniNastaveniPlatiDoData

Date until which these settings should be valid. It will automatically be set on the already existing initial settings as platiOdData.

<winstrom version="1.0"> 
<nastaveni>
<puvodniNastaveni>
<id>1</id>
<prvniNastaveni>true</prvniNastaveni>
<prvniNastaveniPlatiDoData>2026-12-22</prvniNastaveniPlatiDoData>
</puvodniNastaveni>
<!-- Vlastnosti evidence "nastaveni", které chceme uložit. -->
</nastaveni>
</winstrom>

⚠️ The date in prvniNastaveniPlatiDoData must precede the validity of the existing initial settings. If it exceeds it, the server will return 400 with the code nastaveniVytvorPrvniNastNeplatneDatum and a message stating that the date of the specified initial settings is incorrect.


What to watch out for

⚠️ The properties puvodniNastaveni, prvniNastaveni and prvniNastaveniPlatiDoData are used for import purposes only — you will not find them in the list of evidence fields (/c/{firma}/nastaveni/properties), and they are not returned on export.

💡 Before sending the request for real, try it out in test save mode by adding the ?dry-run=true parameter. The server will validate the data but will not save anything.


Related

Did this answer your question?