Skip to main content

Recalculation of Account Balances - REST API

How to trigger an account status recalculation using the API?

Written by Petr Pech

The REST API can be used to trigger a recalculation of account balances — the same operation you run in the application over accounting outputs.


Calling method

You can use the HTTP method PUT or POST. The service is available at /c/{firma}/stav-uctu/prepocet, where {firma} is the database company identifier. Both XML and JSON output formats are supported.


Parameters

Parameter

Requirement

Meaning

ucetniObdobi

required

The period for which you want to recalculate the accounts. Specify the period code in the format code:2020.

dry-run

optional

Checks whether the recalculation has been completed. If so, it returns HTTP status 200. If not, it returns 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 the HTTP status of the response or the success property in the returned document. If the service completes successfully, status 200 is returned along with a document in the standard format — see return values. If it fails, status 4xx/5xx is returned along with a message describing the reason for the failure.


Sample calls

PUT /c/demo/stav-uctu/prepocet.xml?ucetniObdobi=code:2020
PUT /c/demo/stav-uctu/prepocet.json?ucetniObdobi=code:2020

The format can also be specified via a header instead of a file extension — in that case, add Accept: application/xml or Accept: application/json:

PUT /c/demo/stav-uctu/prepocet?ucetniObdobi=code:2020


Related

Did this answer your question?