Skip to main content

REST API - Control Statement

How to create a control statement using the Flexi REST API

Written by Petr Pech

VAT Control Statements can be obtained in XML and PDF not only in the application, but also through the ABRA Flexi REST API.


Calling method

The service is available using the GET method at the address /c/{firma}/kontrolni-hlaseni.{přípona}, where {firma} is the database company identifier. The supported output formats are xml and pdf.


Prerequisites in company settings

For the VAT Control Statement to be generated successfully, the following details must be filled in under company settings:

  • Details → Regional Tax Office

  • Company → VAT ID

  • one of the values Company → Registered/Permanent address → Email, or Company → Registered/Permanent address → Data box

  • Details → Representative → Legal entity name

  • Details → Representative → Legal entity ID number

If any of these details are missing, the service returns 400 Bad Request listing them — see examples of invalid calls.


Parameters

The order of parameters does not matter.

Parameter

Required

Meaning

obdobi

optional

The period for which the VAT Control Statement should be generated. Specified either as a specific month of the year in the format yyyyMM (e.g. 202410 = October 2024), or as a quarter in the format yyyy'Q'M (e.g. 2024Q2 = second quarter of 2024). If not specified, the current year and month are used.

druh

optional

Type of submission. For the Czech statement: B (regular), O (corrective), N (follow-up), and E (follow-up/corrective); the default is B. For the Slovak statement: R (regular), O (corrective), and D (additional); the default is R.

datumZjisteni

required for types N and E

The date on which the reasons for filing a follow-up VAT Control Statement were identified. Format dd.MM.yyyy or yyyy-MM-dd.

dodatecneOproti

required for the Slovak additional statement

An integer — the ID of the statement being corrected. The corrected statement must be for the same period as the new one.

vyzvaOdpoved

optional

Response to a notice. The value B means "I have no obligation to file a VAT Control Statement" (zero statement), while the value P confirms the correctness of the last submitted statement. If this parameter is not specified, no response to the notice is included in the statement.

cisloJednaciVyzvy

required if vyzvaOdpoved is specified

The reference number of the notice in the format 99999999/99/9999-99999-999999, for example 12345678/12/1234-12345-123456.

stat

optional

Values CZ and SK. If not specified, the company's legislation country is used.

ulozit

optional

Whether the statement should be saved. If not specified, the statement is not saved.

You can retrieve the list of saved statements from the ulozene-priznani-kon-vyk-dph record, for example:

GET https://demo.flexibee.eu/c/demo/ulozene-priznani-kon-vyk-dph/(rok eq 2024 and ctvrtleti eq 2).xml


Available submission types

The available submission types, their required parameters, and the available reports for each country are returned at the address /c/{firma}/kontrolni-hlaseni/form-data.xml:

GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni/form-data.xml

The result is form data, whose abbreviated form for the Czech legislation looks like this:

<?xml version="1.0" ?>
<form-data>
<statyDph>
<statDph>
<dostupneReporty>
<report>
<reportId>kontrolniVykazPrehledCZ$$SUM</reportId>
<reportName>Kontrolní řádky na Daňové přiznání k DPH (DaP)</reportName>
</report>
</dostupneReporty>
<kod>CZ</kod>
<nazev>Česká republika</nazev>
<supportXml>true</supportXml>
<supportPdf>true</supportPdf>
<dostupneDruhy>
<druh>
<kod>B</kod>
<nazev>řádné</nazev>
<povinneParametry></povinneParametry>
</druh>
<druh>
<kod>O</kod>
<nazev>opravné</nazev>
<povinneParametry></povinneParametry>
</druh>
<druh>
<kod>N</kod>
<nazev>následné</nazev>
<povinneParametry>
<povinnyParametr>datumZjisteni</povinnyParametr>
</povinneParametry>
</druh>
<druh>
<kod>E</kod>
<nazev>následné/opravné</nazev>
<povinneParametry>
<povinnyParametr>datumZjisteni</povinnyParametr>
</povinneParametry>
</druh>
</dostupneDruhy>
</statDph>
</statyDph>
</form-data>


Sample calls

VAT Control Statement in XML format for the second quarter of 2024, or the same in PDF:

GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni.xml?obdobi=2024Q2
GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni.pdf?obdobi=2024Q2

Follow-up VAT Control Statement for October 2024:

GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni.xml?obdobi=202410&druh=N&datumZjisteni=2024-10-10


Call result

