Skip to main content

Creating a quote/order from an inquiry/quote - REST API

REST API - creating a quote from an inquiry / creating an order from a quote

Written by Lenka Haringerová

Using the REST API, you can create a quote from a demand, and create an order from either a demand or a quote. This is done using the nabidni and objednej elements, which you include in the body of the imported document.


Creating a quote from a demand

Add the nabidni element to the body of the received demand:

<?xml version="1.0"?>
<winstrom version="1.0">
<poptavka-prijata>
<id>code:POP0001/2024</id>
<nabidni>
<!-- nepovinný externí identifikátor vytvořené nabídky -->
<id>ext:NABIDKA</id>
<!-- typ dokladu vytvořené nabídky; pokud není zadaný, bere se z nastavení -->
<typDokl>code:NAV</typDokl>
</nabidni>
</poptavka-prijata>
</winstrom>


Creating an order from a demand or quote

Similarly, the objednej element is used for this purpose. It can be included both in a received demand and in an issued quote:

<?xml version="1.0"?>
<winstrom version="1.0">
<poptavka-prijata>
<id>code:POP0001/2024</id>
<objednej>
<!-- nepovinný externí identifikátor vytvořené objednávky -->
<id>ext:OBJEDNAVKA</id>
<!-- typ dokladu vytvořené objednávky; pokud není zadaný, bere se z nastavení -->
<typDokl>code:OBP</typDokl>
</objednej>
</poptavka-prijata>
</winstrom>

If the type of the received order is predefined on the type of the issued quote, or on the quote itself, there is no need to send typDokl at all. The request can then look like this:

<?xml version="1.0" encoding="utf-8"?>
<winstrom version="1.0">
<nabidka-vydana>
<id>code:NAV-0001/2024</id>
<objednej></objednej>
</nabidka-vydana>
</winstrom>

⚠️ If the document type is neither specified nor predefined, the server will return 400 with the code typDoklMustBeSet and a message stating that the document type must be either specified or predefined.

ℹ️ The request body must always be wrapped in the root element winstrom (flexibee is also accepted). Without it, the server will return 400 with the code importXmlInvalidStartTag.


Related

Did this answer your question?