Flexi2XML lets you batch-import data into ABRA Flexi — both to a local and a remote instance. It requires the REST API to function. For instructions on how to obtain the tool, see the article Downloading Flexi2XML.
How the import works
The basis is a configuration file that specifies how and where the data should be uploaded. The process is then as follows:
The tool finds all files matching the specified mask. The mask is entered as a regular expression, for example
.*\.csv.It imports them to the specified address in the chosen format — the format is determined by the server — and records the output in the log.
If the import succeeds without error, it renames the file so that it no longer matches the mask.
💡 If an import fails, the file is not renamed, and the tool will try to import it again the next time it runs. This means you can run the batch repeatedly, for example from a scheduler.
Configuration parameters
The tool is started with a reference to the configuration file:
flexibee2xml --load config.xml
The configuration file contains login and server details in the config section, and one or more action sections — each describing one group of files and the destination to which they should be uploaded:
<?xml version="1.0"?>
<config>
<username>jmeno</username>
<password>heslo</password>
<!-- identifikátor firmy, do které data nahrát -->
<company>demo</company>
<!-- server -->
<host>demo.flexibee.eu</host>
<!-- port, výchozí 5434 -->
<port>5434</port>
<!-- přípona, která bude přidána do názvu po přejmenování -->
<renameSuffix>-loaded</renameSuffix>
<!-- seznam akcí, které se mají provést -->
<action>
<!-- URL, kam nahrát data, začíná na / -->
<url>/faktura-vydana.csv?format=sofix&encoding=windows-1250&delimeter=;</url>
<!-- typ souboru, obvykle text/csv, text/xml nebo application/json -->
<contentType>text/csv</contentType>
<!-- maska pro výběr souborů -->
<mask>VFA.*\.csv</mask>
<directory>.</directory>
</action>
<action>
<url>/pokladni-pohyb.xml</url>
<contentType>text/xml</contentType>
<mask>items.*\.xml</mask>
<directory>.</directory>
</action>
</config>
🚨 The configuration file contains the username and password in plain text. Store it outside shared directories and restrict access rights to it — for batch uploads, create a separate user with only the necessary permissions, not an administrator account.
⚠️ In the value of url, the parameter separator & must be written as &, otherwise the file is not valid XML. The format parameter refers to an XSLT transformation on the server side — make sure a transformation of that name exists in your version, otherwise the call will fail with an Unknown format error.
Supported parameters in the action section
Element | Meaning |
| The address to or from which to upload files. Starts with a slash. |
| A regular expression specifying the list of files to import. |
| The directory in which files matching the mask are searched for. |
| The Content-Type used for the HTTP request. |
| Applies this XSL transformation to the content (its XML form) before sending it. |
| The delimiter used when converting from CSV to XML. |
| The character encoding used when converting from CSV to XML. |
| The name of the row element in XML when converting from CSV. |
| Rename files even if an error occurs. |
| The file to write conversion errors to. |
| Messages shown to the user on success, on error, and when no file was converted. |
Supported parameters in the config section
Element | Meaning |
| The address (DNS or IP) of the ABRA Flexi server. |
| The server port; the default is |
| The username and password of the user under which the import runs. |
| The identifier of the company to or from which the data will be uploaded — it becomes part of the URL. |
| Default values for all actions; an individual |
| The directory to which successfully uploaded files will be moved. |
| The prefix and suffix that successfully uploaded files will be renamed with. |
| Show the number of processed files and their status. |
| Messages shown to the user on success and on error. |
⚠️ On Windows, there are two variants of the tool — flexibee2xml and flexibee2xml-cli. The former is compiled as a graphical application and does not open a command-line window; it is tidier, but does not display error messages. For debugging batches, therefore use the -cli variant.
