Skip to main content

VAT Return - REST API

How to retrieve a VAT return in XML or PDF format via API?

Written by Petr Pech

Just as in the application, VAT returns can also be retrieved in XML/PDF format via the Flexi API.

Calling method

You can use the HTTP method: POST

The VAT return is available at the following address:

The following output formats are supported: XML or PDF.

Parameters

The following parameters are available for generating output and should be included in the request body:

  • koeficient - optional parameter, coefficient for calculating the proportional part of the tax deduction (§ 76). Default values: Czech Republic 100, Slovakia 0

  • rok - required parameter, enter the year for which you are generating the return (e.g. 2020, 2021, etc.)

  • mesic - required parameter, enter the starting month from which the return is generated (e.g. 1, 3, etc.) or enter the quarter for which you are generating the return — Q1, Q2, Q3 or Q4

  • druh - optional parameter, specifies the type of VAT return; available values (default value is radne):

    • Czech Republic: radne, radneOpravne, dodatecne, dodatecneOpravne

    • Slovakia: radne, opravne, dodatecne

  • vyporadaciKoeficient - optional parameter, this coefficient is not recalculated by the application, so it must be calculated and entered manually

  • kodZdanObd - optional String Taxable period code

  • zmenaOdpoctu - optional parameter, the change in deduction refers to the difference between the calculated deduction and the claimed deduction. (line 53)

  • dodatecneOproti - required parameter for amended returns, this is a reference to the VAT return lines where previous returns are stored, referenced by the ID of the previous return.

/radek-priznani-dph/((rok eq "2021") and ((mesic eq "8") and ((clenDph is null) and (typSzbDphK is null))))

  • datumZjisteni - optional parameter for amended returns, date of discovery of changes in the format YYYY-MM-DD

  • danKUhrade - optional parameter, integer, tax payable for line 38. Only for return type dodatecne

  • ulozit - optional, accepts true/false, specifies whether the generated return should be saved to the database; default is false

  • report-name - optional parameter, report name (for PDF format only)

  • stat - optional: Possible values CZ, SK. If not specified, the legislation country is used.

Available return types

Available VAT return types in XML format:

The result is general form-data in the following format:

<?xml version="1.0" ?>
<form-data>
<statyDph>
<statDph>
<kod>CZ</kod>
<nazev>Česká republika</nazev>
<nazevA>Czech republic</nazevA>
<nazevB></nazevB>
<nazevC></nazevC>
<dostupneDruhy>
<druh>
<kod>radne</kod>
<nazev>Řádné</nazev>
<povinneParametry>
<povinnyParametr>rok</povinnyParametr>
<povinnyParametr>mesic</povinnyParametr>
</povinneParametry>
</druh>
<druh>
<kod>radneOpravne</kod>
<nazev>Řádné/opravné</nazev>
<povinneParametry>
<povinnyParametr>rok</povinnyParametr>
<povinnyParametr>mesic</povinnyParametr>
</povinneParametry>
</druh>
<druh>
<kod>dodatecne</kod>
<nazev>Dodatečné</nazev>
<povinneParametry>
<povinnyParametr>rok</povinnyParametr>
<povinnyParametr>mesic</povinnyParametr>
<povinnyParametr>dodatecneOproti</povinnyParametr>
</povinneParametry>
</druh>
<druh>
<kod>dodatecneOpravne</kod>
<nazev>Dodatečné/opravné</nazev>
<povinneParametry>
<povinnyParametr>rok</povinnyParametr>
<povinnyParametr>mesic</povinnyParametr>
<povinnyParametr>dodatecneOproti</povinnyParametr>
</povinneParametry>
</druh>
</dostupneDruhy>
</statDph>
</statyDph>
</form-data>

Example calls

1. Standard VAT return in PDF for January 2023:

GET

Output:

PDF soubor Přiznání

2. Slovak amended VAT return in XML for January 2023:

GET

