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

<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 contratos returned 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
  • ContractResponse deserialization tests for single-object and array payloads
  • Guardrail tests for ProtectedApiQueryTokenHandler
  • Optional live integration tests driven by test/appsettings.json or 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

Product 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. 
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.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
Loading failed