Skip to main content

Deleting a Fee via REST API

How to delete a fee via API?

Written by Petr Pech

A fee is a standalone record; for more information about it, see the Fee record.

At the same time, a fee is also a price list item — the Price List record.

The first step is therefore to remove the fee from the price list item:

You need to know the fee ID — first, retrieve the fee ID from the given price list.

<winstrom>
<cenik>
<kod>FEN</kod>
...
<poplatky>
<poplatek>
<id>7</id>
<mnozMj>1.0</mnozMj>
<typPoplatkuK showAs="Obecný">typPoplatku.obecny</typPoplatkuK>
<cenikOtec>code:FEN</cenikOtec>
<cenik>code:RECYKLPOPL</cenik>
</poplatek>
</poplatky>
...
</cenik>
</winstrom>

The fee ID is then used to delete it from the fee record:

<winstrom>
<poplatek action="delete">
<id>7</id>
</poplatek>
</winstrom>

The second step is to delete the standalone fee item from the price list; however, it must not be linked or used anywhere:

<winstrom>
<cenik action="delete">
<id>code:RECYKLPOPL</id>
</cenik>
</winstrom>
Did this answer your question?