A record can be deleted via the API in two ways — using the DELETE method on its address, or using the action="delete" attribute in an import XML or JSON. At their core, both do the same thing, but they differ in what they can handle.
The DELETE method
Deletes a single record specified by its address:
DELETE /c/{firma}/faktura-vydana/123
Success is confirmed by a 200 response. However, it cannot be used on the address of a nested record (for example /faktura-vydana/123/polozkyDokladu) — in that case the server responds with 405.
The action="delete" attribute
Deletion is part of a regular import, so a single request can delete several records at once — and combine deletion with other changes:
<winstrom version="1.0">
<faktura-vydana action="delete">
<id>code:VF1-0001/2026</id>
</faktura-vydana>
<faktura-vydana action="delete">
<id>ext:SHOP:1234</id>
</faktura-vydana>
</winstrom>
The response has the form of a regular import — 201 — and the statistics show the number of deleted records:
<stats><created>0</created><updated>0</updated><deleted>2</deleted> … </stats>
The same request in JSON format — each deleted record is its own object in the array:
{
"winstrom": {
"@version": "1.0",
"faktura-vydana": [
{ "@action": "delete", "id": "code:VF1-0001/2026" },
{ "@action": "delete", "id": "ext:SHOP:1234" }
]
}
}
ℹ️ Note the difference: the id array inside one object doesn't mean multiple records, but one record identified by several identifiers at once — "id": [ "code:VF1-0001/2026", "ext:SHOP:1234" ] deletes a single document, and all the given identifiers must point to the same record.
💡 action="delete" can also delete a nested record, which isn't possible with the DELETE method. The attribute is specified directly on the given item:
<winstrom version="1.0">
<faktura-vydana>
<id>code:VF1-0001/2026</id>
<polozkyDokladu>
<faktura-vydana-polozka action="delete">
<id>1372</id>
</faktura-vydana-polozka>
</polozkyDokladu>
</faktura-vydana>
</winstrom>
A deleted item shows up in the statistics as an update to the parent document, not as deleted.
⚠️ Deletion is governed by the document's relations: depending on their type, Flexi will either also delete linked records, remove the relations, or refuse to perform the action. For system records (such as users or standard reports), the action cannot be performed. If you don't want to lose the document from the records, consider using cancellation instead of deletion.
