Back to Blog
Corporate Solutions

e-Arşiv Invoice Integration in Turkey: B2C Invoicing

How e-Arşiv invoice integration works in Turkey: how it differs from e-Fatura, the registry check before every invoice, delivery by e-mail or paper, online sale details, safe retries with the ETTN, cancellations, returns and e-commerce flows.

E-ArşivE-FaturaEntegrasyonE-TicaretKurumsal Yazılım

e-Arşiv invoice integration means that invoices for buyers outside Turkey’s e-Fatura system (consumers, or businesses not registered for e-invoicing) are created inside your sales, e-commerce or ERP software, issued through an integrator and delivered to the buyer electronically. The short answer: before every invoice the software checks whether the buyer is a registered e-Fatura user; if not, it issues the document as e-Arşiv, delivers it by e-mail or on paper when requested, and tracks its status. The real work is not producing the document but preventing the wrong invoice type and preventing the same order from being invoiced twice.

What is an e-Arşiv invoice and how does it differ from e-Fatura?

An e-Fatura travels between two registered taxpayers, through the system, into the buyer’s mailbox. An e-Arşiv invoice is used when the buyer is not registered: it is issued and stored electronically, but it reaches the buyer by e-mail, an SMS link or a printout rather than through the system. Both use the same UBL-TR format; the difference is the scenario. In practice a business that adopts e-Fatura also uses e-Arşiv, because part of its customers will always be outside the system. Which businesses must adopt it and when is a separate question, covered in our article on e-invoicing requirements.

The registry check: the software decides which invoice to issue

The core of an e-Arşiv integration is choosing the type. Asking the user "e-Fatura or e-Arşiv?" produces errors; the decision has to come from a registered user lookup by tax number. The rules are simple, but each one must be written into the code:

  • If there is no tax number or national ID number, the document is issued as e-Arşiv.
  • If there is one, the lookup runs before every invoice; a registered buyer receives an e-Fatura in their mailbox.
  • If the lookup fails, the software does not fall back to e-Arşiv; the invoice waits in the queue and is retried.
  • A manually ticked "e-invoice user" field on the customer card is never used for the decision; a buyer’s status changes over time.
  • The lookup result is stored with the invoice, with date and time; it is the answer to "why was this type issued" later on.
Issuing an e-Arşiv invoice to a registered buyer means issuing the same sale again with the correct document. A shortcut that skips the lookup comes back at month end as a correction list for accounting.

Integration options: portal, private integrator, direct

e-Arşiv has the same three routes: issuing manually on the Revenue Administration (GİB) portal, issuing from your software through a private integrator’s API, and direct integration for high-volume companies. The portal can be enough for a business with a few invoices a day; for any business invoicing from an order system the realistic route is a private integrator. The sending, status polling and error handling flow is the same as for e-Fatura and is covered in detail in our e-invoice integration guide; this article covers only what is specific to e-Arşiv.

How does the invoice reach the buyer?

With e-Fatura the system handles delivery; with e-Arşiv delivery is your responsibility. If the buyer gave an e-mail address, the document goes by e-mail and the delivery result is stored with the invoice; if there is no address or the customer asks for it, a printout is handed over. For sales made over the internet the invoice is flagged as an online sale, and the payment method, payment date, shipping date and carrier details are written into the relevant fields; if these are left empty the integrator may reject the document. E-mails that bounce should appear in a separate list from which customer service can resend the invoice.

Code example: choosing the type and retrying safely

The TypeScript example below shows two rules: the type decision comes from the lookup and no invoice is issued when the lookup fails; the ETTN (the invoice’s universally unique number) is generated and saved once before the first send, so a retry after a timeout can never create a second invoice.

type Buyer = { taxId?: string; name: string; email?: string };
type Order = { id: string; buyer: Buyer; ettn?: string; isOnlineSale: boolean };
type Decision =
  | { kind: 'e-fatura'; alias: string }
  | { kind: 'e-arsiv'; delivery: 'email' | 'paper'; onlineSale: boolean };

// lookupRegistry returns the receiver alias, or null if the buyer is not
// registered. It throws on network errors: then no invoice is issued and
// the order waits in the queue instead of falling back to e-Arşiv.
async function chooseInvoiceType(
  order: Order,
  lookupRegistry: (taxId: string) => Promise<string | null>,
): Promise<Decision> {
  const { buyer } = order;
  if (buyer.taxId) {
    const alias = await lookupRegistry(buyer.taxId);
    if (alias) return { kind: 'e-fatura', alias };
  }
  return {
    kind: 'e-arsiv',
    delivery: buyer.email ? 'email' : 'paper',
    onlineSale: order.isOnlineSale,
  };
}

// The ETTN is created once and saved before the first send attempt,
// so a retry after a timeout can never create a second invoice.
async function ensureEttn(order: Order, save: (o: Order) => Promise<void>) {
  if (!order.ettn) {
    order.ettn = crypto.randomUUID();
    await save(order);
  }
  return order.ettn;
}

Cancellations, returns and corrections

An issued e-Arşiv invoice is never deleted from the software. A cancellation is a separate record that changes the document’s status and is stored with who did it, when and why; the period and method for cancelling depend on the regulations, so they are not hard coded but kept in a dated rules table. For a product return the original invoice is not cancelled; the return is opened as its own record and stock and the refund are linked to it. That flow is covered in our returns management article. Ask your accountant which cases call for a cancellation and which for a return document; this article is not financial or legal advice.

e-Arşiv in e-commerce and marketplace orders

In e-commerce most invoices are e-Arşiv and volumes are high, so invoicing should be tied to a specific order status (for example when payment is confirmed or the parcel is handed to the carrier) rather than waiting for someone to press an "issue invoice" button. Marketplace orders often require the invoice to be uploaded to the marketplace as well, and that upload has its own status to track. How the order side is built is covered in our articles on marketplace integration and payment integration for websites.

Common mistakes

  • Leaving the type decision to the user, or trusting an old flag on the customer card.
  • Retrying with a new ETTN after a lookup or send timeout and invoicing the same order twice.
  • Treating a successful API response as "invoice delivered"; e-mail delivery is a separate result.
  • Leaving the online sale fields empty and not noticing rejected documents until the end of the day.
  • Handling a return by deleting or overwriting the original invoice.
  • Not keeping a list of uninvoiced orders; that list should be checked every day.

Conclusion

A good e-Arşiv invoice integration chooses the type from a lookup on every invoice, issues nothing when the lookup fails, generates the ETTN once so retries are safe, records the delivery result, handles cancellations and returns as separate records without deleting anything, and keeps uninvoiced orders visible every day. Everything else is screens built on top of that foundation. For a solution that fits your sales and order flow, see our corporate solutions page or describe your current systems and request a quote.

Let's Build Your Project

Get a free consultation for your website, mobile app, or corporate software project.

Get a Free QuoteExplore our Corporate Solutions service