PrimeAML.ClientManagement.Client 1.0.1

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

PrimeAML.ClientManagement.Client - PrimeAML

Official .NET client library for the PrimeAML Client Management API.

Built for compliance-focused institutions, this package provides a fully typed, authenticated HTTP client covering the complete Client Management surface: onboarding, KYC/KYB, document workflows, risk evaluations, screening, and more.


Requirements

  • .NET 9.0 or 10.0
  • Credentials issued by PrimeAML (Client ID + Secret)
  • Auth server: Any OIDC-compliant server (OAuth 2.0 Client Credentials flow, token endpoint discovered automatically)

Access is restricted to approved PrimeAML clients. Contact info@primeaml.com or visit https://www.primeaml.com to request credentials.


Installation

dotnet add package PrimeAML.ClientManagement.Client

All required types (Client, SearchClientsRequest, FileAttachment, enums, etc.) are bundled inside the package — no additional dependencies required.


Quick Start

1 — Configuration (appsettings.json)

{
  "ClientManagementClient": {
    "BaseUrl": "https://api.your-primeaml-instance.com",
    "TimeoutSeconds": 30,
    "Authentication": {
      "Authority": "https://auth.your-primeaml-instance.com/realms/AMS/",
      "ClientId": "your-client-id",
      "ClientSecret": "your-client-secret",
      "Scopes": [ "client_management_api" ],
      "ExpiryBufferSeconds": 30
    }
  }
}

2 — Register the client (ASP.NET Core / Generic Host)

builder.Services.AddClientManagementClient(options =>
    builder.Configuration
           .GetSection(ClientManagementClientOptions.SectionName)
           .Bind(options));

3 — Inject and call

public class OnboardingService(IClientManagementClient api)
{
    public async Task DemoAsync(CancellationToken ct)
    {
        // Search
        var page = await api.SearchClientsAsync(
            new SearchClientsRequest { PageNumber = 1, PageSize = 20 }, ct);

        // Fetch detail
        var detail = await api.GetClientAsync(page.Result[0].Id, ct);

        // Upload a document (document type is specified by stable reference, not by internal id)
        var fileBytes = await File.ReadAllBytesAsync("passport.pdf", ct).ConfigureAwait(false);
        await api.CreateClientDocumentAsync(
            detail.Id,
            new CreateClientDocumentRequest
            {
                DocumentTypeReference = "PASSPORT",
                Files =
                [
                    new FileAttachment
                    {
                        FileName = "passport.pdf",
                        FileType = "application/pdf",
                        FileSize = fileBytes.Length,
                        FileData = fileBytes
                    }
                ]
            },
            ct).ConfigureAwait(false);
    }
}

Client accounts and tax residency

Use IClientManagementClient for bank accounts and tax residency: SaveClientAccountAsync, SearchClientAccountsAsync, DeleteClientAccountAsync, SaveClientTaxResidencyAsync, SearchClientTaxResidenciesAsync, DeleteClientTaxResidencyAsync, and MakeClientTaxResidencyPrimaryAsync. Payloads and responses use stable codes (for example PaymentInstitutionCode, CountryCode) as defined in PrimeAML.ClientManagement.Contracts.


Token Management

OAuth 2.0 token acquisition and caching are fully transparent. A SemaphoreSlim guard prevents thundering-herd re-fetches and tokens are refreshed automatically before expiry (controlled by Authentication:ExpiryBufferSeconds).

The token endpoint is discovered automatically at startup via the OIDC .well-known/openid-configuration document published by the authority in Authentication:Authority. If the authority is unreachable at startup the application fails fast with a clear error rather than failing on the first API call.


Error Handling

All API failures surface as ClientManagementException (inherits ExternalApiException):

try
{
    var c = await _api.GetClientAsync(id, ct);
}
catch (ClientManagementException ex)
{
    // ex.StatusCode  — HTTP status code
    // ex.Errors      — validation / business error messages
    logger.LogError("API error {Status}: {Errors}", ex.StatusCode,
                    string.Join(", ", ex.Errors));
}

About PrimeAML

PrimeAML is a next-generation AML compliance platform helping financial institutions meet regulatory obligations efficiently and accurately.


License

This package is distributed under a commercial license and is intended exclusively for approved PrimeAML clients. See LICENSE.txt in the package for full license terms.

© Prime CorTech Ltd. All rights reserved.

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.

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.1 78 6/6/2026
1.0.0 104 6/1/2026

Major release: packages and namespaces rebranded from AMS.* to PrimeAML.*. Install PrimeAML.ClientManagement.Client 1.x and update using statements. Previous AMS.ClientManagement.* package ids are deprecated.