English | Türkçe
Modern .NET library for Turkish e-Invoice (e-Fatura / e-Arsiv) integration.
EfaturaDotnet is a clean, cross-platform, dependency-free library for creating, serializing, and submitting Turkish e-Invoices through GIB integrators like Uyumsoft. Built for .NET 8+, with async/await and CancellationToken support throughout.
- UBL-TR 1.2.1 XML serialization — System.Xml.Linq-based, no external deps
- Integrator abstraction —
IIntegratorinterface for pluggable backends (Uyumsoft, direct GIB) - Full invoice model — ETTN, VAT calculation, party tax info, line items, e-Arsiv support
- Builder pattern — Configure via
EfaturaClient.Create(options => { ... }) - Async all the way down — Every operation supports
CancellationToken
dotnet add package EfaturaDotnetusing EfaturaDotnet;
using EfaturaDotnet.Models;
var client = EfaturaClient.Create(options =>
{
options.ApiKey = "your-api-key";
options.BaseUrl = new Uri("https://api.uyumsoft.com.tr");
});
var invoice = new Invoice(
invoiceNumber: "FTR2024000001",
type: InvoiceType.Satis,
issueDate: DateTime.UtcNow,
currency: Currency.TRY,
seller: new Party(
name: "ABC Tedarik A.S.",
taxInfo: new TaxInfo("1234567890", "Beylikduzu VD"),
streetAddress: "Org. San. Bol. No:42",
city: "Istanbul",
district: "Beylikduzu",
postalCode: "34500"),
buyer: new Party(
name: "XYZ Musteri Ltd.",
taxInfo: new TaxInfo("0987654321", "Kadikoy VD"),
streetAddress: "Bagdat Cad. No:100",
city: "Istanbul",
district: "Kadikoy",
postalCode: "34700"),
lines: new[]
{
new InvoiceLine(1, "Urun A", 10m, "ADET", 150m, 20),
new InvoiceLine(2, "Urun B", 5m, "ADET", 160m, 10),
})
{
Note = "Teslim suresi 3 is gunudur.",
};
var result = await client.CreateInvoiceAsync(invoice);
Console.WriteLine($"ETTN: {result.Ettn}, Total: {invoice.GrandTotal} TL");
// => ETTN: 7b9c2a3d-..., Total: 2680.00 TL
await client.SendInvoiceAsync(result.Ettn!);EfaturaClient → builder pattern, delegates to IIntegrator
├─ IIntegrator → abstraction for GIB integrators
│ ├─ UyumsoftIntegrator
│ └─ GibIntegrator
├─ UblTrSerializer → Invoice → UBL-TR 1.2.1 XML
└─ Models (Invoice, Party, InvoiceLine, ...)
| Integrator | Status |
|---|---|
| Uyumsoft | Stub (HTTP structure ready) |
| GIB Direct | Stub (HTTP structure ready) |
Contributions for other integrators (Logo, ParaSoft, etc.) are welcome.
dotnet build
dotnet test- .NET 8.0 SDK or later
src/EfaturaDotnet/
├── EfaturaClient.cs # Main entry point
├── EfaturaClientOptions.cs # Configuration
├── Models/
│ ├── Invoice.cs # Core invoice model
│ ├── InvoiceLine.cs # Line items with VAT calc
│ ├── Party.cs # Buyer/seller info
│ ├── TaxInfo.cs # VKN, TCKN, tax office
│ ├── InvoiceType.cs # Invoice type enum
│ ├── InvoiceFilter.cs # List filter
│ ├── Currency.cs # ISO 4217 codes
│ └── EArchiveInvoice.cs # e-Arsiv extension
├── Integrators/
│ ├── IIntegrator.cs # Integrator interface
│ ├── IntegratorBase.cs # Base HTTP client
│ ├── UyumsoftIntegrator.cs
│ └── GibIntegrator.cs
├── Serialization/
│ ├── UblTrSerializer.cs # UBL-TR XML generator
│ └── UblTrConstants.cs # UBL-TR 1.2.1 constants
└── Exceptions/
├── EfaturaException.cs
└── IntegratorException.cs
- f/fatura — TypeScript (619 stars)
- furkankadioglu/efatura — PHP (437 stars)
- GIBFramework — .NET Framework (101 stars, legacy)
MIT © vaur94