Overview
The Devdraft Java SDK provides a complete client library for integrating payment processing, customer management, and webhook functionality into your Java applications.Type-Safe
Strongly typed with comprehensive model classes
Maven & Gradle
Easy installation via Maven Central or Gradle
Java 11+
Compatible with Java 11 and later versions
Spring Boot Ready
Works seamlessly with Spring Boot applications
Installation
Maven
Add to yourpom.xml:
Gradle
Add to yourbuild.gradle:
build.gradle.kts):
Requirements
- Java 11 or higher
- Maven 3.6+ or Gradle 6.0+
Quick Start
API Classes
The SDK is organized into API classes under theorg.openapitools.client.api package:
API Health
Monitor service health and availability.Methods
healthControllerCheckV0()
Authenticated health check endpoint requiring API credentials.
HealthResponseDto
Throws: ApiException - if the API call fails
healthControllerPublicHealthCheckV0()
Public health check endpoint (no authentication required).
PublicHealthResponseDto
Throws: ApiException - if the API call fails
App Balances
Query your application’s stablecoin balances.Methods
balanceControllerGetAllBalances()
Get all stablecoin balances for your application.
AllBalancesResponse
Throws: ApiException - if the API call fails
balanceControllerGetUSDCBalance()
Get USDC balance only.
AggregatedBalanceResponse
Throws: ApiException - if the API call fails
balanceControllerGetEURCBalance()
Get EURC balance only.
AggregatedBalanceResponse
Throws: ApiException - if the API call fails
Customers
Manage customer records and KYC information.Methods
customerControllerCreate(CreateCustomerDto)
Create a new customer.
createCustomerDto: CreateCustomerDto- Customer details
Object
Throws: ApiException - if the API call fails
customerControllerFindAll(Integer, Integer, String)
Get all customers with optional filters.
page: Integer- Page number (optional, default: 1)limit: Integer- Items per page (optional, default: 20)status: String- Filter by status (optional)
Object
Throws: ApiException - if the API call fails
customerControllerFindOne(String)
Get a customer by ID.
id: String- Customer ID (required)
Object
Throws: ApiException - if the API call fails
customerControllerUpdate(String, UpdateCustomerDto)
Update a customer’s information.
id: String- Customer ID (required)updateCustomerDto: UpdateCustomerDto- Fields to update
Object
Throws: ApiException - if the API call fails
Exchange Rates
Get real-time currency exchange rates.Methods
exchangeRateControllerGetExchangeRate(String, String)
Get exchange rate between any two supported currencies.
from: String- Source currency code (optional)to: String- Target currency code (optional)
ExchangeRateResponseDto
Throws: ApiException - if the API call fails
exchangeRateControllerGetUSDToEURRate()
Get USD to EUR exchange rate.
ExchangeRateResponseDto
Throws: ApiException - if the API call fails
exchangeRateControllerGetEURToUSDRate()
Get EUR to USD exchange rate.
ExchangeRateResponseDto
Throws: ApiException - if the API call fails
Invoices
Create and manage invoices for your customers.Methods
invoiceControllerCreate(CreateInvoiceDto)
Create a new invoice.
createInvoiceDto: CreateInvoiceDto- Invoice details
Object
Throws: ApiException - if the API call fails
invoiceControllerFindAll(Integer, Integer, String)
Get all invoices.
page: Integer- Page number (optional)limit: Integer- Items per page (optional)status: String- Filter by status (optional)
Object
Throws: ApiException - if the API call fails
invoiceControllerFindOne(String)
Get an invoice by ID.
id: String- Invoice ID (required)
Object
Throws: ApiException - if the API call fails
invoiceControllerUpdate(String, Object)
Update an invoice.
id: String- Invoice ID (required)updateInvoiceDto: Object- Fields to update
Object
Throws: ApiException - if the API call fails
Liquidation Addresses
Manage cryptocurrency liquidation addresses for customers.Methods
liquidationAddressControllerCreateLiquidationAddress(String, CreateLiquidationAddressDto)
Create a new liquidation address for a customer.
customerId: String- Customer ID (required)createLiquidationAddressDto: CreateLiquidationAddressDto- Address details
LiquidationAddressResponseDto
Throws: ApiException - if the API call fails
liquidationAddressControllerGetLiquidationAddresses(String)
Get all liquidation addresses for a customer.
customerId: String- Customer ID (required)
Object
Throws: ApiException - if the API call fails
liquidationAddressControllerGetLiquidationAddress(String, String)
Get a specific liquidation address.
customerId: String- Customer ID (required)liquidationAddressId: String- Address ID (required)
LiquidationAddressResponseDto
Throws: ApiException - if the API call fails
Payment Intents
Create payment intents for bank and stablecoin payments.Methods
paymentIntentControllerCreateBankPaymentIntent(CreateBankPaymentIntentDto)
Create a bank payment intent.
createBankPaymentIntentDto: CreateBankPaymentIntentDto- Intent details
Object
Throws: ApiException - if the API call fails
paymentIntentControllerCreateStablePaymentIntent(CreateStablePaymentIntentDto)
Create a stablecoin payment intent.
createStablePaymentIntentDto: CreateStablePaymentIntentDto- Intent details
Object
Throws: ApiException - if the API call fails
Payment Links
Generate and manage payment links for easy customer payments.Methods
paymentLinksControllerCreate(CreatePaymentLinkDto)
Create a new payment link.
createPaymentLinkDto: CreatePaymentLinkDto- Link details
Object
Throws: ApiException - if the API call fails
paymentLinksControllerFindAll(Integer, Integer, Boolean)
Get all payment links.
page: Integer- Page number (optional)limit: Integer- Items per page (optional)active: Boolean- Filter by active status (optional)
Object
Throws: ApiException - if the API call fails
paymentLinksControllerFindOne(String)
Get a payment link by ID.
id: String- Payment link ID (required)
Object
Throws: ApiException - if the API call fails
paymentLinksControllerUpdate(String, Object)
Update a payment link.
id: String- Payment link ID (required)updatePaymentLinkDto: Object- Fields to update
Object
Throws: ApiException - if the API call fails
Products
Manage your product catalog.Methods
productControllerCreate(Object)
Create a new product.
createProductDto: Object- Product details
Object
Throws: ApiException - if the API call fails
productControllerFindAll(String, Boolean)
Get all products.
category: String- Filter by category (optional)active: Boolean- Filter by active status (optional)
Object
Throws: ApiException - if the API call fails
productControllerFindOne(String)
Get a product by ID.
id: String- Product ID (required)
Object
Throws: ApiException - if the API call fails
productControllerUpdate(String, Object)
Update a product.
id: String- Product ID (required)updateProductDto: Object- Fields to update
Object
Throws: ApiException - if the API call fails
productControllerRemove(String)
Delete a product.
id: String- Product ID (required)
void
Throws: ApiException - if the API call fails
productControllerUploadImage(String, List<File>)
Upload images for a product.
id: String- Product ID (required)images: List<File>- Image files
Object
Throws: ApiException - if the API call fails
Taxes
Configure and manage tax settings.Methods
taxControllerCreate(CreateTaxDto)
Create a new tax configuration.
createTaxDto: CreateTaxDto- Tax details
TaxControllerCreate201Response
Throws: ApiException - if the API call fails
taxControllerFindAll(String)
Get all tax configurations.
country: String- Filter by country (optional)
Object
Throws: ApiException - if the API call fails
taxControllerFindOne(String)
Get a tax configuration by ID.
id: String- Tax ID (required)
Object
Throws: ApiException - if the API call fails
taxControllerUpdate(String, UpdateTaxDto)
Update a tax configuration.
id: String- Tax ID (required)updateTaxDto: UpdateTaxDto- Fields to update
Object
Throws: ApiException - if the API call fails
taxControllerRemove(String)
Delete a tax configuration.
id: String- Tax ID (required)
void
Throws: ApiException - if the API call fails
Test Payments
Process test payments in sandbox environment.Methods
testPaymentControllerCreatePaymentV0(PaymentRequestDto)
Create a test payment.
paymentRequestDto: PaymentRequestDto- Payment details
PaymentResponseDto
Throws: ApiException - if the API call fails
testPaymentControllerGetPaymentV0(String)
Get test payment details by ID.
id: String- Payment ID (required)
PaymentResponseDto
Throws: ApiException - if the API call fails
testPaymentControllerRefundPaymentV0(String, BigDecimal)
Refund a test payment.
id: String- Payment ID (required)refundAmount: BigDecimal- Amount to refund (optional, defaults to full amount)
RefundResponseDto
Throws: ApiException - if the API call fails
Transfers
Initiate and manage fund transfers between different payment rails.Methods
transferControllerCreateDirectBankTransfer(CreateDirectBankTransferDto)
Create a direct bank transfer.
createDirectBankTransferDto: CreateDirectBankTransferDto- Transfer details
Object
Throws: ApiException - if the API call fails
See also: Direct Bank Transfer Guide
transferControllerCreateDirectWalletTransfer(CreateDirectWalletTransferDto)
Create a direct wallet transfer.
createDirectWalletTransferDto: CreateDirectWalletTransferDto- Transfer details
Object
Throws: ApiException - if the API call fails
See also: Direct Wallet Transfer Guide
transferControllerCreateExternalBankTransfer(CreateExternalBankTransferDto)
Create an external bank transfer (from your wallet to external bank).
createExternalBankTransferDto: CreateExternalBankTransferDto- Transfer details
Object
Throws: ApiException - if the API call fails
transferControllerCreateExternalStablecoinTransfer(CreateExternalStablecoinTransferDto)
Create an external stablecoin transfer (from your wallet to external wallet).
createExternalStablecoinTransferDto: CreateExternalStablecoinTransferDto- Transfer details
Object
Throws: ApiException - if the API call fails
transferControllerCreateStablecoinConversion(CreateStablecoinConversionDto)
Convert between different stablecoins or networks.
createStablecoinConversionDto: CreateStablecoinConversionDto- Conversion details
Object
Throws: ApiException - if the API call fails
See also: Stablecoin Conversion Guide
Wallets
Manage wallets and query balances.Methods
walletControllerGetWallets()
Get all wallets for your application.
void
Throws: ApiException - if the API call fails
The response contains wallet IDs that you can use for transfers and other operations. In a future SDK version, this will return typed wallet objects.
Webhooks
Configure webhooks to receive real-time event notifications.Methods
webhookControllerCreate(CreateWebhookDto)
Create a new webhook.
createWebhookDto: CreateWebhookDto- Webhook configuration
WebhookResponseDto
Throws: ApiException - if the API call fails
See also: Webhooks Overview
webhookControllerFindAll(Integer, Integer, Boolean)
Get all webhooks.
page: Integer- Page number (optional)limit: Integer- Items per page (optional)active: Boolean- Filter by active status (optional)
Object
Throws: ApiException - if the API call fails
webhookControllerFindOne(String)
Get a webhook by ID.
id: String- Webhook ID (required)
WebhookResponseDto
Throws: ApiException - if the API call fails
webhookControllerUpdate(String, UpdateWebhookDto)
Update a webhook.
id: String- Webhook ID (required)updateWebhookDto: UpdateWebhookDto- Fields to update
WebhookResponseDto
Throws: ApiException - if the API call fails
webhookControllerRemove(String)
Delete a webhook.
id: String- Webhook ID (required)
void
Throws: ApiException - if the API call fails
Error Handling
All SDK methods throwApiException when API calls fail. Handle them appropriately:
Best Practices
1
Use Environment Variables
Store credentials in environment variables or configuration files.
2
Implement Proper Exception Handling
Always wrap API calls in try-catch blocks with specific error handling.
3
Use BigDecimal for Currency Amounts
Always use
BigDecimal for monetary values to avoid floating-point precision issues.4
Leverage Java Streams
Use Java Streams for collection operations when processing API responses.
5
Implement Logging
Use a logging framework like SLF4J or Log4j2.
6
Use Dependency Injection
Integrate with Spring or other DI frameworks for better testability.
Testing with JUnit 5
Example JUnit test for SDK integration:Spring Boot Integration
Configuration
Create a configuration class for Spring Boot applications:Application Properties
Service Layer
Create service classes for clean separation:REST Controller
Use the service in your Spring Boot controllers:Global Exception Handler
Handle API exceptions globally:Next Steps
SDK Quickstart
Complete integration guide with examples
Transfers
Learn about initiating transfers
Webhooks
Set up webhook notifications
API Reference
Complete REST API documentation
