Complyance .NET SDK
Production ready .NET SDK with comprehensive e-invoicing support for multiple countries including UAE, Germany, Saudi Arabia, Malaysia, and Belgium. Built for real-world e-invoice applications.
Feature Summary
- Multi-Country Support - UAE, Germany, KSA, Malaysia, Belgium
- Type Safety - Strong typing with C# models
- Async/Await - Modern async programming patterns
- Production Ready - Enterprise-grade reliability
Installation
NuGet Package Manager
dotnet add package Complyance.SDK.dotNetPackage Manager Console
Install-Package Complyance.SDK.dotNet.csproj Reference
<PackageReference Include="Complyance.SDK.dotNet" Version="3.0.0" />Quick Start
Initialize the SDK
using Complyance.SDK.dotNet;
var client = new ComplyanceClient(new ComplyanceClientOptions
{
ApiKey = "your-api-key",
BaseUrl = "https://api.complyance.io"
});Submit an Invoice
var invoice = new Invoice
{
DocumentType = "Invoice",
DocumentNumber = "INV-001",
IssueDate = DateTime.Now,
Currency = "SAR",
Seller = new Party
{
Name = "Example Company",
TaxIds = new List<TaxId>
{
new TaxId { Type = "VAT", Value = "300000000000003" }
}
},
Buyer = new Party
{
Name = "Customer Company"
},
LineItems = new List<LineItem>
{
new LineItem
{
Description = "Product",
Quantity = 1,
UnitPrice = 100.00m,
TaxRate = 15
}
}
};
var result = await client.SubmitInvoiceAsync(invoice, "SA");
Console.WriteLine($"Invoice submitted: {result.InvoiceId}");Configuration
Environment Variables
export COMPLYANCE_API_KEY="your-api-key"
export COMPLYANCE_BASE_URL="https://api.complyance.io"appsettings.json
{
"Complyance": {
"ApiKey": "your-api-key",
"BaseUrl": "https://api.complyance.io",
"Timeout": 30000
}
}Features
KSA (Saudi Arabia) - ZATCA Compliance
var ksaInvoice = new KSAInvoice
{
// Standard invoice fields
DocumentType = "Standard",
QRCode = true,
// KSA-specific extensions
Extensions = new KSAExtensions
{
InvoiceCounterValue = "1",
PreviousInvoiceHash = "NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ=="
}
};
var result = await client.SubmitInvoiceAsync(ksaInvoice, "SA");UAE - FTA PINT Compliance
var uaeInvoice = new UAEInvoice
{
DocumentType = "Tax Invoice",
Extensions = new UAEExtensions
{
TRN = "100000000000003",
SupplierTRN = "100000000000003"
}
};
var result = await client.SubmitInvoiceAsync(uaeInvoice, "AE");Malaysia - MyInvois Integration
var malaysiaInvoice = new MalaysiaInvoice
{
DocumentType = "Invoice",
Extensions = new MalaysiaExtensions
{
SoftwareProviderId = "SP-12345",
Classification = new Classification
{
Category = "001",
ProductServiceCode = "12345"
}
}
};
var result = await client.SubmitInvoiceAsync(malaysiaInvoice, "MY");Error Handling
try
{
var result = await client.SubmitInvoiceAsync(invoice, "SA");
Console.WriteLine($"Success: {result.InvoiceId}");
}
catch (ComplyanceValidationException ex)
{
Console.WriteLine($"Validation Error: {ex.Message}");
foreach (var error in ex.ValidationErrors)
{
Console.WriteLine($"- {error.Field}: {error.Message}");
}
}
catch (ComplyanceApiException ex)
{
Console.WriteLine($"API Error: {ex.StatusCode} - {ex.Message}");
}Support
- Contact: Contact Complyance for E-Invoicing - Complyance has helped over 1000+ organizations simplify global e-invoicing. Let us help you understand how Complyance can work for you.