<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Michal Novotný</title>
    <description>The latest articles on DEV Community by Michal Novotný (@climealertviz).</description>
    <link>https://dev.to/climealertviz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4250956%2F9950fd29-3916-43f8-91f8-bfd27b52cab6.png</url>
      <title>DEV Community: Michal Novotný</title>
      <link>https://dev.to/climealertviz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/climealertviz"/>
    <language>en</language>
    <item>
      <title>A Czech invoice check needs three answers</title>
      <dc:creator>Michal Novotný</dc:creator>
      <pubDate>Wed, 18 Nov 2026 04:51:23 +0000</pubDate>
      <link>https://dev.to/climealertviz/a-czech-invoice-check-needs-three-answers-4och</link>
      <guid>https://dev.to/climealertviz/a-czech-invoice-check-needs-three-answers-4och</guid>
      <description>&lt;p&gt;A supplier account either matches a published account, differs from every published account, or cannot be checked with the data available. A surprisingly easy way to lose the third outcome is to return an empty list when a registry request times out. Every downstream payment check then treats the outage as a mismatch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the supplier identifier
&lt;/h2&gt;

&lt;p&gt;An ISDOC electronic invoice carries the supplier identifier and the payment details on the document. To look up a Czech supplier's registered name, you can call ARES directly. Keep the IČO as a string so the leading zeros survive. This example uses the public identifier of the Moravian Library in Brno.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;urlopen&lt;/span&gt;

&lt;span class="n"&gt;ico&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"00094943"&lt;/span&gt;
&lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"https://ares.gov.cz/ekonomicke-subjekty-v-be/rest/ekonomicke-subjekty/{ico}"&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;company&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ico"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"obchodniJmeno"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For published bank accounts and VAT reliability, the workflow queries the Czech Financial Administration's VAT register. The company name from ARES remains useful even when the VAT register is unavailable. Keeping the two results separate lets the caller display the name and send the account for manual review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make uncertainty an explicit input
&lt;/h2&gt;

&lt;p&gt;The comparison below assumes both sides have already been normalized. A Czech domestic account string includes a bank code, an optional prefix and an account number. For a Czech IBAN and a domestic account to compare equal, those components must be represented consistently.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;compare_account&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;invoice_account&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;published_accounts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;published_accounts&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"UNKNOWN"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;invoice_account&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;published_accounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"MATCH"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"NO_MATCH"&lt;/span&gt;

&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;compare_account&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"account-A"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"account-A"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"MATCH"&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;compare_account&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"account-A"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"NO_MATCH"&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;compare_account&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"account-A"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"UNKNOWN"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only pass an empty list after a successful, complete lookup. Pass &lt;code&gt;None&lt;/code&gt; if the upstream response omits the field you need. In a production workflow, keep the source, lookup time and status alongside the result. Even a successful match only establishes that the account appeared in the source at lookup time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the webhook response as well as the business rule
&lt;/h2&gt;

&lt;p&gt;In a running n8n instance, we tried a CZK 100 invoice, a EUR 50 invoice using the Czech National Bank rate for 16 November 2026, and an unavailable VAT register. The CZK amount stayed at 100. The foreign invoice converted to CZK 1,221.50. For the outage test we replaced the upstream response with a controlled fixture. The workflow returned &lt;code&gt;VAT_STATUS_UNKNOWN&lt;/code&gt; and &lt;code&gt;UNKNOWN_ADIS&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The clear invoice initially triggered an unexpected HTTP 500. A terminal IF node returned no item on the clear branch, leaving the webhook with nothing to send. Returning one result from a shared final node fixed the response. The caller can now route all three outcomes explicitly.&lt;/p&gt;

&lt;p&gt;I maintain EuroKYB. The standalone Python examples above run without a EuroKYB account. The project also exposes these lookups through an &lt;a href="https://github.com/clime-alertviz/eurokyb-mcp" rel="noopener noreferrer"&gt;open-source MCP bridge&lt;/a&gt;. This article was prepared with AI assistance and draws on the live workflow tests described above.&lt;/p&gt;

</description>
      <category>python</category>
    </item>
  </channel>
</rss>
