When you add a linked record to the output, all of its records are returned in full. The detail=custom parameter lets you specify which fields you want from them — separately for the main record and separately for each relation.
Syntax
The relation name is given as a field, followed by a list of its properties in parentheses:
GET /c/{firma}/faktura-vydana.xml
?detail=custom:kod,polozkyDokladu(nazev,mnozMj)
Here's what the result looks like — for the document, only the code is returned; for the items, only the name and quantity:
<faktura-vydana>
<id>2859</id>
<kod>KBF1</kod>
<polozkyDokladu>
<faktura-vydana-polozka>
<id>3595</id>
<nazev>FRadek 1</nazev>
<mnozMj>1.0</mnozMj>
</faktura-vydana-polozka>
</polozkyDokladu>
</faktura-vydana>
💡 A relation listed in detail=custom is included in the output even without the relations parameter — simply mentioning it in the parenthesized syntax is enough.
Relations other than items
The same approach applies to any other linked record. For example, attachments of a price list item:
GET /c/{firma}/cenik/1.json
?detail=custom:id,nazev,popis,prilohy(nazSoub,content,link,typK)
&relations=prilohy
📝 For an attachment, the content property returns the file content encoded in base64 — this is confirmed in the response by the accompanying content@encoding field.
Or attributes of a price list item:
GET /c/{firma}/cenik/49.xml
?detail=custom:kod,atributy(typAtributu)
ℹ️ The record identifier always appears in the output, even if you don't include it in the list of fields. For some relations, additional fields are added that Flexi needs to clearly describe the relationship (for example, amount and currency for links between documents).