Output:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Pisemnost nazevSW="ABRA Flexi" verzeSW="SNAPSHOT">
<DPHDP3 verzePis="02.01.03">
<VetaD c_okec="" d_poddp="01.12.2023" d_zjist="13.06.2023" dapdph_forma="D" dokument="DP3" k_uladis="DPH" mesic="3" rok="2015" trans="A" typ_platce="P"/>
<VetaP c_pop="277" c_pracufo="3104" c_ufo="462" dic="02230607" email="info@abra.eu" naz_obce="Praha" opr_postaveni="jednatelka" psc="10100" stat="ČESKÁ REPUBLIKA" typ_ds="P" ulice="Jívová" zkrobchjm="ABRA Flexi s.r.o."/>
<Veta1 dan23="0.0" dan5="0.0" dan_dzb23="0.0" dan_dzb5="0.0" dan_pdop_nrg="0.0" dan_psl23_e="0.0" dan_psl23_z="0.0" dan_psl5_e="0.0" dan_psl5_z="0.0" dan_pzb23="0.0" dan_pzb5="0.0" dan_rpren23="0.0" dan_rpren5="0.0" dov_zb23="0.0" dov_zb5="0.0" obrat23="0.0" obrat5="0.0" p_dop_nrg="0.0" p_sl23_e="0.0" p_sl23_z="0.0" p_sl5_e="0.0" p_sl5_z="0.0" p_zb23="0.0" p_zb5="0.0" rez_pren23="0.0" rez_pren5="0.0"/>
<Veta2 dod_dop_nrg="0.0" dod_zb="0.0" pln_ost="0.0" pln_rez_pren="0.0" pln_sluzby="0.0" pln_vyvoz="0.0" pln_zaslani="0.0"/>
<Veta3 dov_osv="0.0" opr_dluz="0.0" opr_verit="0.0" tri_dozb="0.0" tri_pozb="0.0"/>
<Veta4 dov_cu="0.0" nar_maj="0.0" nar_zdp23="0.0" nar_zdp5="0.0" od_maj="0.0" od_zdp23="0.0" od_zdp5="0.0" odkr_maj="0.0" odkr_zdp23="0.0" odkr_zdp5="0.0" odp_cu="0.0" odp_cu_nar="0.0" odp_rez_nar="0.0" odp_rezim="0.0" odp_sum_kr="0.0" odp_sum_nar="0.0" odp_tuz23="0.0" odp_tuz23_nar="0.0" odp_tuz5="0.0" odp_tuz5_nar="0.0" pln23="0.0" pln5="0.0"/>
<Veta5 koef_p20_nov="0.00" odp_uprav_kf="0.0" pln_nkf="0.0" plnosv_kf="0.0" plnosv_nkf="0.0"/>
<Veta6 dan_vrac="0.0" dan_zocelk="0.0" dano="0.0" odp_zocelk="0.0"/>
</DPHDP3>
</Pisemnost>

Call result

To determine whether the service was executed successfully, you can check the HTTP response status.

If the service is executed successfully, HTTP status 200 is returned along with a document in the selected XML or PDF format.

In case of failure, a 4xx/5xx status is returned along with a message describing the reason for the failure.

Examples of invalid calls

In the case of invalid calls, the response body contains an error description.

1. Incorrectly specified period parameter

The result is an HTTP Status 400 Bad Request response with the following error description:

<winstrom version="1.0">
<success>false</success>
<message>Parametr 'druh' má nepodporovanou hodnotu! Zvolte jednu z následujících možností: [radne, radneOpravne, dodatecne, dodatecneOpravne].</message>
</winstrom>

2. Error when the original return belongs to a different period than the one specified in the request.

The result is an HTTP Status 400 Bad Request response with the following error description:

<?xml version="1.0" ?>
<winstrom version="1.0">
<success>false</success>
<message>Opravované přiznání musí být ve stejném období (2023-3) jako opravné přiznání (2023-1).</message>
</winstrom>

3. Missing required parameter

The result is an HTTP Status 400 Bad Request response with the following error description:

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

Saved VAT returns

Previously generated returns are saved. A list of saved returns can be retrieved at

GET

https://demo.flexibee.eu/c/demo/ulozene-priznani-dph/(rok={rok} AND mesic={mesic} AND ctvrtleti={ctvrtleti}).xml

Alternatively, using /query with parameters in the body:

GET

Body:

"rok":"2023","mesic":"1"

FAQ


Need help?

If you have any questions about the application, please contact us at podporaflexi@abra.eu or via the chat window in the bottom right corner.


Did this answer your question?