Logicware.Connect.Sdk
0.2.0
dotnet add package Logicware.Connect.Sdk --version 0.2.0
NuGet\Install-Package Logicware.Connect.Sdk -Version 0.2.0
<PackageReference Include="Logicware.Connect.Sdk" Version="0.2.0" />
<PackageVersion Include="Logicware.Connect.Sdk" Version="0.2.0" />
<PackageReference Include="Logicware.Connect.Sdk" />
paket add Logicware.Connect.Sdk --version 0.2.0
#r "nuget: Logicware.Connect.Sdk, 0.2.0"
#:package Logicware.Connect.Sdk@0.2.0
#addin nuget:?package=Logicware.Connect.Sdk&version=0.2.0
#tool nuget:?package=Logicware.Connect.Sdk&version=0.2.0
Logicware.Connect.Sdk
Official .NET SDK for Logicware Connect — integrate your own courier website with a Logicware-hosted warehouse.
Targets .NET 8 and .NET Standard 2.1 (so it works on .NET Framework 4.8+, Unity, and older runtimes via the standard shim).
Install
dotnet add package Logicware.Connect.Sdk
Quick start
using Logicware.Connect.Sdk;
using var client = new LogicwareConnectClient(new LogicwareConnectOptions
{
ApiKey = Environment.GetEnvironmentVariable("LW_API_KEY")!,
BaseUrl = new Uri("https://courier-api.logicware.app"),
});
// Lookup a shipper by email
var shipper = await client.Shippers.GetByEmailAsync("customer@example.com");
// Paginate packages for that shipper
await foreach (var pkg in client.Packages.ListAllAsync(new ListPackagesOptions { ShipperId = shipper.Id }))
{
Console.WriteLine($"{pkg.TrackingNumber} {pkg.Status} {pkg.FreightType}");
}
Dependency injection
In an ASP.NET Core / worker app:
using Logicware.Connect.Sdk.DependencyInjection;
builder.Services.AddLogicwareConnect(opts =>
{
opts.ApiKey = builder.Configuration["Logicware:ApiKey"]!;
opts.BaseUrl = new Uri(builder.Configuration["Logicware:BaseUrl"]!);
opts.UserAgentSuffix = "MyCourierPortal/1.0";
});
Then inject LogicwareConnectClient into controllers / services.
Resources
Every resource matches the JS and PHP SDKs method-for-method:
| Resource | Examples |
|---|---|
client.Warehouses |
ListAsync, GetAsync |
client.Shippers |
ListAsync, GetByEmailAsync, SyncAsync, BulkCreateAsync, ImportManyAsync, ImportProgressAsync |
client.Shippers.Addresses |
ListAsync, CreateAsync, UpdateAsync, DeleteAsync |
client.Packages |
ListAsync, ListAllAsync (async iterator), GetAsync, GetByTrackingAsync, ForShipperAsync |
client.Manifests |
ListAsync, CreateAsync, SetOpenAsync, CloseAsync, ReopenAsync, FinalizeAsync, SetStatusAsync, AddPackagesAsync, RemovePackageAsync |
client.PreAlerts |
ListAsync (returns stats too), LookupByTrackingAsync, CreateAsync, CancelAsync |
client.Intake |
SearchUnidentifiedAsync, ListUnclaimedAsync, ListReceivedAsync |
client.MissingPackages |
ListAsync, CreateAsync, CancelAsync, CloseAsync |
client.Rates |
CalculateAsync (public — no auth) |
Errors
LogicwareApiException— non-2xx responses the SDK has stopped retrying on. CarriesStatus,ErrorCode(e.g."ADDRESS_CODE_REQUIRED"),RequestId, and the parsedDetails.LogicwareNetworkException— transport failures (socket, TLS, timeout). Original exception chained asInnerException.
Retries
Built-in: 3 attempts total, exponential backoff with ±25% jitter, honors Retry-After on 429/5xx, bails immediately on 4xx (except 429). Override via LogicwareConnectOptions.MaxAttempts / Timeout.
Observability
Set LogicwareConnectOptions.Recorder to a callable that receives a RequestRecord per finished call (with X-Api-Key masked). The demo playground uses this to power its request inspector.
License
MIT © Logicware
| 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 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | 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.1
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- System.Text.Json (>= 8.0.5)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.