Skip to main content

Loading Bank Statements

How to Fetch Bank Statements in the REST API?

Written by Lenka Haringerová

Bank statements can be imported into ABRA Flexi via REST API in two ways — by uploading a downloaded statement file, or by triggering an online import directly from the bank.


Importing downloaded statements

The statement file must be sent using the PUT or POST method to the URL:

PUT /c/{firma}/bankovni-ucet/{id}/nacteni-vypisu

The bank account must have the appropriate electronic banking properties set (statement format, etc.). For more information on configuration, refer to the documentation for the desktop and web applications.


Successful import

If the statement is imported correctly, the response is 200. The response body may include information indicating that some documents have already been imported:

<winstrom version="1.0">
<success>true</success>
<stats>
<created>4</created>
<updated>0</updated>
<deleted>0</deleted>
<skipped>2</skipped>
<failed>0</failed>
</stats>
<results>
<result>
<code>Výpis 223 pro účet 0000001000 - Počet položek 6</code>
<infos>
<info>položka s popisem POPLATEK - Tento doklad byl již načten.</info>
<info>položka s popisem VYBER HOTOVOSTI - Tento doklad byl již načten.</info>
</infos>
</result>
</results>
</winstrom>


Error responses

In case of an error, the response is 400 and the body contains a description of the problem — for example, when the bank account for the statement cannot be found:

<winstrom version="1.0">
<success>false</success>
<stats>
<created>0</created>
<updated>0</updated>
<deleted>0</deleted>
<skipped>0</skipped>
<failed>1</failed>
</stats>
<results>
<result>
<code>Výpis 223 pro účet 0000001000 - Počet položek 6</code>
<errors>
<error>Pro tento výpis nebyl nalezen bankovní účet.</error>
</errors>
</result>
</results>
</winstrom>

An incorrectly configured bank account in JSON format:

{
"winstrom": {
"@version": 1,
"success": false,
"message": "U bankovního účtu není definován formát elektronického výpisu."
}
}

⚠️ If present, the response body is currently always in text format, even if you request XML or JSON. This issue will be fixed in the future.


Importing statements online

The REST API also allows you to trigger the online import of statements. Online import refers to importing statements using a token from FIO bank or from Finbricks. To trigger it, you need to send a request using the PUT or POST method to the URL:

PUT /c/{firma}/banka/nacteni-vypisu-online

The bank account for which statements are to be downloaded must be properly configured, and the bank must support online statements.

📝 Statement formats have a prescribed structure — for example, 20 characters in the description field for the ABO format complies with this structure.


Related

Did this answer your question?