A stock transfer always has two sides in Flexi — an issue and a receipt. This structure must therefore be followed when creating a transfer via the API.
The first step is to create an issue document for the transfer, for example:
<skladovy-pohyb>
<id>code:PREVOD1</id>
<typPohybuK>typPohybu.vydej</typPohybuK>
<typDokl>code:STANDARD</typDokl>
<sklad>code:PLZEN</sklad>
<typPohybuSkladK>typPohybuSklad.vydejPrevod</typPohybuSkladK>
<skladCil>code:PLZ</skladCil>
<skladovePolozky>
<skladovy-pohyb-polozka>
<cenik>code:1040CM</cenik>
<sklad>code:PLZEN</sklad>
<typPolozkyK>typPolozky.katalog</typPolozkyK>
</skladovy-pohyb-polozka>
</skladovePolozky>
</skladovy-pohyb>
Next, you need to call the "complete transfer" action on the newly created issue document:
<?xml version="1.0"?>
<winstrom version="1.0">
<skladovy-pohyb action="dokoncit-prevodku">
<!---jako ID lze použít i interní číslo výdeje pro převod-->
<id>code:PREVOD1</id>
</skladovy-pohyb>
</winstrom>
This action automatically creates a linked receipt document.
Both steps — creating the issue document and triggering the action — can be included in a single request.
