Similarly to the desktop application, documents (inventory differences) can be generated from an inventory via the API.
Generating documents from an inventory is available at the following URL:
/c/{company}/inventura/{id}/vygeneruj-doklady
{company} - replace with your company ID
{id} - replace with the inventory ID
Document generation has a required parameter typDoklId, whose value must be the numeric ID of an entity from the typ-skladovy-pohyb register. You therefore need the ID of the warehouse document type.
Example:
returns 200 OK with the following response body
{ "winstrom": { "@version": 1, "success": true, "message": "Doklady byly \u00fasp\u011b\u0161n\u011b vygenerov\u00e1ny." }}or 200 OK with the following response body
{ "winstrom": { "@version": 1, "success": true, "message": "P\u0159i inventu\u0159e nevznikl \u017e\u00e1dn\u00fd inventurn\u00ed rozd\u00edl." }}In case of an error, returns 400 Bad Request with a response body such as:
{ "winstrom": { "@version": 1, "success": false, "message": "Na polo\u017ece s ID = 2 se vyskytla chyba:\n Na sklad\u011b nen\u00ed dostatek zbo\u017e\u00ed." }}