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 |
| required | The period for which you want to recalculate the accounts. Specify the period code in the format |
| optional | Checks whether the recalculation has been completed. If so, it returns HTTP status |
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
