eConnect.PosSdk 4.0.1

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

eConnect PosSdk

.NET client for eConnect POS JsonApi.

Supported Platforms

  • .NET 8.0 and above
  • .NET Standard 2.0 (for .NET Framework 4.6.1+ compatibility)

Installation

dotnet add package eConnect.PosSdk

Quick Start

using eConnect.PosSdk;
using eConnect.PosSdk.ApiEvents;
using Microsoft.Extensions.Logging;

// Sample authentication parameters — production values provided by eConnect
var options = new PosClientOptions
{
    PluginId = "b510fb1f-124f-46dc-a7f3-cc9813755fa6",
    AuthId = Guid.NewGuid().ToString(),
    Host = "devcenter.econnect.tv",
    Port = 6500,
    UseSsl = true,                             // optional, defaults to true
    TcpTimeout = TimeSpan.FromMinutes(1),      // optional, defaults to 1 minute
    KeepAliveInterval = TimeSpan.FromMinutes(2) // optional, defaults to 2 minutes
    // set KeepAliveInterval = TimeSpan.Zero to disable keep-alive messages
};

// PosClient requires an ILogger instance (use NullLogger.Instance if logging is not needed)
await using var client = await PosClient.CreateAsync(options, logger);

var signIn = new SignInEvent
{
    RevenueCenterNumber = 1,
    TerminalNumber = 123,
    EmployeeNumber = 456
};

string response = await client.SendAsync(signIn);
// response == "Valid signin event object received"

Full Transaction Example

var newCheck = new NewCheckEvent
{
    RevenueCenterNumber = 248,
    TerminalNumber = 1132,
    EmployeeNumber = 634277,
    CheckNumber = 237712
};
await client.SendAsync(newCheck);

var itemAdd = new ItemAddEvent
{
    RevenueCenterNumber = 248,
    TerminalNumber = 1132,
    EmployeeNumber = 634277,
    CheckNumber = 237712,
    ItemId = "049000608779",
    ItemName = "Apple (Golden Delicious)",
    Quantity = 1,
    Amount = 0.99M
};
await client.SendAsync(itemAdd);

var totalDue = new TotalDueEvent
{
    RevenueCenterNumber = 248,
    TerminalNumber = 1132,
    EmployeeNumber = 634277,
    CheckNumber = 237712,
    Amount = -.99M
};
await client.SendAsync(totalDue);

var tenderApply = new TenderApplyEvent
{
    RevenueCenterNumber = 248,
    TerminalNumber = 1132,
    EmployeeNumber = 634277,
    CheckNumber = 237712,
    TenderTypeNumber = 5,
    TenderTypeName = "Cash",
    Amount = 1M
};
await client.SendAsync(tenderApply);

var changeDue = new ChangeDueEvent
{
    RevenueCenterNumber = 248,
    TerminalNumber = 1132,
    EmployeeNumber = 634277,
    CheckNumber = 237712,
    Amount = .01M
};
await client.SendAsync(changeDue);

var closeCheck = new CloseCheckEvent
{
    RevenueCenterNumber = 11291,
    TerminalNumber = 88332,
    EmployeeNumber = 634277,
    CheckNumber = 237712
};
await client.SendAsync(closeCheck);

Configuration Options

Option Default Description
PluginId (required) eConnect plugin ID
AuthId (required) eConnect authentication ID
Host (required) PosAPI host address or hostname
Port (required) PosAPI port number
UseSsl true Whether to use SSL/TLS
TcpTimeout 1 minute Timeout for TCP operations
KeepAliveInterval 2 minutes Interval for keep-alive messages (TimeSpan.Zero to disable)

Error Handling

SendAsync throws specific exceptions you can handle:

Exception Cause Remedy
ObjectDisposedException Client has been disposed Create a new client via PosClient.CreateAsync()
InvalidOperationException Connection was lost after creation Dispose and create a new client via PosClient.CreateAsync()
ArgumentNullException Message is null Provide a non-null message
PosMessageException Message fails validation (client-side or server-side) Fix the message content and resend
TimeoutException Server did not respond in time Retry the send, or dispose and create a new client
OperationCanceledException Cancellation token was cancelled Retry with a valid token
SocketException / IOException TCP connection lost Dispose and create a new client via PosClient.CreateAsync()
try
{
    string response = await client.SendAsync(myEvent);
}
catch (PosMessageException ex)
{
    // Inspect ex.ValidationErrors for details, fix the message, and resend
}
catch (TimeoutException)
{
    // Retry the send, or dispose and create a new client
}
catch (Exception ex) when (ex is SocketException or IOException)
{
    // Connection lost — dispose and create a new client
    await client.DisposeAsync();
    client = await PosClient.CreateAsync(options, logger);
    // Retry the send
}

Testing

eConnect provides a TCP JSON API Test Service, showing sample credentials that work in combination with an online Testing Console.

Migrating from v3 to v4

Version 4.0 introduces a static factory pattern. The PosClient constructor is no longer public, and ConnectAsync() / TryConnectAsync() have been removed from IPosClient.

v3 (old) v4 (new)
new PosClient(options, logger) + await client.ConnectAsync() await PosClient.CreateAsync(options, logger)
await client.TryConnectAsync() await PosClient.TryCreateAsync(options, logger) (returns null on failure)
Reconnect via ConnectAsync() after error Dispose and call PosClient.CreateAsync() again

This ensures every IPosClient instance is always in a connected state when obtained.

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 was computed.  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 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. 
.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
4.0.1 108 3/18/2026
4.0.0 108 3/16/2026
3.2.2 99 2/25/2026
3.2.1 100 2/18/2026
3.2.0 95 2/18/2026
3.1.0-beta20260318173009 87 3/18/2026
3.1.0-beta20260316233905 103 3/16/2026
3.1.0-beta20260225234847 85 2/25/2026
3.1.0-beta20260225214929 83 2/25/2026
3.1.0-beta20260202235745 100 2/2/2026
3.1.0-beta20260202233320 91 2/2/2026
3.1.0-beta20260128215558 97 1/28/2026
3.1.0-beta20260127211504 93 1/27/2026
3.0.6 298 9/3/2025
3.0.5 281 9/3/2025
3.0.4 265 9/3/2025
3.0.3 271 9/2/2025
3.0.2 276 9/2/2025
3.0.1 271 9/2/2025
3.0.0 258 9/2/2025
Loading failed