Mews.Fiscalizations.Germany 6.0.0 Prefix Reserved

Install-Package Mews.Fiscalizations.Germany -Version 6.0.0
dotnet add package Mews.Fiscalizations.Germany --version 6.0.0
<PackageReference Include="Mews.Fiscalizations.Germany" Version="6.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mews.Fiscalizations.Germany --version 6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Mews.Fiscalizations.Germany, 6.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Mews.Fiscalizations.Germany as a Cake Addin
#addin nuget:?package=Mews.Fiscalizations.Germany&version=6.0.0

// Install Mews.Fiscalizations.Germany as a Cake Tool
#tool nuget:?package=Mews.Fiscalizations.Germany&version=6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

📃 Description

The library uses Fiskaly API to report the invoices, for more information, please check their Documentation.

⚙️ Installation

The library can be installed through NuGet packages or the command line as mentioned below:

Install-Package Mews.Fiscalizations.Germany

🎯 Features

  • Functional approach via FuncSharp.
  • No German abbreviations.
  • Early data validation.
  • Asynchronous I/O.
  • All endpoints are covered with tests.
  • Intuitive immutable DTOs.
  • Pipelines that run on both Windows and Linux operating systems.
  • Cross platform (uses .NET Standard).

📦 NuGet

We have published the library as Mews.Fiscalizations.Germany.

👀 Code Examples

P.S Please note that we keep files of the older API versions, but we run the tests on the latest supported API version and not older ones.

Listed below are some of the common examples. If you want to see more code examples, please check the Tests.

Fiskaly Client can be created using the ApiKey and ApiSecret which can be created through Fiskaly dashboard.

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:

  1. Invoice type (invoice or receipt).
  2. Payments which is a list of the amounts paid, type of payment, and the currency.
  3. 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) }
);
  1. 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.
  2. 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).

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
6.0.0 100 11/8/2021
5.0.0 81 11/5/2021
4.2.2 77 11/5/2021
4.2.1 103 11/4/2021
4.2.0 95 10/11/2021
4.1.0 90 10/7/2021
4.0.0 80 9/24/2021
3.0.0 126 7/21/2021
2.0.4 96 7/19/2021
2.0.3 123 7/14/2021
2.0.2 88 7/13/2021
2.0.1 99 7/8/2021
2.0.0 157 5/24/2021