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" />
<PackageReference Include="MyTaxClient" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=MyTaxClient&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MyTaxClient – API-клиент сервиса "Мой налог" от ФНС 
Клиент для работы с API сервиса "Мой налог" от ФНС РФ для самозанятых. Позволяет автоматизировать регистрацию и аннулирование чеков.
Быстрый старт
- Установите пакет:
dotnet add package MyTaxClient
- Зарегистрируйте клиент (Program.cs):
using MyTaxClient;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMyTaxClient(builder.Configuration);
- Сконфигурируйте (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 | 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. 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.
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.