How e-invoice integration works: from incoming invoice to automatic stock deduction
E-invoice (e-Fatura) integration step by step: provider connection, incoming invoices, supplier and product matching, exceptions, stock and cost updates.
- e-Invoice
- Integration
- Inventory Management

A grocery store, restaurant or wholesaler receives dozens of supplier invoices every day. Even though each one already arrives digitally as an e-invoice (e-Fatura), in most businesses stock entry is still done by hand: the invoice is printed, each line is matched to a product card, quantities and costs are typed in. E-invoice integration breaks that chain: incoming invoices are fetched automatically, lines are matched to products, stock and cost are updated, and a person only reviews the exceptions. Here is the flow we set up in our retail automation projects, step by step.
Who is who in the e-invoice system?
In Türkiye, e-invoicing runs through the Turkish Revenue Administration (GİB) system via licensed private integrators, the e-invoice providers. Your supplier sends the invoice to its own provider; the invoice reaches your provider through GİB. The integration software pulls incoming invoices in UBL-TR format (XML) through the web services your provider exposes. So the first link in the integration is the API connection to your provider.
Step 1: Fetching incoming invoices automatically
At set intervals the integration service polls the provider for new invoices, downloads them and stores them raw in its own database. This record matters: even if the matching changes later, you always have the original document. To prevent the same invoice from being processed twice, the invoice number and the supplier's tax number are used together as a unique key. The polling frequency is tuned to the rhythm of the business: every few minutes for a grocery store with busy morning deliveries, once an hour for a business buying wholesale weekly.
Step 2: Matching the supplier account
The tax ID (VKN) or national ID (TCKN) on the invoice is matched to the supplier account in your system. For a supplier invoicing you for the first time, the system proposes a new account automatically; approving it is a single click. This step is usually painless, because tax numbers are unique.
Step 3: Matching products (the hard part)
The real difficulty is in the product lines. The supplier's invoice shows an abbreviated product name in capital letters and a quantity in cases; your system holds the same product under a different name and counts it in units. The matching engine uses the following clues, in order:
- Barcode: if the invoice line carries a barcode, it matches directly; this is the most reliable route.
- Supplier product code: approved matches from the same supplier's earlier invoices are remembered; from the second invoice onwards they match automatically.
- Name similarity: without a code, a candidate list is offered based on text similarity; the user picks and the choice is learned.
Case-to-unit conversion is solved here too: 10 cases on the invoice, 240 units in the system. A supplier-specific pack quantity is defined on the product card; once defined, it is applied automatically on every invoice.
Step 4: Exception approval
Full automation has limits. In these situations the system moves the invoice to a 'pending approval' queue and notifies the person in charge:
- An unmatched product line (a new product or an unrecognised code)
- A unit price deviating from the last purchase price by more than a set threshold
- A quantity or amount inconsistency (line totals do not add up to the invoice total)
- Items that were ordered but are missing from the invoice (when purchase order comparison is enabled)
That person sees the invoice on a single screen, completes the missing match or approves the deviation. Each decision is learned; over time, fewer invoices land in the approval queue.
Step 5: Updating stock and cost
An invoice that is approved, or passes without exceptions, becomes a goods receipt: product quantities go up, the purchase price and, where used, the weighted average cost are updated, and a payable is posted to the supplier account. If the accounting program or ERP is a separate system (Logo or Nebim, for example), the same receipt is transferred there too, so stock, cost and accounting are fed from a single source. If goods are physically counted on arrival, the difference between invoice and count is recorded as a separate document, so any short-delivery dispute with the supplier rests on evidence.
What about outgoing invoices?
The same infrastructure works in reverse: sales invoices are generated from your system in UBL-TR format, sent to the provider, and the GİB status responses (accepted, rejected, error) are tracked. A complete e-invoice integration covers both directions, but the incoming side is where businesses save the most time.
What to prepare before the setup begins
- API credentials for your e-invoice provider (username, password, service address)
- Barcodes filled in on product cards; if they are missing, a barcode clean-up comes first
- Correct tax ID (VKN) and national ID (TCKN) fields on supplier accounts
- A person responsible for exception approvals and a notification channel (email, WhatsApp or the admin panel)
- A decision on how the goods receipt will be created on the accounting or ERP side
- Thresholds for price deviation and matching (for example, the percentage deviation from the last purchase price that requires approval)
Set up correctly, e-invoice integration cuts goods-in down to minutes and makes stock accuracy independent of human error. Get in touch to discuss how it would connect to your fiscal cash register (ÖKC), POS or ERP; we will review your provider and product data and define a clear scope.