By default, listing invoices, orders, or stock documents returns only headers. Items and other linked records are added to the output separately.
The relations parameter
The simplest approach is to list the sub-records in the relations parameter:
GET /c/{firma}/faktura-vydana.xml … jen hlavičky
GET /c/{firma}/faktura-vydana.xml?relations=polozkyDokladu … i s položkami
Which sub-records can be attached to a given record type is shown at the address /relations. The parameter takes the value from the url element:
GET /c/{firma}/faktura-vydana/relations.xml
ℹ️ For documents, items are named polozkyDokladu — the same applies to invoices, orders, bank documents, and stock documents. The older notations polozkyFaktury and polozkyObchDokladu only work for the record type they belong to.
When items appear even without relations
Items can end up in the response in three ways:
Situation | Result |
A document addressed directly by its identifier — | Items are included in the output automatically. |
A listing or filter — | Only headers, until you add |
A relation listed in | Items are included in the output even without the |
💡 If you don't want to pull entire items from the database, list the required fields directly: ?detail=custom:kod,polozkyDokladu(nazev,mnozMj). The response is smaller and Flexi assembles it faster — for more details, see the article Issues with returning fields.
