# sumup/sumup-dotnet architecture

> Architecture diagram of the GitHub repository sumup/sumup-dotnet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sumup/sumup-dotnet
- Repository: https://github.com/sumup/sumup-dotnet

## Overview

SumUp .NET SDK is a client library for calling the SumUp API. The main workflow is: application code configures a client, calls a generated resource client, and the shared HTTP layer builds, authenticates, sends, and deserializes requests; failures surface as typed API exceptions. Separate capabilities include reader checkouts, webhook signature verification and event handling, and OAuth token operations. The repository also contains an OpenAPI-driven SDK generator. Generated resource implementations were not sampled, so their links to the shared transport are documented only where README examples establish usage; other generated-client relationships are omitted.

Main entry points: [`src/SumUp/Http/ApiClient.cs`](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Http/ApiClient.cs) (HTTP API client), [`src/SumUp/SumUpClient.cs`](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/SumUpClient.cs) (SDK client), [`src/SumUp/Events.cs`](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Events.cs) (Event handler), [`src/SumUp/CheckoutsClient.g.cs`](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/CheckoutsClient.g.cs) (Checkout API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["SDK entry and resources"]
  node_client["SDK client<br/>[SumUpClient.cs]"]
  node_options["Client options"]
  node_checkout["Checkout API"]
  node_readers["Reader API<br/>[ReadersClient.g.cs]"]
  node_tokens["Token API<br/>[TokensClient.g.cs]"]
  node_resourceapis["Other resource APIs"]
  node_models["API models"]
end

subgraph group_transport["HTTP transport"]
  node_transportclient["HTTP API client<br/>[ApiClient.cs]"]
  node_builder["Request builder<br/>[RequestBuilder.cs]"]
  node_headers["Runtime headers<br/>[RuntimeHeaders.cs]"]
  node_errors["API exceptions<br/>[ApiException.cs]"]
  node_reqoptions["Request overrides<br/>[RequestOptions.cs]"]
end

subgraph group_events["Webhook events"]
  node_eventhandler["Event handler<br/>[Events.cs]"]
  node_eventtypes["Event models<br/>[Events.g.cs]"]
  node_eventerrors["Event exceptions<br/>[EventExceptions.cs]"]
end

subgraph group_generation["SDK generation"]
  node_spec["OpenAPI spec loader<br/>[spec.go]"]
  node_generator["SDK generator<br/>[generator.go]"]
  node_codegencli["Generator CLI<br/>[main.go]"]
end

node_app(("Application"))
node_api(("API service"))
node_openapi["OpenAPI definition<br/>[openapi.json]"]

node_app -->|"configures"| node_client
node_app -->|"calls"| node_checkout
node_app -->|"calls"| node_readers
node_app -.->|"uses"| node_tokens
node_client -->|"uses"| node_options
node_client -->|"creates"| node_transportclient
node_client -.->|"exposes"| node_checkout
node_client -.->|"exposes"| node_readers
node_client -.->|"exposes"| node_tokens
node_checkout -.->|"dispatches"| node_transportclient
node_readers -.->|"dispatches"| node_transportclient
node_transportclient -->|"builds requests"| node_builder
node_transportclient -->|"applies headers"| node_headers
node_transportclient -->|"gets credentials"| node_options
node_transportclient -->|"reads overrides"| node_reqoptions
node_transportclient -->|"sends HTTP"| node_api
node_transportclient -->|"throws on failure"| node_errors
node_app -->|"handles webhooks"| node_eventhandler
node_client -->|"creates handler"| node_eventhandler
node_eventhandler -->|"uses models"| node_eventtypes
node_eventhandler -->|"fetches resource"| node_transportclient
node_app -.->|"provides specification"| node_openapi
node_codegencli -->|"loads spec"| node_spec
node_codegencli -->|"runs generation"| node_generator
node_openapi -.->|"parsed by"| node_spec

click node_client "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/SumUpClient.cs"
click node_options "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/SumUpClientOptions.cs"
click node_checkout "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/CheckoutsClient.g.cs"
click node_readers "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/ReadersClient.g.cs"
click node_tokens "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/TokensClient.g.cs"
click node_resourceapis "https://github.com/sumup/sumup-dotnet/tree/main/src/SumUp"
click node_models "https://github.com/sumup/sumup-dotnet/tree/main/src/SumUp/Models"
click node_transportclient "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Http/ApiClient.cs"
click node_builder "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Http/RequestBuilder.cs"
click node_headers "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Http/RuntimeHeaders.cs"
click node_errors "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Http/ApiException.cs"
click node_reqoptions "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/RequestOptions.cs"
click node_eventhandler "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Events.cs"
click node_eventtypes "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Events.g.cs"
click node_eventerrors "https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/EventExceptions.cs"
click node_spec "https://github.com/sumup/sumup-dotnet/blob/main/codegen/internal/spec/spec.go"
click node_generator "https://github.com/sumup/sumup-dotnet/blob/main/codegen/internal/generator/generator.go"
click node_codegencli "https://github.com/sumup/sumup-dotnet/blob/main/codegen/main.go"
click node_openapi "https://github.com/sumup/sumup-dotnet/blob/main/openapi.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client,node_options,node_checkout,node_readers,node_tokens,node_resourceapis,node_models toneBlue
class node_transportclient,node_builder,node_headers,node_errors,node_reqoptions toneAmber
class node_eventhandler,node_eventtypes,node_eventerrors,node_api,node_openapi toneMint
class node_spec,node_generator,node_codegencli toneRose
class node_app toneIndigo
```

## Components

### SDK entry and resources

- [SDK client](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/SumUpClient.cs): `src/SumUp/SumUpClient.cs`
- [Client options](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/SumUpClientOptions.cs): `src/SumUp/SumUpClientOptions.cs`
- [Checkout API](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/CheckoutsClient.g.cs): `src/SumUp/CheckoutsClient.g.cs`
- [Reader API](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/ReadersClient.g.cs): `src/SumUp/ReadersClient.g.cs`
- [Token API](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/TokensClient.g.cs): `src/SumUp/TokensClient.g.cs`
- [Other resource APIs](https://github.com/sumup/sumup-dotnet/tree/main/src/SumUp): `src/SumUp`
- [API models](https://github.com/sumup/sumup-dotnet/tree/main/src/SumUp/Models): `src/SumUp/Models`

### HTTP transport

- [HTTP API client](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Http/ApiClient.cs): `src/SumUp/Http/ApiClient.cs`
- [Request builder](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Http/RequestBuilder.cs): `src/SumUp/Http/RequestBuilder.cs`
- [Runtime headers](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Http/RuntimeHeaders.cs): `src/SumUp/Http/RuntimeHeaders.cs`
- [API exceptions](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Http/ApiException.cs): `src/SumUp/Http/ApiException.cs`
- [Request overrides](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/RequestOptions.cs): `src/SumUp/RequestOptions.cs`

### Webhook events

- [Event handler](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Events.cs): `src/SumUp/Events.cs`
- [Event models](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/Events.g.cs): `src/SumUp/Events.g.cs`
- [Event exceptions](https://github.com/sumup/sumup-dotnet/blob/main/src/SumUp/EventExceptions.cs): `src/SumUp/EventExceptions.cs`

### SDK generation

- [OpenAPI spec loader](https://github.com/sumup/sumup-dotnet/blob/main/codegen/internal/spec/spec.go): `codegen/internal/spec/spec.go`
- [SDK generator](https://github.com/sumup/sumup-dotnet/blob/main/codegen/internal/generator/generator.go): `codegen/internal/generator/generator.go`
- [Generator CLI](https://github.com/sumup/sumup-dotnet/blob/main/codegen/main.go): `codegen/main.go`

### Other components

- **Application**
- **API service**
- [OpenAPI definition](https://github.com/sumup/sumup-dotnet/blob/main/openapi.json): `openapi.json`

## Connections

- Application → SDK client: configures (evidence: `README.md`)
- Application → Checkout API: calls (evidence: `README.md`)
- Application → Reader API: calls (evidence: `README.md`)
- Application → Token API: uses
- SDK client → Client options: uses (evidence: `src/SumUp/SumUpClient.cs`)
- SDK client → HTTP API client: creates (evidence: `src/SumUp/SumUpClient.cs`)
- SDK client → Checkout API: exposes
- SDK client → Reader API: exposes
- SDK client → Token API: exposes
- Checkout API → HTTP API client: dispatches
- Reader API → HTTP API client: dispatches
- HTTP API client → Request builder: builds requests (evidence: `src/SumUp/Http/ApiClient.cs`)
- HTTP API client → Runtime headers: applies headers (evidence: `src/SumUp/Http/ApiClient.cs`)
- HTTP API client → Client options: gets credentials (evidence: `src/SumUp/Http/ApiClient.cs`)
- HTTP API client → Request overrides: reads overrides (evidence: `src/SumUp/Http/ApiClient.cs`)
- HTTP API client → API service: sends HTTP (evidence: `src/SumUp/Http/ApiClient.cs`)
- HTTP API client → API exceptions: throws on failure (evidence: `src/SumUp/Http/ApiClient.cs`)
- Application → Event handler: handles webhooks (evidence: `README.md`)
- SDK client → Event handler: creates handler (evidence: `README.md`)
- Event handler → Event models: uses models (evidence: `README.md`)
- Event handler → HTTP API client: fetches resource (evidence: `README.md`)
- Application → OpenAPI definition: provides specification
- Generator CLI → OpenAPI spec loader: loads spec (evidence: `codegen/main.go`)
- Generator CLI → SDK generator: runs generation (evidence: `codegen/main.go`)
- OpenAPI definition → OpenAPI spec loader: parsed by
