Skip to documentation content

.NET SDK

Install and configure the preview .NET client for authenticated Carden v1 server requests.

On this page

Package availability

The planned .NET package identifier is Carden for NuGet and requires .NET 8+. The release catalog marks it preview and unpublished; there is no public version or install command.

Configure the client

Initialize the client only in a trusted server process. Use a Carden key issued for the provider integration and environment this service implements. Keep provider credentials in provider execution code.

.NET client
using Carden;

using var carden = new CardenClient(
    Environment.GetEnvironmentVariable("CARDEN_API_KEY")!);

The default API origin is https://www.cardenpay.com. Use another base URL only when Carden supplies it for the environment. Set bounded timeouts and retain request IDs in sanitized diagnostics.

Handle client errors

  • Treat invalid authentication or permission as configuration failure rather than an infinite retry.
  • Correct 400 and 422 input using factual source data; never invent commercial or provider fields.
  • Reconcile 409 source, idempotency, event, or cumulative-fact conflicts.
  • Retry safe preparation or immutable report delivery after 408, 429, 5xx, timeout, or connection failures.
  • Keep payment execution and report delivery in independently idempotent paths.

Open provider usage

Provider pages preserve the same seven native language examples plus direct HTTP. Package pages intentionally stay focused on installation, client configuration, errors, and release status.