The C# SDK is currently in beta. We’re actively working on improvements and welcome your feedback.
Installation
Install the SDK using the .NET CLI:The SDK requires .NET 8.0 or higher. It works with ASP.NET Core, Console applications, and other .NET project types.
Quick Start
Initialize the client and create a checkout session:Core Features
Async/Await
Full async Task-based API for non-blocking operations
Strong Typing
Comprehensive type safety with nullable reference types
Dependency Injection
First-class support for .NET dependency injection
Configuration
Simple configuration via environment variables or appsettings.json
Configuration
Environment Variables
Configure using environment variables:.env
Manual Configuration
Configure manually with bearer token:Common Operations
Create a Checkout Session
Generate a checkout session:Manage Customers
Create and retrieve customer information:Handle Subscriptions
Create and manage recurring subscriptions:ASP.NET Core Integration
Service Registration
Register the client inProgram.cs:
Program.cs
Configuration
Add configuration inappsettings.json:
appsettings.json
API Controller
Create a controller using dependency injection:Service Layer Pattern
Create a service for business logic:User Secrets (Development)
For development, use user secrets to store API keys:Testing
Example unit test using xUnit:Resources
GitHub Repository
View source code and contribute
API Reference
Complete API documentation
Discord Community
Get help and connect with developers
Report Issues
Report bugs or request features
Support
Need help with the C# SDK?- Discord: Join our community server for real-time support
- Email: Contact us at support@dodopayments.com
- GitHub: Open an issue on the repository