Skip to main content

Recalculation of Tax Records - REST API

How can I use the API to trigger recalculation of tax records?

Written by Petr Pech

Recalculation of tax records ensures that the balances of individual classifications (sections) of the records are correct. An analogy can be seen in the account balance recalculation in double-entry bookkeeping.


Calling method

The service is available via the methods PUT and POST at the address /c/{firma}/danova-evidence/prepocet, where {firma} is the database company identifier. The supported output formats are XML and JSON.


Parameters

  • ucetniObdobi — a required parameter that identifies the period for which you want to recalculate the records (e.g., ucetniObdobi=code:2024).

  • dry-run — an optional parameter used to check whether the recalculation has been completed. If so, it returns HTTP status 200. If not, it returns HTTP status 409 along with information about when and by whom the recalculation was started.


Result

To determine whether the service was executed successfully, you can check either the HTTP status of the response or the success property in the returned document.

If the service is executed successfully, HTTP status 200 is returned along with a document corresponding to the standard format, see return values. If it fails, status 4xx or 5xx is returned along with a message explaining the reason for the failure.


Call examples

1. Call in XML

POST https://demo.flexibee.eu/c/demo/danova-evidence/prepocet.xml?ucetniObdobi=code:2024

2. Call in JSON, including dry-run test mode

PUT https://demo.flexibee.eu/c/demo/danova-evidence/prepocet.json?ucetniObdobi=code:2024&dry-run=true

3. Specifying the format in the header rather than the extension

PUT https://demo.flexibee.eu/c/demo/danova-evidence/prepocet?ucetniObdobi=code:2024

In this case, the format is selected using the Accept: application/xml header, or alternatively Accept: application/json.


Failed requests

Another recalculation is already running

If the recalculation has just been started by another user, for example in the application, the following message is returned:

"message": "Aktuálně běžící operace 'Přepočet daňové evidence' spuštěná uživatelem dba v 16.4.2024, 15:21:39 nedovoluje současně spustit 'Přepočet daňové evidence'."

The company does not keep tax records

In a company that uses double-entry bookkeeping, this action is not available, and the call returns 400 with the code akcePristupOdepren and the message K této akci nemáte přístup. To check balances in double-entry bookkeeping, use the account balance recalculation.


FAQ

What is tax records recalculation?

Recalculation ensures that the balances of individual classifications (sections) of the records are correct. The analogy in double-entry bookkeeping is account balance recalculation.

Do I need to call the tax records recalculation regularly?

Usually not. However, we recommend running it to check the correctness of balances at the end of the accounting period.


Related

Did this answer your question?