Comdirect.API
1.0.0
dotnet add package Comdirect.API --version 1.0.0
NuGet\Install-Package Comdirect.API -Version 1.0.0
<PackageReference Include="Comdirect.API" Version="1.0.0" />
<PackageVersion Include="Comdirect.API" Version="1.0.0" />
<PackageReference Include="Comdirect.API" />
paket add Comdirect.API --version 1.0.0
#r "nuget: Comdirect.API, 1.0.0"
#:package Comdirect.API@1.0.0
#addin nuget:?package=Comdirect.API&version=1.0.0
#tool nuget:?package=Comdirect.API&version=1.0.0
Comdirect.API - the C# library for the comdirect REST API
Please have a look at the interfaces of comdirect REST API below. Note: Currently it is not possible to request an access token via swagger UI tools because of comdirect's proprietary authorization flow. The shown error message is due to that circumstance.
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: 20.04
- SDK version: 1.0.0
- Generator version: 7.19.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
<a id="frameworks-supported"></a>
Frameworks supported
<a id="dependencies"></a>
Dependencies
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
<a id="installation"></a>
Installation
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh - [Windows]
build.bat
Then include the DLL (under the bin folder) in the C# project, and use the namespaces:
using Comdirect.API.Api;
using Comdirect.API.Client;
using Comdirect.API.Model;
<a id="packaging"></a>
Packaging
A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.
This .nuspec uses placeholders from the .csproj, so build the .csproj directly:
nuget pack -Build -OutputDirectory out Comdirect.API.csproj
Then, publish to a local feed or other host and consume the new package via Nuget as usual.
<a id="usage"></a>
Usage
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
Connections
Each ApiClass (properly the ApiClient inside it) will create an instance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method.
To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHandler (see here for details). To use your own HttpClient instance just pass it to the ApiClass constructor.
HttpClientHandler yourHandler = new HttpClientHandler();
HttpClient yourHttpClient = new HttpClient(yourHandler);
var api = new YourApiClass(yourHttpClient, yourHandler);
If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory.
HttpClient yourHttpClient = new HttpClient();
var api = new YourApiClass(yourHttpClient);
You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available.
Here an example of DI setup in a sample web project:
services.AddHttpClient<YourApiClass>(httpClient =>
new PetApi(httpClient));
<a id="getting-started"></a>
Getting Started
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Comdirect.API.Api;
using Comdirect.API.Client;
using Comdirect.API.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.comdirect.de/api";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new BankingApi(httpClient, config, httpClientHandler);
var accountId = 1234567890; // string | Account identifier (UUID)
var transactionState = "BOOKED"; // string? | Filters for AccountTransactions. Will return all AccountTransactions (BOTH), or return all booked AccountTransactions (BOOKED), or all not booked AccountTransactions (NOTBOOKED). (optional) (default to BOTH)
var transactionDirection = "CREDIT"; // string? | Filters for CREDIT, DEBIT or CREDIT_AND_DEBIT (optional) (default to CREDIT_AND_DEBIT)
var pagingFirst = 0; // int? | Index of the first transaction. (optional) (default to 0)
var withAttr = account; // string? | Enforce to load the master data of an attribute. Currently supported attributes: account (optional)
try
{
// Requests and returns a list of transactions for the given account
ListResourceAccountTransaction result = apiInstance.BankingV1GetAccountTransactions(accountId, transactionState, transactionDirection, pagingFirst, withAttr);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling BankingApi.BankingV1GetAccountTransactions: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
<a id="documentation-for-api-endpoints"></a>
Documentation for API Endpoints
All URIs are relative to https://api.comdirect.de/api
| Class | Method | HTTP request | Description |
|---|---|---|---|
| BankingApi | BankingV1GetAccountTransactions | GET /banking/v1/accounts/{accountId}/transactions | Requests and returns a list of transactions for the given account |
| BankingApi | BankingV2GetAccountBalance | GET /banking/v2/accounts/{accountId}/balances | Request for account information, including cash balance and buying power |
| BankingApi | BankingV2GetAccountBalances | GET /banking/clients/{user}/v2/accounts/balances | Request for account information, including cash balance and buying power, for all accounts |
| BrokerageApi | BrokerageV1GetInstrument | GET /brokerage/v1/instruments/{instrumentId} | Request for an instrument's information |
| BrokerageApi | BrokerageV3DeleteOrder | DELETE /brokerage/v3/orders/{orderId} | Order cancellation. |
| BrokerageApi | BrokerageV3GetDepotPosition | GET /brokerage/v3/depots/{depotId}/positions/{positionId} | Request for retrieving a single position of specific depot. |
| BrokerageApi | BrokerageV3GetDepotPositions | GET /brokerage/v3/depots/{depotId}/positions | Request for securities positions, optionally including only the total balance with securities account information |
| BrokerageApi | BrokerageV3GetDepotTransactions | GET /brokerage/v3/depots/{depotId}/transactions | Depot transactions. |
| BrokerageApi | BrokerageV3GetDepots | GET /brokerage/clients/{userId}/v3/depots | Request for a list of the master data for the securities accounts of the registered user |
| BrokerageApi | BrokerageV3GetOrder | GET /brokerage/v3/orders/{orderId} | Delivers an order for the given orderId. |
| BrokerageApi | BrokerageV3GetOrderCostIndicationExAnte | POST /brokerage/v3/orders/{orderId}/costindicationexante | Generation of the ex-ante cost indication on the basis of the order data. |
| BrokerageApi | BrokerageV3GetOrderDimensions | GET /brokerage/v3/orders/dimensions | Request for the trading venue and order options for a particular instrument |
| BrokerageApi | BrokerageV3GetOrders | GET /brokerage/depots/{depotId}/v3/orders | Delivers a list of all orders for the given depotId. |
| BrokerageApi | BrokerageV3GetOrdersCostIndicationExAnte | POST /brokerage/v3/orders/costindicationexante | Generation of the ex-ante cost indication on the basis of the order data. |
| BrokerageApi | BrokerageV3PatchOrder | PATCH /brokerage/v3/orders/{orderId} | Order modification. |
| BrokerageApi | BrokerageV3PatchQuoteTicket | PATCH /brokerage/v3/quoteticket/{ticketId} | Initiate a TAN-Challange |
| BrokerageApi | BrokerageV3PostOrder | POST /brokerage/v3/orders | Order entry. |
| BrokerageApi | BrokerageV3PostOrderPrevalidation | POST /brokerage/v3/orders/{orderId}/prevalidation | Prevalidation of an order modfication |
| BrokerageApi | BrokerageV3PostOrderValidation | POST /brokerage/v3/orders/{orderId}/validation | Validation of an order modification or order cancellation and triggering of a TAN Challenge in a non-usage case of a Session-TAN. |
| BrokerageApi | BrokerageV3PostOrdersPrevalidation | POST /brokerage/v3/orders/prevalidation | Prevalidation of the order |
| BrokerageApi | BrokerageV3PostOrdersValidation | POST /brokerage/v3/orders/validation | Validation of an order entry and triggering of a TAN-Challenge in a non-usage case of a Session-TAN. |
| BrokerageApi | BrokerageV3PostQuoteRequest | POST /brokerage/v3/quotes | Sends a quote request to a venue |
| BrokerageApi | BrokerageV3PostQuoteTicket | POST /brokerage/v3/quoteticket | Initiates a TAN-Challenge |
| MessagesApi | MessagesV2GetDocument | GET /messages/v2/documents/{documentId} | Delivers a document for the given UUID. |
| MessagesApi | MessagesV2GetDocuments | GET /messages/clients/{user}/v2/documents | Delivers a list of documents for the customer. |
| MessagesApi | MessagesV2GetPredocument | GET /messages/v2/documents/{documentId}/predocument | Delivers a predocument for the given UUID. |
| ReportsApi | ReportsV1GetParticipantBalances | GET /reports/participants/{user}/v1/allbalances | List of all balances for a client's own and connected products. |
| SessionApi | SessionV1GetSession | GET /session/clients/{user}/v1/sessions | Returns the current Session-Objects for the specified client, can handle the literal "user" for the currently logged in client. |
| SessionApi | SessionV1PatchSession | PATCH /session/clients/{user}/v1/sessions/{session} | Writes updates to a session |
| SessionApi | SessionV1PostSessionValidation | POST /session/clients/{user}/v1/sessions/{session}/validate | Validates the input and checks if the client is able to update the current session. An activated session TAN cannot be deactivated in the current session. It is necessary to provide a TAN when patching the activation of the session TAN. |
<a id="documentation-for-models"></a>
Documentation for Models
- Model.Account
- Model.AccountBalance
- Model.AccountInformation
- Model.AccountTransaction
- Model.AmountValue
- Model.Balance
- Model.BusinessMessage
- Model.Card
- Model.CardBalance
- Model.CostEntry
- Model.CostGroup
- Model.CostIndicationExAnte
- Model.CurrencyString
- Model.DateString
- Model.DateTimeString
- Model.Depot
- Model.DepotAggregation
- Model.DepotPosition
- Model.DepotTransaction
- Model.DerivativeData
- Model.Dimensions
- Model.Document
- Model.DocumentMetadata
- Model.EnumText
- Model.Execution
- Model.FXRateEUR
- Model.FixedTermSavings
- Model.FundDistribution
- Model.Inducement
- Model.InstallmentLoan
- Model.InstallmentLoanBalance
- Model.Instrument
- Model.ListResourceAccountBalance
- Model.ListResourceAccountTransaction
- Model.ListResourceCostIndicationExAnte
- Model.ListResourceDepot
- Model.ListResourceDepotPosition
- Model.ListResourceDepotTransaction
- Model.ListResourceDimensions
- Model.ListResourceDocument
- Model.ListResourceInstrument
- Model.ListResourceOrder
- Model.ListResourceProductBalance
- Model.Order
- Model.OrderType
- Model.PagingInfo
- Model.PercentageString
- Model.Price
- Model.ProductBalance
- Model.Quote
- Model.Rating
- Model.Session
- Model.StandardErrorResponse
- Model.StaticData
- Model.TimestampString
- Model.TotalCostBlock
- Model.TotalCostEntry
- Model.TotalHoldingCostBlock
- Model.TotalHoldingCostEntry
- Model.Venue
- Model.VisaCardImage
<a id="documentation-for-authorization"></a>
Documentation for Authorization
Authentication schemes defined for the API: <a id="ResourceOwnerPasswordCredentials"></a>
ResourceOwnerPasswordCredentials
- Type: OAuth
- Flow: password
- Authorization URL:
- Scopes:
- TWO_FACTOR: Read and write permission for SESSION interfaces
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net8.0
- JsonSubTypes (>= 2.0.1)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 8.1.0)
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 | 90 | 2/15/2026 |