If the service is executed successfully, the HTTP status 200 is returned together with the body in the requested format. The result is the VAT Control Statement in the XML structure for the tax portal (values are illustrative):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Pisemnost>
<DPHKH1>
<VetaD ctvrt="2" d_poddp="21.07.2024" dokument="KH1" k_uladis="DPH" khdph_forma="B" rok="2024"/>
<VetaP c_orient="1" c_pop="1" c_ufo="460" dic="CZ12345678" email="info@vzorovafirma.cz" naz_obce="Praha" psc="10000" stat="ČESKÁ REPUBLIKA" typ_ds="P" ulice="Ulice 1" zkrobchjm="Vzorová firma s.r.o."/>
<VetaA5 dan1="0.00" dan2="0.00" dan3="0.00" zakl_dane1="0.00" zakl_dane2="0.00" zakl_dane3="0.00"/>
<VetaB3 dan1="0.00" dan2="0.00" dan3="0.00" zakl_dane1="0.00" zakl_dane2="0.00" zakl_dane3="0.00"/>
<VetaC celk_zd_a2="0.00" obrat23="0.00" obrat5="0.00" pln23="0.00" pln5="0.00" pln_rez_pren="0.00" rez_pren23="0.00" rez_pren5="0.00"/>
</DPHKH1>
</Pisemnost>

When calling with the .pdf extension, the result is the complete PDF file of the VAT Control Statement.


Data of the generated statement

The actual data of the generated VAT Control Statement is available at the address /c/{firma}/kontrolni-hlaseni-dph.{přípona} in the formats json and xml. The parameters rok and ctvrtleti or mesic are required. You can use filtering; sorting records is not available here.

Two additional parameters can be used to find problematic items — clenKonVykNull=true displays items that don't have a VAT Control Statement line filled in, and kodSkTooLong=true displays items whose incoming invoice number is too long for Slovakia.

GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni-dph.json?rok=2024&ctvrtleti=2
GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni-dph.json?rok=2024&ctvrtleti=2&clenKonVykNull=true
GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni-dph.json?rok=2024&ctvrtleti=2&kodSkTooLong=true


Examples of invalid calls

For invalid calls, the status 4xx or 5xx is returned, and the response body contains a description of the error.

1. Invalid company settings

GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni.xml?obdobi=2024Q2

The response is 400 Bad Request listing the missing details:

<?xml version="1.0" ?>
<winstrom version="1.0">
<success>false</success>
<message>V nastavení firmy chybí tyto údaje:
Upřesnění - Krajský finanční úřad
Jedna z hodnot:
- Firma - Sídlo/Trv. bydliště - E-mail
- Firma - Sídlo/Trv. bydliště - Datová schránka
Upřesnění - Zástupce - Název právnické osoby
Upřesnění - Zástupce - IČO právnické osoby</message>
</winstrom>

2. Missing notice reference number

GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni.xml?obdobi=2024Q2&vyzvaOdpoved=B

The response is 400 Bad Request with the code missing_param_exception:

<winstrom version="1.0">
<success>false</success>
<message>K provedení operace je vyžadován parametr 'cisloJednaciVyzvy'</message>
</winstrom>

3. Unsupported parameter value

GET https://demo.flexibee.eu/c/demo/kontrolni-hlaseni.xml?obdobi=2024Q2&vyzvaOdpoved=A&cisloJednaciVyzvy=12345678/12/1234-12345-123456

The response is 400 Bad Request with the code unsupported_param_value_exception:

<winstrom version="1.0">
<success>false</success>
<message>Parametr 'vyzvaOdpoved' má nepodporovanou hodnotu! Zvolte jednu z následujících možností: [B, P]</message>
</winstrom>

Similarly, for the druh parameter, a list of [B, O, N, E] is offered for the Czech legislation. An incorrect reference number format returns 400 with the code illegal_parameter_exception and the expected pattern.

⚠️ The value of the obdobi parameter is not validated against the range of months and quarters. A nonsensical period, for example 2124Q5, will pass with the response 200 OK, but the excess quarter will roll over into the following year — in this case, the statement generated will be for the first quarter of 2125. Therefore, verify the period on your side before making the call.


FAQ

How do I create a VAT Control Statement in the application?

You can find the procedure in the article VAT Control Statement.

Where in the application do I enter the notice reference number?

You can find the answer in the article VAT Control Statement - notice reference number.

Why can't the statement be exported to XML for the tax office?

The most common causes are described in the article VAT Control Statement cannot be exported to XML for the Tax Office.

What other accounting outputs can be obtained through the API?

You can find an overview in the article Accounting outputs in the REST API.


Related

Did this answer your question?