How much of a tax document for an advance payment (ZDD) has already been deducted is not stored on the document itself as an amount. You can find this out in two ways — roughly, from the field with the deduction status, or precisely, via links.
Deduction status
The stavOdpocetK field indicates what stage of deduction the document is in:
Value | Meaning |
| Partially deducted |
| Deducted |
| ZDD created |
You can retrieve it with a standard query:
GET /c/{firma}/faktura-vydana/123.xml?detail=custom:kod,stavOdpocetK,sumZalohy,sumCelkemBezZaloh
What exactly the deduction was applied to
The precise breakdown is in the document's links:
GET /c/{firma}/faktura-vydana/123.xml?relations=vazby&limit=0
In the output, look for links of type typVazbyDokl.odpocetZALOHY and typVazbyDokl.odpocetZDD. The a element points to the invoice line item the deduction was applied to, while the b element points to the document being deducted — the values of these items then give the actually used amount.
💡 If you want the output to show the properties of the linked documents rather than just references, expand them using the includes parameter — the procedure is described in the article Using detail=custom to determine the matching method.
