Skip to main content

Update of Dispensing Requirements - REST API

How to trigger a disbursement request update via REST API?

Written by Lenka Haringerová

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

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&#xED; povoleno generov&#xE1;n&#xED; po&#x17E;adavk&#x16F; na v&#xFD;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.xml

  • PUT /c/demo/sklad/aktualizace-pozadavku.json

  • PUT /c/demo/sklad/aktualizace-pozadavku (with header Accept: application/xml or Accept: application/json)

  • POST /c/demo/sklad/aktualizace-pozadavku.xml

  • POST /c/demo/sklad/aktualizace-pozadavku.json

  • POST /c/demo/sklad/aktualizace-pozadavku (with header Accept: application/xml or Accept: application/json)

Did this answer your question?