How to open and read a Turkish e-invoice (e-Fatura) XML file
If you do business in Türkiye, sooner or later a supplier or your e-invoice provider sends you an .xml file instead of a PDF. Opened in a browser it’s a wall of tags. Yet that file is the legal invoice: the tidy invoice page you’re used to is generated from it. This guide shows where things are in the XML and what the main fields mean.
What UBL-TR is
Turkish e-invoices (e-Fatura) and e-archive invoices (e-Arşiv) are XML files in UBL-TR, the Turkish customisation of the international UBL 2.1 standard. You can see it at the top of the file: UBLVersionID is 2.1 and CustomizationID is TR1.2. Element names are in English; the Revenue Administration (GİB) publishes Turkish names and rules for each in its UBL-TR guides (GİB e-document announcements, in Turkish).
e-Fatura or e-Arşiv?
Both use the same format. The difference is who receives the invoice:
- e-Fatura is used when both parties are registered in the e-invoice system. The invoice is delivered electronically.
- e-Arşiv is issued to taxpayers who aren’t registered in the e-invoice system and to non-taxpayers, and is delivered on paper or electronically as the buyer prefers (GİB on e-Arşiv, in Turkish).
The scenario field tells you which one you have.
Scenario: TEMELFATURA or TICARIFATURA?
ProfileID holds the scenario. The ones you’ll see most:
- TEMELFATURA (basic invoice): the buyer can’t reject it inside the system. Objections go through the external channels in the Turkish Commercial Code: a notary, registered letter, telegram or registered e-mail (KEP).
- TICARIFATURA (commercial invoice): the buyer can accept or reject it inside the system within 8 days of receiving it. The parties have to agree to use this scenario; the invoice itself is the same as a basic one.
- EARSIVFATURA: an e-archive invoice.
There are others, such as IHRACAT (export), KAMU (public sector) and YOLCUBERABERFATURA. The 8 days come from Article 21 of the Turkish Commercial Code: whoever receives an invoice and doesn’t object to its content within eight days is deemed to have accepted it.
Invoice type
InvoiceTypeCode says what the invoice is for. Common values:
- SATIS: a sale of goods or services
- IADE: a return
- TEVKIFAT: an invoice with VAT withholding (returns: TEVKIFATIADE)
- ISTISNA: an invoice with a VAT exemption
- OZELMATRAH: a special tax base invoice
- IHRACKAYITLI: a sale with export registration
Withholding invoices are explained with a worked example in a separate post.
Invoice number and ETTN
Two numbers often get mixed up:
- The invoice number (
ID) has 16 characters: a 3-character unit code, the 4-digit year and a 9-digit sequence, for exampleABC2026000000123. An issuer can use each number only once. - The ETTN (
UUID), the universal unique identifier, is a long GUID such asa1b2c3d4-…that makes the invoice unique everywhere.
When you import invoices into your accounting system, the ETTN is the safest key for spotting duplicates.
Parties
AccountingSupplierPartyis the supplier, who issued the invoice.AccountingCustomerPartyis the customer, who received it.
Each party’s ID is under PartyIdentification: a tax number (schemeID="VKN") for companies, a national ID number (schemeID="TCKN") for individuals. The tax office name is under PartyTaxScheme.
Lines, taxes and totals
InvoiceLine: each line’s quantity and unit, unit price and line amount. Unit codes are standard, for exampleC62for pieces andKGMfor kilograms.TaxTotal: taxes and subtotals by rate. VAT has the tax type code0015.WithholdingTaxTotal: withholding, if any, with its three-digit code, for example624for freight transport at 2/10.LegalMonetaryTotal: the invoice totals.
The totals are worth reading carefully:
LineExtensionAmount: quantity times unit priceTaxExclusiveAmount: excluding taxes, including discounts or surcharges (the tax base)TaxInclusiveAmount: including taxes, discounts and surchargesAllowanceTotalAmount: total discountPayableAmount: the amount to pay
You may also find order (OrderReference) and delivery note (DespatchDocumentReference) references, payment means (PaymentMeans), notes (Note) and the document currency (DocumentCurrencyCode). The Signature block holds the electronic seal or signature.
Where the invoice page comes from
The readable invoice isn’t in the XML itself but in an XSLT template that turns the data into a page. UBL-TR lets documents be embedded in the invoice, and “XSLT” is one of the attachment types named in the guides.
One rule is worth remembering: according to GİB’s guide, if the rendered page and the XML ever disagree, the XML prevails (e-Fatura portal guide, in Turkish). If something on the page looks odd, check the XML.
Where to get the XML
Usually from the same screen where you see the invoice: your e-invoice provider’s portal or GİB’s portal. GİB’s portal guide also describes downloading incoming and outgoing invoices.
Read it in your browser
To open the XML as a readable invoice, export the lines for Excel or list many invoices in one table, use the e-invoice viewer on this site. The file is read in your browser and never uploaded.
Thinking about something similar?
Approval flows, Microsoft 365 and Power Automate automation, ERP and e-invoice integrations, and company websites for small businesses.