Skip to main content

Connecting to a Billing System

How to Connect Flexi to an Operating System

Written by Lenka Haringerová

The accounting system can be easily connected to invoicing systems. In this guide, we will show you how to do it.

In general, the integration consists of the following parts:

  1. creating a payment request

  2. payment matching

  3. sending a tax document: either a proforma tax document or a full tax document (invoice)

  4. notifying non-payers

  5. penalizing non-payers (e.g. by disconnecting them)

Importing a Payment Request

First of all, it is necessary to determine who we will be invoicing and for what. This can be tracked in an external system (e.g. a customer and services database), or you can manage it directly in Flexi. For example, by adding the label "INTERNET512" to an address book entry and then creating an invoice for every customer who has this label.

curl -u winstrom:winstrom -f -L "http://demo.flexibee.eu:5434/c/demo/adresar/(vybKlice='code:INTERNET512').xml?detail=detail&xpath=//winstrom/adresar/kod/text()"

Note: using xpath will return only company codes (identifiers), so we don't need to work directly with XML.

Why a Payment Request

At this point, it is always necessary to create a payment request. It is not possible to send money to an account with a variable symbol and create a credit that way. You must therefore create a payment request. This restriction is standard and is used, for example, by Google Ads as well.

Typically, an invoice is not created right away — only a payment request is issued. The reason is that with an invoice, you are required to remit VAT even if the invoice remains unpaid. Additionally, in double-entry bookkeeping, unpaid invoices must also be recognized as revenue and taxed.

When importing data for a payment request, proforma tax document, credit note, debit note, or invoice, the document is always treated as an issued invoice.
What distinguishes them is the document type, which determines the type of document.
When a new company (database) is created, several basic document types are set up. The document type determines whether the document is an accounting or non-accounting document, as well as the number series
into which the document will be placed (see the overview of available document type options).

Document posting is controlled by the posting rule (which can also be set in the document type; however, a payment request does not require posting).

Setting up the "payment request" document type

To create a payment request, you must configure the following settings:

  • Select the type "proforma"

  • Uncheck "Document is an accounting document"

  • Select or create a new document series

  • Abbreviation: will be used when creating the document type

  • Name: will be used as the document heading

  • Additional settings such as account, payment method, due date, etc. can also be configured

When creating a payment request, you need to clarify several things:

  • price list item or item with price and quantity? When creating a document, you can use an item from a price list, optionally issue it from stock, apply a default price (including various partner discounts), or create a custom line item.

  • currency: will it be in CZK or in a foreign currency?

  • recipient: will you use a recipient from the address book, or specify one only for this invoice?

Now let's create the simplest payment request:

<?xml version="1.0" encoding="utf-8"?><winstrom version="1.0">  <faktura-vydana>    <!-- ID, které jednoznačně identifikuje výzvu k platbě. Slouží při opakovaném importu -->    <id>ext:FAKTURACE:WINSTROM_11</id>    <typDokl>code:VÝZVA K PLATBĚ</typDokl>    <!-- kód firmy, které posíláme výzvu k platbě -->    <firma>code:PBENDA</firma>    <polozkyFaktury>      <PolFak>        <!-- neskladová položka z ceníku INTERNET -->        <cenik>code:INTERNET</cenik>        <typPolozkyK>typPolozky.katalog</typPolozkyK>        <mnozMj>1</mnozMj>      </PolFak>    </polozkyFaktury>  </faktura-vydana></winstrom>

The invoice is now created as follows (learn more about command-line calls):

curl -u winstrom:winstrom -f -L http://demo.flexibee.eu:5434/c/demo/faktura-vydana.xml -T faktura.xml

The resulting payment request must be sent to the customer.

Customer Identification

To link a payment request to a company, you need to use a company identifier. You can use the ID (primary key), company registration number, or code (learn more about identifiers).

Payment Matching

Flexi supports importing bank statements and matching payments. No custom adjustments are therefore required. The accounting system handles all scenarios such as partial payments, a single payment covering multiple documents, overpayments, and so on.

Sending a Tax Document

You can create the tax document directly in Flexi and send it to the customer. Alternatively, you can give customers access to an invoice listing.

If you send a payment request to a customer and they pay it, you are required to send them either a proforma tax document or a full tax document (invoice) within 14 days.

Notifying Non-Payers

To notify non-payers, we first need to identify them. This can be done easily with the following query:

curl -u winstrom:winstrom -f -L "http://demo.flexibee.eu:5434/c/demo/faktura-vydana/(stavUhrK != 'stavUhr.uhrazeno' and datSplat < now() and typDokl='code:VÝZVA K PLATBĚ').xml?detail=detail&xpath=//winstrom/faktura-vydana/firma/text()

You can then take the individual companies and notify them.

Penalizing Non-Payers

We use a query similar to the one from the previous step, and then perform the actions that lead to disconnecting the user.

Did this answer your question?