Fiscalo.Sdk 0.1.1

dotnet add package Fiscalo.Sdk --version 0.1.1
                    
NuGet\Install-Package Fiscalo.Sdk -Version 0.1.1
                    
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="Fiscalo.Sdk" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fiscalo.Sdk" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Fiscalo.Sdk" />
                    
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 Fiscalo.Sdk --version 0.1.1
                    
#r "nuget: Fiscalo.Sdk, 0.1.1"
                    
#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 Fiscalo.Sdk@0.1.1
                    
#: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=Fiscalo.Sdk&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Fiscalo.Sdk&version=0.1.1
                    
Install as a Cake Tool

Fiscalo .NET SDK

Official .NET SDK for the Fiscalo API.

Fiscalo.Sdk helps teams integrate Fiscalo faster in ASP.NET Core, console apps, Windows services and other .NET workloads, with first-class support for customers, items, document series, documents, idempotency and PDF retrieval.

Installation

Install from NuGet:

dotnet add package Fiscalo.Sdk

For local development inside the SDK repository:

<ProjectReference Include="..\\..\\src\\Fiscalo.Sdk\\Fiscalo.Sdk.csproj" />

Requirements

  • .NET 8 or later
  • A Fiscalo API key
  • Sandbox base URL for development: https://api.fiscalo.test/api/v1
  • Production base URL: https://api.fiscalo.pt/api/v1

Quick Start

using Fiscalo.Sdk;

var fiscalo = new FiscaloClient(
    apiKey: Environment.GetEnvironmentVariable("FISCALO_API_KEY")!,
    baseUrl: Environment.GetEnvironmentVariable("FISCALO_API_BASE_URL")
        ?? "https://api.fiscalo.test/api/v1",
    timeout: TimeSpan.FromSeconds(30));

ASP.NET Core

using Fiscalo.Sdk.Abstractions;
using Fiscalo.Sdk.Extensions;

builder.Services.AddFiscalo(options =>
{
    options.ApiKey = builder.Configuration["Fiscalo:ApiKey"]!;
    options.BaseUrl = builder.Configuration["Fiscalo:BaseUrl"]
        ?? "https://api.fiscalo.test/api/v1";
    options.Timeout = TimeSpan.FromSeconds(30);
});

app.MapGet("/customers", async (IFiscaloClient fiscalo) =>
{
    var response = await fiscalo.Customers.ListAsync();

    return Results.Ok(response.Items);
});

Example Document Flow

using Fiscalo.Sdk;
using Fiscalo.Sdk.Models;

var fiscalo = new FiscaloClient(
    apiKey: "fisc_test_xxx",
    baseUrl: "https://api.fiscalo.test/api/v1");

var customer = await fiscalo.Customers.CreateAsync(new CreateCustomerRequest
{
    Name = "Cliente .NET",
    CustomerType = "company",
    Country = "PT",
    Email = "cliente@example.pt",
});

var item = await fiscalo.Items.CreateAsync(new CreateItemRequest
{
    Name = "Serviço de implementação",
    Type = "service",
    Unit = "un",
    UnitPrice = 100m,
});

var series = await fiscalo.DocumentSeries.CreateAsync(new CreateDocumentSeriesRequest
{
    DocumentType = "invoice",
    Code = "A",
});

var document = await fiscalo.Documents.CreateAsync(new CreateDocumentRequest
{
    CustomerId = customer.Data?.Id,
    SeriesId = series.Data?.Id,
    DocumentType = "invoice",
}, idempotencyKey: Guid.NewGuid().ToString("N"));

await fiscalo.Documents.AddLineAsync(document.Data?.Id!, new CreateDocumentLineRequest
{
    ItemId = item.Data?.Id,
    Description = "Serviço de implementação",
    Quantity = 1,
    Unit = "un",
    UnitPrice = 100m,
});

await fiscalo.Documents.IssueAsync(document.Data?.Id!);
await fiscalo.Documents.GeneratePdfAsync(document.Data?.Id!);
var pdf = await fiscalo.Documents.GetPdfAsync(document.Data?.Id!);

Error Handling

The SDK raises typed exceptions so integrations can react to API failures in a predictable way:

  • FiscaloAuthenticationException
  • FiscaloValidationException
  • FiscaloNotFoundException
  • FiscaloRateLimitException
  • FiscaloIdempotencyException
  • FiscaloApiException
using Fiscalo.Sdk.Exceptions;

try
{
    await fiscalo.Customers.CreateAsync(new CreateCustomerRequest
    {
        Name = "Cliente Demo",
        CustomerType = "company",
    });
}
catch (FiscaloValidationException exception)
{
    Console.WriteLine(exception.RequestId);
    Console.WriteLine(exception.Message);
}

Integration Notes

  • The SDK sends Authorization: Bearer automatically.
  • Use Idempotency-Key for create, line and issue operations.
  • Response envelopes expose RequestId for observability and support.
  • JSON payloads are serialized in snake_case.

Repository Layout

  • src/Fiscalo.Sdk
  • tests/Fiscalo.Sdk.Tests
  • examples/ConsoleInvoiceFlow
  • examples/AspNetCoreMinimalApi
  • examples/WindowsService
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
0.1.1 90 6/14/2026

Initial public release of the Fiscalo .NET SDK for sandbox and production integrations.