FactSharp 1.2.2

dotnet add package FactSharp --version 1.2.2
                    
NuGet\Install-Package FactSharp -Version 1.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FactSharp" Version="1.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FactSharp" Version="1.2.2" />
                    
Directory.Packages.props
<PackageReference Include="FactSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FactSharp --version 1.2.2
                    
#r "nuget: FactSharp, 1.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FactSharp@1.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FactSharp&version=1.2.2
                    
Install as a Cake Addin
#tool nuget:?package=FactSharp&version=1.2.2
                    
Install as a Cake Tool
                              ______           __  _____ __
                             / ____/___ ______/ /_/ ___// /_  ____ __________
                            / /_  / __ `/ ___/ __/\__ \/ __ \/ __ `/ ___/ __ \
                           / __/ / /_/ / /__/ /_ ___/ / / / / /_/ / /  / /_/ /
                          /_/    \__,_/\___/\__//____/_/ /_/\__,_/_/  / .___/
                                                                     /_/

                                   ----- WeFact C# SDK -----

FactSharp is a strongly-typed C# SDK for the WeFact invoicing API. It wraps invoicing operations — customers, invoices, invoice lines and products — behind a clean, async client surface, so you don't have to hand-roll HTTP calls, request payloads and response parsing.

Built and maintained by Belgium-Provider to power its own WeFact integrations. Shared as-is — feel free to use it, fork it, or build on top of it for your own WeFact integration.

Features

Domain Client Covers
Invoices InvoiceClient Get by id/code, list, create, send by email, add/delete invoice lines, mark as paid
Customers CustomerClient Get by id/code, list
Products ProductClient Get by id/code, list

Every client exposes a matching interface (IInvoiceClient, ICustomerClient, IProductClient), implements IDisposable, and follows a consistent VerbNounAsync naming convention.

Installation

dotnet add package FactSharp

Quickstart

using FactSharp.Builder;
using FactSharp.Client;
using FactSharp.Client.Abstract;
using FactSharp.Http.Invoice.Request;
using FactSharp.Http.Invoice.Response;
using FactSharp.Types;

// Your WeFact API key (Instellingen > Automatisering > API in the WeFact backoffice)
using IInvoiceClient invoiceClient = new InvoiceClient(apiKey: "your-wefact-api-key");

InvoiceListRequest request = new InvoiceListRequestBuilder()
    .SetStatus(EInvoiceStatus.Paid)
    .SetLimit(50)
    .Build();

InvoiceListResponse response = await invoiceClient.GetInvoiceListAsync(request);

if (response.Errors is { Count: > 0 })
{
    Console.WriteLine($"Error: {string.Join(", ", response.Errors)}");
    return;
}

foreach (var invoice in response.Invoices)
    Console.WriteLine($"{invoice.InvoiceCode} — {invoice.AmountIncl} {invoice.Currency}");

Every domain follows the same pattern: instantiate the client with your API key, build a request (directly, or through a fluent *RequestBuilder for list endpoints), await the call, and check response.Errors before reading the payload. Every response inherits from BaseResponseObject, so error handling is identical across the whole SDK — the client never throws for expected/API failures.

ASP.NET Core / DI

builder.Services.AddWeFactApi(options =>
{
    options.ApiKey = Environment.GetEnvironmentVariable("WE_FACT") ?? string.Empty;
});

Inject the resulting WeFactOptions wherever you need a client and construct it per call:

public class InvoicesController(WeFactOptions options) : ControllerBase
{
    [HttpGet("{id:int}")]
    public async Task<ActionResult<InvoiceResponse>> GetInvoiceByIdAsync(int id)
    {
        using IInvoiceClient client = new InvoiceClient(options.ApiKey);
        return Ok(await client.GetInvoiceByIdAsync(id));
    }
}

Requirements

  • .NET 10.0 SDK or later
  • A WeFact account with an API key

Resources

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.2 60 8/12/2026
1.2.1 116 4/20/2026
1.2.0 108 3/23/2026
1.1.0 152 10/31/2025
1.0.2 146 10/31/2025
1.0.0 164 10/31/2025