Skip to main content

Performing Actions

Performing Actions in REST API

Written by Petr Pech

During import, instead of simply creating or updating a record, you can perform a different action — such as deleting or canceling a document. This is done using the action attribute:

<?xml version="1.0"?><winstrom version="1.0">  <faktura-vydana action="delete">    <id>123</id>    <id>uuid:123456</id>  </faktura-vydana></winstrom>

Action

Description

Delete
(delete)

The record will be deleted.

Cancel
(storno)

The record will be canceled. Can only be used for documents.

When performing actions, records are not otherwise modified — therefore, there is no point in specifying any elements other than id. Additionally, the records must already exist; for example, you cannot create a new deleted invoice.

Actions on Line Items

Actions can also be triggered on document line items. However, not directly — just as with updates, the request must be specified via the line item collection on the corresponding document.

Example of deleting a line item with ID equal to 456 in XML and JSON format:

<?xml version="1.0"?><winstrom version="1.0">  <faktura-vydana>    <id>123</id>    <polozkyFaktury>      <faktura-vydana-polozka id="456" action="delete"/>    </polozkyFaktury>  </faktura-vydana></winstrom>
{    "winstrom": {        "@version": "1.0",        "faktura-vydana": [            {                "id": "123",                "polozkyFaktury": [                    {                        "id": "456",                        "@action": "delete"                    }                ]            }        ]    }}
Did this answer your question?