In this article, we will walk through two examples of creating and updating records using the REST API.
List of registers: https://demo.flexibee.eu/c/demo/evidence-list
Attributes of a given register: https://demo.flexibee.eu/c/demo/EVIDENCE/properties
replace EVIDENCE with the machine name of the respective register
e.g.: adresar, faktura-vydana, interni-doklad, objednavka-prijata, faktura-prijata, banka, pokladna, faktura-vydana-polozka, poklad-pohyb-polozka, etc.
Example 1:
POST https://localhost:5434/c/testovaci/cenik.xml
<?xml version="1.0"?>
<winstrom version="1.0">
<cenik>
<id>ext:EXTERNI_ID</id>
<kod>KOD</kod>
<nazev>POLOZKA_CENIKU</nazev>
<mj1>code:KS</mj1>
<typSzbDphK>typSzbDph.dphZakl</typSzbDphK>
<typZasobyK>typZasoby.zbozi</typZasobyK
<cenaZakl>500</cenaZakl>
<szbDph>21</szbDph>
</cenik>
</winstrom>
Creates a price list item with:
external ID "EXTERNI_ID"
code "KOD"
name "POLOZKA_CENIKU"
unit of measure PCS
stock type "Goods"
standard VAT rate of 21%
price 500
Example 2:
POST https://localhost:5434/c/testovaci/faktura-vydana.xml
<?xml version="1.0"?>
<winstrom version="1.0">
<faktura-vydana update="ignore">
<id>ext:EXTERNI_ID</id>
<id>code:FAV01</id>
<nazev>FAKTURA_01</nazev>
<varSym>20183103</varSym>
<stitky>VIP</stitky>
<bankovniUcet>code:UCET01</bankovniUcet>
<typDokl>code:FAKTURA</typDokl>
</faktura-vydana>
</winstrom>
- if an invoice with the code "FAV01" or the external ID "EXTERNI_ID" already exists, the request to modify it is ignored
for more information about the create/update mode, please refer to our documentation: Create/Update Mode
for documents, it is necessary to specify the document type
More examples can be found in our documentation: XML Examples
