For a paid invoice, the API can be used to determine not only that it has been paid, but also which document was used for the payment and how the payment was made. This information is stored on the paying document, so it can be accessed through relations.
Question
GET /c/{firma}/faktura-vydana.xml
?limit=0
&relations=vazby
&includes=/faktura-vydana/vazby/vazba/b/
&detail=custom:kod,vazby(typVazbyK,b(jakUhrK))
Answer:
<faktura-vydana>
<kod>FV10119236/16</kod>
<vazby>
<vazba>
<typVazbyK showAs="Úhrada">typVazbyDokl.uhrada</typVazbyK>
<a ref="…/faktura-vydana/3.xml">code:FV10119236/16</a>
<b>
<banka>
<jakUhrK showAs="Automaticky dle var. sym.">jakUhrazeno.autoVs</jakUhrK>
</banka>
</b>
</vazba>
</vazby>
</faktura-vydana>
Meaning of individual elements:
Element | Meaning |
| The document being paid — i.e., the invoice. |
| The paying document. Thanks to |
| The type of relation, for example |
| The payment method on the paying document — for example |
💡 Without the parameter includes, the paying document would only be returned as a link, and you would not find jakUhrK in the response. The principle of expanding relations is described in the article Using includes to get information from the document header.
