Skip to main content

Stock Recalculation - REST API

How to trigger a warehouse recalculation via REST API?

Written by Petr Pech

Calling Method

You can use the HTTP method: PUT or POST.

The service is available at: /c/{firma}/sklad/prepocet, where {firma} is the database company identifier.

The following output formats are supported: XML or JSON.

Parameters

The service for the sklad record requires the mandatory parameter ucetniObdobi in order to identify the time period for which you want to recalculate the inventory. Provide the period code in the format code:2020.

Optionally, the parameter dry-run can be used. This parameter allows you to check whether the recalculation has been completed. If it has, an HTTP status 200 is returned. If not, an HTTP status 409 is returned along with information about when and by whom the recalculation was initiated.

Result

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

If the service is executed successfully, HTTP status 200 is returned along with a document conforming to the standard format — see return values.

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

Call Examples

  • PUT /c/demo/sklad/prepocet.xml?ucetniObdobi=code:2020

  • PUT /c/demo/sklad/prepocet.json?ucetniObdobi=code:2020

  • PUT /c/demo/sklad/prepocet?ucetniObdobi=code:2020 (with the header Accept: application/xml or Accept: application/json)

The examples above make use of filtering.

Did this answer your question?