Skip to main content

Test Save (Dry Run)

Checking Data with a Dry Run

Written by Lenka Haringerová

When working with the REST API and you need to verify that all data is correct — for example, if a user has changed a value that affects another field (such as document type and posting), or if you need to calculate the final price for an order — you can use the dry-run mode.

When saving, add the parameter ?dry-run=true. The result is that the record will not be saved, but only validations will be performed. In addition, you will receive in the tag the resulting representation of the record as it would look if you saved it at that moment.

Example of the resulting XML:

<?xml version="1.0" encoding="utf-8"?> 
<winstrom version="1.0">
<success>true</success>
<warnings> <warning for="firma">Nebyl určen příjemce a tak nebude doklad zaúčtován.</warning>
<warnings>
<result>
<content>
<!-- Doklady faktur -->
<faktura-vydana>
<!-- ID (celé číslo) - -->
<id>-1</id>
<!-- Interní číslo (řetězec) - max. délka: 20 -->
<kod>00000041/09</kod>
<!-- Variabilní symbol (řetězec) - -->
<varSym>0000004109</varSym>
<!-- Vystaveno (datum) - -->
<datVyst>2009-08-12+02:00</datVyst>
...
</faktura-vydana>
</content>
</result>
</winstrom>

In this case, a document number was also assigned. However, the number was immediately released for further use, so it is possible that upon actual saving the document will receive a different number. This also shows an example of a validation warning.

The output can also be processed in JSON format.

Did this answer your question?