MyTaxClient 1.0.6

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

MyTaxClient – API-клиент сервиса "Мой налог" от ФНС NuGet

Клиент для работы с API сервиса "Мой налог" от ФНС РФ для самозанятых. Позволяет автоматизировать регистрацию и аннулирование чеков.

Быстрый старт

  1. Установите пакет:
dotnet add package MyTaxClient
  1. Зарегистрируйте клиент (Program.cs):
using MyTaxClient;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMyTaxClient(builder.Configuration);
  1. Сконфигурируйте (appsettings.json):
{
  "MyTax": {
    "Username": "ВАШ_ИНН",
    "Password": "ВАШ_ПАРОЛЬ",
    "DeviceIdPrefix": "test_", // Опционально
    "ApiUrl": "https://lknpd.nalog.ru/api/v1/" // Опционально
  }
}

Или через переменные окружения:

MyTax__Username=ВАШ_ИНН
MyTax__Password=ВАШ_ПАРОЛЬ

Конфигурация

Все параметры конфигурации (MyTaxClientOptions):

Параметр Описание
Username ИНН самозанятого (обязательный)
Password Пароль от сервиса "Мой налог" (обязательный)
DeviceIdPrefix Префикс для генерации DeviceId (по умолчанию пустая строка)
ApiUrl URL API сервиса (по умолчанию https://lknpd.nalog.ru/api/v1/)

Пример ручной настройки без IConfiguration:

builder.Services.AddMyTaxClient(configure: options => 
{
    options.Username = "ВАШ_ИНН";
    options.Password = "ВАШ_ПАРОЛЬ";
});

Примеры использования

Регистрация чека

var myTaxClient = services.GetRequiredService<MyTaxReceiptsClient>();
await myTaxClient.ApproveReceipt(new ApproveReceiptRequest
{
    Services = [ new Service(Name: "Услуга1", Quantity: 1, Amount: 100.00M) ],
    PaymentTime = DateTimeOffset.UtcNow
});

Аннулирование чека

var myTaxClient = services.GetRequiredService<MyTaxReceiptsClient>();
await myTaxClient.CancelReceipt(new CancelReceiptRequest
{
    ReceiptUuid = "tv8aiukhu3"
    CancellationTime = DateTimeOffset.UtcNow
});
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
1.0.6 116 1/2/2026
1.0.5 91 1/2/2026
1.0.4 99 1/2/2026
1.0.3 98 1/2/2026
1.0.2 97 1/2/2026
1.0.1 96 1/2/2026
0.0.0-alpha.0.1 57 1/2/2026