ExoLink.TraceabilityHub.Client 1.0.0

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

ExoLink.TraceabilityHub.Client

Typed HTTP client for the ExoLink TraceabilityHub API — a platform that facilitates the exchange of lot traceability data between Traceability App Providers (TAPs).

For full ASP.NET Core integration (DI registration, OIDC authentication, and hub callback endpoints) see the ExoLink.TraceabilityHub.AspNetCore package.

Targets net9.0 and net10.0.


Installation

dotnet add package ExoLink.TraceabilityHub.Client

When using the ExoLink.TraceabilityHub.AspNetCore package, TraceabilityHubApiClient is registered and configured automatically — no manual setup is needed.

For standalone use, register the client manually and configure its base address and any authentication handler:

builder.Services.AddHttpClient<TraceabilityHubApiClient>(client =>
{
    client.BaseAddress = new Uri("https://traceability-hub.exolink.app");
});

Working with articles

// List all articles supported by the hub.
List<Article> articles = await client.GetArticlesAsync();

// Get a specific article by its ID.
Article? article = await client.GetArticleAsync(articleId);

Creating lots

CreateLotRequest[] requests =
[
    new CreateLotRequest
    {
        LotId     = "MY-LOT-001",
        Recipient = "RECIPIENT-CODE",
        Expiration = DateTime.UtcNow.AddDays(30),
    },
];

CreateLotResponse[] responses = await client.CreateLotsAsync(requests);

foreach (CreateLotResponse response in responses)
{
    if (response.Status == CreateLotResult.Created)
    {
        Console.WriteLine($"Lot created. TraceabilityId: {response.NationalTraceabilityId}");
    }
    else
    {
        Console.WriteLine($"Failed to create lot '{response.LotId}': {response.Status}");
    }
}

Fetching lots

// Fetch a specific lot from another TAP using its exchange ID.
FetchLotResponse lot = await client.FetchLotAsync(exchangeId);

if (lot.Result == FetchLotResult.Success)
{
    foreach (LotPayload transaction in lot.Transactions!)
    {
        Console.WriteLine($"Article: {transaction.Article}, Quantity: {transaction.Quantity}");
    }

    // Notify the hub that the lot has been imported.
    await client.NotifyLotImportedAsync(lot.ExchangeId!);
}

Retrieving assigned lots

// Get all lots assigned to the current client.
List<FetchLotResponse> assignedLots = await client.GetAssignedLotsAsync();

// Optionally filter by recipient code.
List<FetchLotResponse> filtered = await client.GetAssignedLotsAsync(recipient: "RECIPIENT-CODE");

Deleting a lot

bool deleted = await client.DeleteLotAsync("MY-LOT-001");

License

Copyright © 2026 ExoLink B.V. — MIT License

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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.
  • net10.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ExoLink.TraceabilityHub.Client:

Package Downloads
ExoLink.TraceabilityHub.AspNetCore

ASP.NET Core integration for ExoLink TraceabilityHub.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 127 5/22/2026