Installation
Gradle (Kotlin DSL)
Add the dependency to yourbuild.gradle.kts:
build.gradle.kts
Maven
Add the dependency to yourpom.xml:
pom.xml
The SDK requires Java 8 or later and is compatible with both JVM and Android platforms.
Quick Start
Initialize the client and create a checkout session:Core Features
Coroutines
Full support for Kotlin coroutines for asynchronous operations
Null Safety
Leverage Kotlin’s null safety for robust error handling
Extension Functions
Idiomatic Kotlin extensions for enhanced functionality
Data Classes
Type-safe data classes with copy and destructuring support
Configuration
From Environment Variables
Initialize from environment variables or system properties:Manual Configuration
Configure manually with all options:Test Mode
Configure for test/sandbox environment:Timeouts and Retries
Configure globally or per-request:Common Operations
Create a Checkout Session
Generate a checkout session:Create a Product
Create products with detailed configuration:Activate License Key
Activate license keys for customers:Handle Subscriptions
Create and manage recurring subscriptions:billing requires at minimum a two-letter ISO country code. Use AttachExistingCustomer to attach an existing customer, or NewCustomer to create one. productPrice is expressed in the lowest currency denomination.Usage-Based Billing
Record Usage Events
Track usage for meters:Async Operations
Async Client
Use the async client for coroutine-based operations:Error Handling
Handle errors with Kotlin’s exception handling:Functional Error Handling
UseResult for functional error handling:
Android Integration
Use with Android applications:Response Validation
Enable response validation:Advanced Features
Proxy Configuration
Configure proxy settings:Temporary Configuration
Modify client configuration temporarily:Ktor Integration
Integrate with Ktor server applications: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 Kotlin SDK?- Discord: Join our community server for real-time support
- Email: Contact us at support@dodopayments.com
- GitHub: Open an issue on the repository