Mews.Fiscalizations.Germany
11.0.0
Prefix Reserved
See the version list below for details.
dotnet add package Mews.Fiscalizations.Germany --version 11.0.0
NuGet\Install-Package Mews.Fiscalizations.Germany -Version 11.0.0
<PackageReference Include="Mews.Fiscalizations.Germany" Version="11.0.0" />
paket add Mews.Fiscalizations.Germany --version 11.0.0
#r "nuget: Mews.Fiscalizations.Germany, 11.0.0"
// Install Mews.Fiscalizations.Germany as a Cake Addin #addin nuget:?package=Mews.Fiscalizations.Germany&version=11.0.0 // Install Mews.Fiscalizations.Germany as a Cake Tool #tool nuget:?package=Mews.Fiscalizations.Germany&version=11.0.0
<p align="center"> <a href="https://mews.com"> <img alt="Mews" src="https://user-images.githubusercontent.com/51375082/120493257-16938780-c3bb-11eb-8cb5-0b56fd08240d.png"> </a> <br><br> <b>Mews.Fiscalizations.Germany</b> is a .NET library designed for reporting e-invoices to German tax authorities (BSI - Bundesamt fΓΌr Sicherheit in der Informationstechnik) via the <a href="https://developer.fiskaly.com/api/kassensichv/v2/">Fiskaly KassenSichV API V2</a>. <br><br> <a href="https://www.nuget.org/packages/Mews.Fiscalizations.Germany/"> <img src="https://img.shields.io/nuget/v/Mews.Fiscalizations.Germany"> </a> <a href="https://github.com/MewsSystems/fiscalizations/blob/master/LICENSE"> <img src="https://img.shields.io/github/license/MewsSystems/fiscalizations"> </a> <a href="https://github.com/MewsSystems/fiscalizations/actions/workflows/publish-germany.yml"> <img src="https://img.shields.io/github/actions/workflow/status/MewsSystems/fiscalizations/publish-germany.yml?branch=master&label=publish"> </a> <a href="https://developer.fiskaly.com/api/kassensichv/v1/"> <img src="https://img.shields.io/badge/v2-Fiskaly-lightgrey"> </a> </p>
π Description
This library enables fiscal reporting through the Fiskaly API. For more information, consult the official documentation.
βοΈ Installation
Install via NuGet or the command line:
Install-Package Mews.Fiscalizations.Germany
π― Key Features
- Functional programming approach using FuncSharp.
- Early validation of data inputs.
- Asynchronous I/O operations.
- Comprehensive test coverage for all endpoints.
- Intuitive and immutable Data Transfer Objects (DTOs).
- CI/CD pipelines compatible with both Windows and Linux.
- Cross-platform compatibility (.NET 8).
π¦ NuGet Package
Available on NuGet as Mews.Fiscalizations.Germany.
π Code Examples
Below are common usage examples. For additional code samples, see the Tests.
Setup
Create a Fiskaly client using ApiKey
and ApiSecret
:
var client = new FiskalyClient(ApiKey, ApiSecret);
All endpoints require providing a valid accessToken
var accessToken = await client.GetAccessTokenAsync();
In order to report an invoice to the German authorities, we would have to start a transaction and then finish it (change the state to FINISHED and provide the invoice to be reported.).
Creation of a new invoice
There are 3 required properties for creating an invoice:
- Invoice type (invoice or receipt).
- Payments which is a list of the amounts paid, type of payment, and the currency.
- Items which is a list of the item amounts and the VAT rate ("NORMAL" "REDUCED_1" "SPECIAL_RATE_1" "SPECIAL_RATE_2" "NULL") β ("19" "7" "10.7" "5.5" "0").
var bill = new Bill(
type: BillType.Receipt,
payments: new List<Payment>() { new Payment(25, PaymentType.Cash, "EUR") },
items: new List<Item>() { new Item(25, VatRateType.Normal) }
);
- To start a transaction, we would need to provide valid ClientId and TssId which can be created through fiskaly dashboard or by calling CreateClientAsync for creating the client and CreateTssAsync for creating the TSS which will be described below, and a unique id for the transaction.
- To finish a transaction, we would need to provide the ClientId, TssId, and the invoice to be reported and the transaction id that we specified in the step above.
Example:
var transactionId = Guid.NewGuid();
var startedTransaction = await client.StartTransactionAsync(accessToken, clientId, tssId, transactionId);
var endedTransaction = await client.FinishTransactionAsync(accessToken, clientId, tssId, InvoiceToReport, transactionId);
Creation of a new client id
var client = await client.CreateClientAsync(accessToken, TssId);
var clientId = client.SuccessResult.Id;
Creation of a new Tss id
var tss = await client.CreateTssAsync(accessToken);
var tssId = tss.SuccessResult.Id;
var puk = tss.SuccessResult.AdminPuk; // Store it. It's needed for setting or changing admin Pin.
Since the created above TSS will be created with state = "Created", it cannot be used yet, so we should update the state to Uninitialized.
Updating Tss state
var tss = await client.UpdateTssAsync(accessToken, tssToUpdateId, TssState.Uninitialized);
After updating the TSS state to Uninitialized, It will be possible to change the admin PIN using the PUK code we recieved in the response above.
Changing admin PIN
await client.ChangeAdminPinAsync(accessToken, tssId, tss.AdminPuk, newAdminPin: "123123");
Authenticate using the PIN created above
await client.AdminLoginAsync(accessToken, tssId, "123123");
After authenticating with the admin PIN, we can update the state of the TSS from Uninitialized to Initialized (using the update as described above).
Product | Versions 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. |
-
net8.0
- FuncSharp (>= 10.0.2)
- Mews.Fiscalizations.Core (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
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 |
---|---|---|
11.0.1 | 93 | 2/25/2025 |
11.0.0 | 90 | 2/21/2025 |
10.0.2 | 77 | 1/13/2025 |
10.0.1 | 129 | 6/26/2024 |
10.0.0 | 343 | 1/29/2024 |
9.0.0 | 675 | 8/27/2023 |
8.0.2 | 761 | 8/2/2023 |
8.0.1 | 724 | 7/26/2023 |
8.0.0 | 771 | 7/24/2023 |
7.0.3 | 940 | 10/24/2022 |
7.0.2 | 960 | 10/21/2022 |
7.0.1 | 950 | 10/17/2022 |
7.0.0 | 990 | 9/6/2022 |
6.0.2 | 993 | 7/4/2022 |
6.0.1 | 1,034 | 3/16/2022 |
6.0.0 | 947 | 11/8/2021 |
5.0.0 | 904 | 11/5/2021 |
4.2.2 | 892 | 11/5/2021 |
4.2.1 | 909 | 11/4/2021 |
4.2.0 | 948 | 10/11/2021 |
4.1.0 | 891 | 10/7/2021 |
4.0.0 | 868 | 9/24/2021 |
3.0.0 | 957 | 7/21/2021 |
2.0.4 | 949 | 7/19/2021 |
2.0.3 | 964 | 7/14/2021 |
2.0.2 | 918 | 7/13/2021 |
2.0.1 | 907 | 7/8/2021 |
2.0.0 | 1,551 | 5/24/2021 |