Installation
Maven
Add the dependency to yourpom.xml:
pom.xml
Gradle
Add the dependency to yourbuild.gradle:
build.gradle.kts
The SDK supports Java 8 and all later versions, including Java 11, 17, and 21.
Quick Start
Initialize the client and create a checkout session:Core Features
Type Safety
Strongly typed API with compile-time safety
Thread-Safe
Safe for concurrent use in multi-threaded applications
Builder Pattern
Intuitive builder pattern for constructing requests
Async Support
CompletableFuture support for asynchronous operations
Configuration
Environment Variables
Configure using environment variables or system properties:.env
Manual Configuration
Configure manually with all options:Test Mode
Configure for test/sandbox environment:Common Operations
Create a Checkout Session
Generate a checkout session:Manage Customers
Create and retrieve customer information:Handle Subscriptions
Create and manage recurring subscriptions:productPrice is expressed in the lowest currency denomination (e.g., cents for USD, paise for INR). To charge $25.00, pass 2500.Usage-Based Billing
Configure Meters
Create and manage meters for tracking usage:Ingest Usage Events
Track custom events:Batch Ingest Events
Ingest multiple events efficiently (max 1000 per request):Error Handling
Comprehensive error handling for different scenarios:Async Operations
Use CompletableFuture for asynchronous operations:Spring Boot Integration
Configuration Class
Service Layer
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 Java SDK?- Discord: Join our community server for real-time support
- Email: Contact us at support@dodopayments.com
- GitHub: Open an issue on the repository