If generation of dispatch requests is enabled in the company settings, you can use the REST API to call the Update Stock Dispatch Requests service.
Not sure what a dispatch request is? See our documentation.
How to Call the Service
Supported HTTP method:
PUT or POST
The service is available at:
/c/{firma}/sklad/aktualizace-pozadavku
where {firma} is the database company identifier.
Supported output formats:
XML or JSON
Parameters
The service supports the parameter dry-run. This parameter can be used to check whether the recalculation has been completed. If it has, the service returns HTTP status 200. If not, it returns HTTP status 409 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.
Successful Call
When the service executes successfully, it returns HTTP status 200 and a document in the requested format:
XML
<?xml version="1.0"?><winstrom version="1.0"> <success>true</success></winstrom>
JSON
{ "winstrom": { "@version": "1.0", "success": "true" }}
Unsuccessful Call
The HTTP response status is 4xx or 5xx. For example, if the company does not have dispatch request generation enabled, the following result document is returned:
XML
<?xml version="1.0"?><winstrom version="1.0"> <success>false</success> <message>Není povoleno generování požadavků na výdej.</message></winstrom>
JSON
{ "winstrom": { "@version": "1.0", "success": "false", "message": "Nen\u00ed povoleno generov\u00e1n\u00ed po\u017eadavk\u016f na v\u00fddej." }}
Call Examples
PUT /c/demo/sklad/aktualizace-pozadavku.xmlPUT /c/demo/sklad/aktualizace-pozadavku.jsonPUT /c/demo/sklad/aktualizace-pozadavku(with headerAccept: application/xmlorAccept: application/json)POST /c/demo/sklad/aktualizace-pozadavku.xmlPOST /c/demo/sklad/aktualizace-pozadavku.jsonPOST /c/demo/sklad/aktualizace-pozadavku(with headerAccept: application/xmlorAccept: application/json)
