C# SDK

Install and start using the C# SDK.

Intro

The Adyen APIs SDK provides access to the Adyen APIs REST APIs.

Adyen Checkout API Configure and manage your Adyen company and merchant accounts, stores, and payment terminals.

Authentication

Each request to the Management API must be signed with an API key. Generate your API key in the Customer Area and then set this key to the X-API-Key header value.

To access the live endpoints, you need to generate a new API key in your live Customer Area.

Versioning

Management API handles versioning as part of the endpoint URL. For example, to send a request to this version of the /companies/{companyId}/webhooks endpoint, use:

https://management-test.adyen.com/v3/companies/{companyId}/webhooks

Going live

To access the live endpoints, you need an API key from your live Customer Area. Use this API key to make requests to:

https://management-live.adyen.com/v3

Release notes

Have a look at the release notes to find out what changed in this version!

Installation

Add the SDK as a project reference into your solution:

Terminal
dotnet add reference <path-to-sdk>/src/AdyenApIs/AdyenApIs.csproj

The project takes its build settings from the files around it, so reference it in place.

Quick Start

Dependency Injection

Register the client with IServiceCollection and resolve it from the container. The HttpClient is managed by IHttpClientFactory. Configure the client's behavior through AdyenApIsClientOptions.

C#
services.AddAdyenApIsClient(options =>
{
    options.ApiKeyAuth = "YOUR_API_KEY";
    options.BasicAuth = new BasicAuthCredentials { Username = "YOUR_USERNAME", Password = "YOUR_PASSWORD" };
    options.Environment = ServerEnvironment.Production;
    // TODO: configure more client options here
});

Direct Instantiation

Create the client by passing an HttpClient you manage yourself. Configure the client's behavior through AdyenApIsClientOptions.

C#
var httpClient = new HttpClient();
// TODO: configure more client options here
var options = new AdyenApIsClientOptions
{
    ApiKeyAuth = "YOUR_API_KEY",
    BasicAuth = new BasicAuthCredentials { Username = "YOUR_USERNAME", Password = "YOUR_PASSWORD" },
    Environment = ServerEnvironment.Production,
};
var client = new AdyenApIsClient(httpClient, options);

On this page