Mews.Fiscalizations.Italy 7.0.1 Prefix Reserved

Install-Package Mews.Fiscalizations.Italy -Version 7.0.1
dotnet add package Mews.Fiscalizations.Italy --version 7.0.1
<PackageReference Include="Mews.Fiscalizations.Italy" Version="7.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mews.Fiscalizations.Italy --version 7.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Mews.Fiscalizations.Italy, 7.0.1"
#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.Italy as a Cake Addin
#addin nuget:?package=Mews.Fiscalizations.Italy&version=7.0.1

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

📃 Description

A client library for reporting invoices through SDI (Sistema di interscambio) using Uniwix API. Here are the main parts of the library:

  • Uniwix Client that handles communication with the SDI through Uniwix API.
  • DTOs that can be serialized into XML conforming to the FatturaPA format (the official format in which all invoices need to be reported).
  • DTOs for handling messages sent by the Uniwix/SDI.

⚙️ Installation

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

Install-Package Mews.Fiscalizations.Italy

🎯 Features

  • Functional approach via FuncSharp.
  • No Italian abbreviations.
  • Early data validation.
  • Asynchronous I/O.
  • All endpoints are covered with tests.
  • Intuitive immutable DTOs.
  • Cross platform (uses .NET Standard).

📦 NuGet

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

🔐 Security protocol

  • TLS 1.0 protocol must be enabled, that can be achieved by adding the following line to your code:
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls;

👀 Code Examples

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

Uniwix Client can be created using the Username and Password which can be created through Uniwix website.

  1. Invoices can be reported to the SDI using SendInvoiceAsync API which requires the ElectronicInvoice (the invoice to be reported) as a parameter.
  2. Invoice can be retrieved using SendInvoiceAsync API which requires the fileId of the invoice that was already submitted as a parameter.
  3. It is possible to confirm that the credentials are valid using VerifyCredentialsAsync API which would return a flag that indicates if the credentials are valid or not.

Create Electronic invoice

var invoice = new ElectronicInvoice
{
    Version = VersioneSchemaType.FPR12,
    Header = invoiceHeader,
    Body = new[] { invoiceBody }
};

Create invoice header

var header = new ElectronicInvoiceHeader
{
    TransmissionData = new TransmissionData
    {
        SequentialNumber = "1",
        DestinationCode = "1234567",
        TransmitterId = senderId,
        TransmissionFormat = TransmissionFormat.FPR12,
    },
    Provider = new Provider
    {
        IdentificationData = new IdentificationData
        {
            VatTaxId = senderId,
            Identity = new Identity
            {
                CompanyName = "Italian company ltd."
            },
            FiscalRegime = FiscalRegime.Ordinary
        },
        OfficeAddress = address
    },
    Buyer = new Buyer
    {
        IdentityData = new SimpleIdentityData
        {
            Identity = new Identity
            {
                FirstName = "John",
                LastName = "Smith"
            },
            TaxCode = "SDASDA96L27H501H"
        },
        OfficeAddress = address
    }
};

Create sender id

var senderId = new SenderId
{
    CountryCode = Countries.Italy.Alpha2Code,
    TaxCode = "1234567"
};

Create address

var address = new Address
{
    Street = "Roma Street",
    City = "Rome",
    CountryCode = Countries.Italy.Alpha2Code,
    ProvinceCode = "RM",
    Zip = "00031"
};

Create invoice body

var invoiceBody = new ElectronicInvoiceBody
{
    GeneralData = new GeneralData
    {
        GeneralDocumentData = new GeneralDocumentData
        {
            DocumentType = DocumentType.Invoice,
            CurrencyCode = "EUR",
            IssueDate = DateTime.UtcNow,
            DocumentNumber = "1",
            TotalAmount = 100m
        }
    },
    ServiceData = new ServiceData
    {
        InvoiceLines = new[] { invoiceLine },
        TaxSummary = new[] { taxSummary }
    },
    PaymentData = new[] { paymentData }
};

Create invoice line

var invoiceLine = new InvoiceLine
{
    LineNumber = "1",
    Description = "Item 1",
    UnitCount = 1m,
    PeriodStartingDate = DateTime.UtcNow,
    PeriodClosingDate = DateTime.UtcNow,
    UnitPrice = 100m,
    TotalPrice = 100m,
    VatRate = 10m
};

Create tax rate summary

var taxSummary = new TaxRateSummary
{
    VatRate = 10m,
    TaxAmount = 9m,
    TaxableAmount = 90m,
    VatDueDate = VatDueDate.Immediate
};

Create payment data

var paymentData = new PaymentData
{
    PaymentDetails = new [] { paymentDetail },
    PaymentTerms = PaymentTerms.LumpSum
};

Create payment detail

var paymentDetail = new PaymentDetail
{
    PaymentMethod = PaymentMethod.Cash,
    PaymentAmount = 100m
};

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
7.0.1 64 11/5/2021
7.0.0 103 7/27/2021
6.0.0 110 7/21/2021
5.0.0 101 5/25/2021