NordletApi 1.0.0
dotnet add package NordletApi --version 1.0.0
NuGet\Install-Package NordletApi -Version 1.0.0
<PackageReference Include="NordletApi" Version="1.0.0" />
<PackageVersion Include="NordletApi" Version="1.0.0" />
<PackageReference Include="NordletApi" />
paket add NordletApi --version 1.0.0
#r "nuget: NordletApi, 1.0.0"
#:package NordletApi@1.0.0
#addin nuget:?package=NordletApi&version=1.0.0
#tool nuget:?package=NordletApi&version=1.0.0
Nordlet C# Library
The Nordlet C# library provides convenient access to the Nordlet APIs from C#.
Table of Contents
Requirements
This SDK requires:
Installation
dotnet add package NordletApi
Reference
A full reference for this library is available here.
Usage
Instantiate and use the client with the following:
using NordletApi;
var client = new NordletApiClient("TOKEN");
await client.Reference.PostV1ReferenceExchangeRatesSyncAsync(
new PostV1ReferenceExchangeRatesSyncRequest()
);
Environments
This SDK allows you to configure different environments for API requests.
using NordletApi;
var client = new NordletApiClient(new ClientOptions
{
BaseUrl = NordletApiEnvironment.Production
});
Exception Handling
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error will be thrown.
using NordletApi;
try {
var response = await client.Reference.PostV1ReferenceExchangeRatesSyncAsync(...);
} catch (NordletApiApiException e) {
System.Console.WriteLine(e.Body);
System.Console.WriteLine(e.StatusCode);
// Access the raw HTTP response (status code, URL, headers) off the exception
var rawResponse = e.RawResponse;
if (rawResponse != null)
{
System.Console.WriteLine(rawResponse.Url);
if (rawResponse.Headers.TryGetValue("X-Request-Id", out var requestId))
{
System.Console.WriteLine($"Request ID: {requestId}");
}
}
}
Advanced
Retries
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).
Which status codes are retried depends on the retryStatusCodes generator configuration:
legacy (current default): retries on
recommended: retries on
- 408 (Timeout)
- 429 (Too Many Requests)
- 502 (Bad Gateway)
- 503 (Service Unavailable)
- 504 (Gateway Timeout)
Use the MaxRetries request option to configure this behavior.
var response = await client.Reference.PostV1ReferenceExchangeRatesSyncAsync(
...,
new RequestOptions {
MaxRetries: 0 // Override MaxRetries at the request level
}
);
Timeouts
The SDK defaults to a 30 second timeout. Use the Timeout option to configure this behavior.
var response = await client.Reference.PostV1ReferenceExchangeRatesSyncAsync(
...,
new RequestOptions {
Timeout: TimeSpan.FromSeconds(3) // Override timeout to 3s
}
);
Raw Response
Access raw HTTP response data (status code, headers, URL) alongside parsed response data using the .WithRawResponse() method.
using NordletApi;
// Access raw response data (status code, headers, etc.) alongside the parsed response
var result = await client.Reference.PostV1ReferenceExchangeRatesSyncAsync(...).WithRawResponse();
// Access the parsed data
var data = result.Data;
// Access raw response metadata
var statusCode = result.RawResponse.StatusCode;
var headers = result.RawResponse.Headers;
var url = result.RawResponse.Url;
// Access specific headers (case-insensitive)
if (headers.TryGetValue("X-Request-Id", out var requestId))
{
System.Console.WriteLine($"Request ID: {requestId}");
}
// For the default behavior, simply await without .WithRawResponse()
var data = await client.Reference.PostV1ReferenceExchangeRatesSyncAsync(...);
// .WithRawResponse() also works on streaming endpoints (returns IAsyncEnumerable<T> + RawResponse)
// and on endpoints with no response body (returns RawResponse only).
Additional Headers
If you would like to send additional headers as part of the request, use the AdditionalHeaders request option.
var response = await client.Reference.PostV1ReferenceExchangeRatesSyncAsync(
...,
new RequestOptions {
AdditionalHeaders = new Dictionary<string, string?>
{
{ "X-Custom-Header", "custom-value" }
}
}
);
Additional Query Parameters
If you would like to send additional query parameters as part of the request, use the AdditionalQueryParameters request option.
var response = await client.Reference.PostV1ReferenceExchangeRatesSyncAsync(
...,
new RequestOptions {
AdditionalQueryParameters = new Dictionary<string, string>
{
{ "custom_param", "custom-value" }
}
}
);
Additional Body Properties
If you would like to send additional body properties as part of the request, use the AdditionalBodyProperties request option.
This is only applied to JSON requests.
var response = await client.Reference.PostV1ReferenceExchangeRatesSyncAsync(
...,
new RequestOptions {
AdditionalBodyProperties = new Dictionary<string, object>
{
{ "custom_field", "custom-value" }
}
}
);
Forward Compatible Enums
This SDK uses forward-compatible enums that can handle unknown values gracefully.
using NordletApi;
// Using a built-in value
var postV1ReferenceExchangeRatesListRequestSortItemDir = PostV1ReferenceExchangeRatesListRequestSortItemDir.Asc;
// Using a custom value
var customPostV1ReferenceExchangeRatesListRequestSortItemDir = PostV1ReferenceExchangeRatesListRequestSortItemDir.FromCustom("custom-value");
// Using in a switch statement
switch (postV1ReferenceExchangeRatesListRequestSortItemDir.Value)
{
case PostV1ReferenceExchangeRatesListRequestSortItemDir.Values.Asc:
Console.WriteLine("Asc");
break;
default:
Console.WriteLine($"Unknown value: {postV1ReferenceExchangeRatesListRequestSortItemDir.Value}");
break;
}
// Explicit casting
string postV1ReferenceExchangeRatesListRequestSortItemDirString = (string)PostV1ReferenceExchangeRatesListRequestSortItemDir.Asc;
PostV1ReferenceExchangeRatesListRequestSortItemDir postV1ReferenceExchangeRatesListRequestSortItemDirFromString = (PostV1ReferenceExchangeRatesListRequestSortItemDir)"asc";
Contributing
While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
On the other hand, contributions to the README are always very welcome!
| 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 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 is compatible. 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. |
-
.NETFramework 4.6.2
- OneOf (>= 3.0.271)
- OneOf.Extended (>= 3.0.271)
- Portable.System.DateTimeOnly (>= 9.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 9.0.9)
- System.Text.RegularExpressions (>= 4.3.1)
-
.NETStandard 2.0
- OneOf (>= 3.0.271)
- OneOf.Extended (>= 3.0.271)
- Portable.System.DateTimeOnly (>= 9.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 9.0.9)
- System.Text.RegularExpressions (>= 4.3.1)
-
net8.0
- OneOf (>= 3.0.271)
- OneOf.Extended (>= 3.0.271)
- System.Net.Http (>= 4.3.4)
- System.Text.RegularExpressions (>= 4.3.1)
-
net9.0
- OneOf (>= 3.0.271)
- OneOf.Extended (>= 3.0.271)
- System.Net.Http (>= 4.3.4)
- System.Text.RegularExpressions (>= 4.3.1)
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.0.0 | 103 | 7/17/2026 |