Sufficit.Gateway.ReceitaNet
1.26.419.1946
dotnet add package Sufficit.Gateway.ReceitaNet --version 1.26.419.1946
NuGet\Install-Package Sufficit.Gateway.ReceitaNet -Version 1.26.419.1946
<PackageReference Include="Sufficit.Gateway.ReceitaNet" Version="1.26.419.1946" />
<PackageVersion Include="Sufficit.Gateway.ReceitaNet" Version="1.26.419.1946" />
<PackageReference Include="Sufficit.Gateway.ReceitaNet" />
paket add Sufficit.Gateway.ReceitaNet --version 1.26.419.1946
#r "nuget: Sufficit.Gateway.ReceitaNet, 1.26.419.1946"
#:package Sufficit.Gateway.ReceitaNet@1.26.419.1946
#addin nuget:?package=Sufficit.Gateway.ReceitaNet&version=1.26.419.1946
#tool nuget:?package=Sufficit.Gateway.ReceitaNet&version=1.26.419.1946
<p align="center"> <img src="https://raw.githubusercontent.com/sufficit/sufficit-gateway-receitanet/main/icon.png" alt="ReceitaNet" width="100" /> </p>
Sufficit.Gateway.ReceitaNet
About
Sufficit.Gateway.ReceitaNet is a .NET client library for the official ReceitaNet URA API.
It wraps the main provider operations used by Sufficit integrations, including customer lookup, connection status checks, billing notifications, payment notifications, ticket creation, and recording updates.
The package keeps the ReceitaNet token explicit per request, because the external API expects the token in the query string instead of using Bearer authentication.
Features
- Customer lookup by contract, phone, or CPF/CNPJ
- Connection status queries
- Billing notification by email or SMS
- Payment notification requests
- Ticket creation for support flows
- Ticket recording update requests
- Support for
contratosreturned as either a single object or an array - Request contract tests and optional live integration tests
Installation
Add the NuGet package reference:
<PackageReference Include="Sufficit.Gateway.ReceitaNet" Version="*" />
Register the gateway in dependency injection:
services.AddGatewayReceitaNet();
Configure the ReceitaNet section in your application settings:
{
"ReceitaNet": {
"BaseUrl": "https://sistema.receitanet.net/api/novo/ura/",
"ClientId": "ReceitaNet",
"TimeOut": 30,
"Agent": "Sufficit C# API Client"
}
}
Usage
Inject APIClientService and pass the provider token explicitly on each request:
public class ReceitaNetProbe
{
private readonly APIClientService _client;
public ReceitaNetProbe(APIClientService client)
{
_client = client;
}
public async Task<int?> FindContractByDocumentAsync(string token, string document, CancellationToken cancellationToken)
{
var response = await _client.GetContractByDocument(token, document, cancellationToken);
return response.Contract?.EffectiveContractId;
}
}
The official ReceitaNet payload currently exposes both idCliente and contratoId in lookup responses.
Use ContractId or EffectiveContractId for follow-up contract-scoped operations such as status, notifications, and ticket creation.
EffectiveContractId falls back to ClientId only to preserve compatibility with older payloads that omit contratoId.
Main operations exposed by the package:
GetContract(...)GetContractByPhone(...)GetContractByDocument(...)GetConnectionStatus(...)ChargeNotification(...)PaymentNotification(...)Ticket(...)Recording(...)
Tests
Tests live under test/.
Run the full suite with:
dotnet test test/Sufficit.Gateway.ReceitaNet.IntegrationTests.csproj -c Release
The suite includes:
- HTTP request contract tests for each ReceitaNet endpoint
ContractResponsedeserialization tests for single-object and array payloads- Guardrail tests for
ProtectedApiQueryTokenHandler - Optional live integration tests driven by
test/appsettings.jsonor environment variables
Mutating tests stay disabled by default through ReceitaNet:AllowSideEffects = false.
Only enable them when you explicitly want to execute real notification, ticket, or recording operations.
License
This repository is distributed under the license shipped in license.
Support
- Issues: https://github.com/sufficit/sufficit-gateway-receitanet/issues
- Telegram: https://t.me/sufficitti/2
Related
- Official ReceitaNet API documentation: https://www.receitanet.net/api/ura/
- Official ReceitaNet OpenAPI: https://www.receitanet.net/api/ura/openapi.yaml
- Repository: https://github.com/sufficit/sufficit-gateway-receitanet
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.AspNetCore.Authorization (>= 9.0.15 && < 10.0.0)
- Microsoft.AspNetCore.SignalR.Client (>= 9.0.15 && < 10.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.15 && < 10.0.0)
- Microsoft.Extensions.Http (>= 9.0.15 && < 10.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.15 && < 10.0.0)
- System.Net.Http.Json (>= 9.0.15 && < 10.0.0)
-
net7.0
- Microsoft.AspNetCore.Authorization (>= 7.0.20 && < 8.0.0)
- Microsoft.AspNetCore.SignalR.Client (>= 7.0.20 && < 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0 && < 8.0.0)
- Microsoft.Extensions.Http (>= 7.0.0 && < 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0 && < 8.0.0)
- System.Net.Http.Json (>= 7.0.1 && < 8.0.0)
-
net9.0
- Microsoft.AspNetCore.Authorization (>= 9.0.15 && < 10.0.0)
- Microsoft.AspNetCore.SignalR.Client (>= 9.0.15 && < 10.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.15 && < 10.0.0)
- Microsoft.Extensions.Http (>= 9.0.15 && < 10.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.15 && < 10.0.0)
- System.Net.Http.Json (>= 9.0.15 && < 10.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.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.26.419.1946 | 97 | 4/19/2026 |
| 1.26.415.1529 | 105 | 4/15/2026 |
| 1.26.409.317 | 101 | 4/9/2026 |
| 1.26.408.2045 | 98 | 4/8/2026 |
| 1.26.327.2021 | 113 | 3/27/2026 |
| 1.26.314.1926 | 143 | 3/14/2026 |
| 1.25.930.2112 | 212 | 9/30/2025 |
| 1.25.710.1939 | 200 | 7/10/2025 |
| 1.25.307.2133 | 289 | 3/7/2025 |
| 1.24.1129.1408 | 178 | 11/29/2024 |
| 1.24.319.1941 | 224 | 3/19/2024 |
| 1.24.312.439 | 193 | 3/12/2024 |
| 1.23.626.1426 | 359 | 6/26/2023 |
| 1.23.420.18 | 320 | 4/20/2023 |
| 1.23.416.2128 | 336 | 4/16/2023 |
| 1.23.326.120 | 359 | 3/26/2023 |
| 1.23.325.41 | 351 | 3/25/2023 |
| 1.23.322.1532 | 347 | 3/22/2023 |
| 1.23.322.1528 | 349 | 3/22/2023 |
| 1.23.322.1526 | 346 | 3/22/2023 |