Skip to main content

Using detail=custom to Determine the Matching Method

How to use nested detail=custom to determine the matching method from a paid invoice?

Written by Petr Pech

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

a

The document being paid — i.e., the invoice.

b

The paying document. Thanks to includes, it is expanded; otherwise, there would only be a link here.

typVazbyK

The type of relation, for example typVazbyDokl.uhrada or typVazbyDokl.odpocetZALOHY.

jakUhrK

The payment method on the paying document — for example jakUhrazeno.autoVs (automatically based on the variable symbol).

💡 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.


Related

Did this answer your question?