Skip to main content

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 your pom.xml:

Gradle

Add to your build.gradle:
Or for Kotlin DSL (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 the org.openapitools.client.api package:

API Health

Monitor service health and availability.

Methods

healthControllerCheckV0()

Authenticated health check endpoint requiring API credentials.
Returns: HealthResponseDto Throws: ApiException - if the API call fails

healthControllerPublicHealthCheckV0()

Public health check endpoint (no authentication required).
Returns: 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.
Returns: AllBalancesResponse Throws: ApiException - if the API call fails

balanceControllerGetUSDCBalance()

Get USDC balance only.
Returns: AggregatedBalanceResponse Throws: ApiException - if the API call fails

balanceControllerGetEURCBalance()

Get EURC balance only.
Returns: AggregatedBalanceResponse Throws: ApiException - if the API call fails

Customers

Manage customer records and KYC information.

Methods

customerControllerCreate(CreateCustomerDto)

Create a new customer.
Parameters:
  • createCustomerDto: CreateCustomerDto - Customer details
Returns: Object Throws: ApiException - if the API call fails

customerControllerFindAll(Integer, Integer, String)

Get all customers with optional filters.
Parameters:
  • page: Integer - Page number (optional, default: 1)
  • limit: Integer - Items per page (optional, default: 20)
  • status: String - Filter by status (optional)
Returns: Object Throws: ApiException - if the API call fails

customerControllerFindOne(String)

Get a customer by ID.
Parameters:
  • id: String - Customer ID (required)
Returns: Object Throws: ApiException - if the API call fails

customerControllerUpdate(String, UpdateCustomerDto)

Update a customer’s information.
Parameters:
  • id: String - Customer ID (required)
  • updateCustomerDto: UpdateCustomerDto - Fields to update
Returns: 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.
Parameters:
  • from: String - Source currency code (optional)
  • to: String - Target currency code (optional)
Returns: ExchangeRateResponseDto Throws: ApiException - if the API call fails

exchangeRateControllerGetUSDToEURRate()

Get USD to EUR exchange rate.
Returns: ExchangeRateResponseDto Throws: ApiException - if the API call fails

exchangeRateControllerGetEURToUSDRate()

Get EUR to USD exchange rate.
Returns: ExchangeRateResponseDto Throws: ApiException - if the API call fails

Invoices

Create and manage invoices for your customers.

Methods

invoiceControllerCreate(CreateInvoiceDto)

Create a new invoice.
Parameters:
  • createInvoiceDto: CreateInvoiceDto - Invoice details
Returns: Object Throws: ApiException - if the API call fails

invoiceControllerFindAll(Integer, Integer, String)

Get all invoices.
Parameters:
  • page: Integer - Page number (optional)
  • limit: Integer - Items per page (optional)
  • status: String - Filter by status (optional)
Returns: Object Throws: ApiException - if the API call fails

invoiceControllerFindOne(String)

Get an invoice by ID.
Parameters:
  • id: String - Invoice ID (required)
Returns: Object Throws: ApiException - if the API call fails

invoiceControllerUpdate(String, Object)

Update an invoice.
Parameters:
  • id: String - Invoice ID (required)
  • updateInvoiceDto: Object - Fields to update
Returns: 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.
Parameters:
  • customerId: String - Customer ID (required)
  • createLiquidationAddressDto: CreateLiquidationAddressDto - Address details
Returns: LiquidationAddressResponseDto Throws: ApiException - if the API call fails

liquidationAddressControllerGetLiquidationAddresses(String)

Get all liquidation addresses for a customer.
Parameters:
  • customerId: String - Customer ID (required)
Returns: Object Throws: ApiException - if the API call fails

liquidationAddressControllerGetLiquidationAddress(String, String)

Get a specific liquidation address.
Parameters:
  • customerId: String - Customer ID (required)
  • liquidationAddressId: String - Address ID (required)
Returns: 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.
Parameters:
  • createBankPaymentIntentDto: CreateBankPaymentIntentDto - Intent details
Returns: Object Throws: ApiException - if the API call fails

paymentIntentControllerCreateStablePaymentIntent(CreateStablePaymentIntentDto)

Create a stablecoin payment intent.
Parameters:
  • createStablePaymentIntentDto: CreateStablePaymentIntentDto - Intent details
Returns: Object Throws: ApiException - if the API call fails
Generate and manage payment links for easy customer payments.

Methods

paymentLinksControllerCreate(CreatePaymentLinkDto)

Create a new payment link.
Parameters:
  • createPaymentLinkDto: CreatePaymentLinkDto - Link details
Returns: Object Throws: ApiException - if the API call fails

paymentLinksControllerFindAll(Integer, Integer, Boolean)

Get all payment links.
Parameters:
  • page: Integer - Page number (optional)
  • limit: Integer - Items per page (optional)
  • active: Boolean - Filter by active status (optional)
Returns: Object Throws: ApiException - if the API call fails

paymentLinksControllerFindOne(String)

Get a payment link by ID.
Parameters:
  • id: String - Payment link ID (required)
Returns: Object Throws: ApiException - if the API call fails

paymentLinksControllerUpdate(String, Object)

Update a payment link.
Parameters:
  • id: String - Payment link ID (required)
  • updatePaymentLinkDto: Object - Fields to update
Returns: Object Throws: ApiException - if the API call fails

Products

Manage your product catalog.

Methods

productControllerCreate(Object)

Create a new product.
Parameters:
  • createProductDto: Object - Product details
Returns: Object Throws: ApiException - if the API call fails

productControllerFindAll(String, Boolean)

Get all products.
Parameters:
  • category: String - Filter by category (optional)
  • active: Boolean - Filter by active status (optional)
Returns: Object Throws: ApiException - if the API call fails

productControllerFindOne(String)

Get a product by ID.
Parameters:
  • id: String - Product ID (required)
Returns: Object Throws: ApiException - if the API call fails

productControllerUpdate(String, Object)

Update a product.
Parameters:
  • id: String - Product ID (required)
  • updateProductDto: Object - Fields to update
Returns: Object Throws: ApiException - if the API call fails

productControllerRemove(String)

Delete a product.
Parameters:
  • id: String - Product ID (required)
Returns: void Throws: ApiException - if the API call fails

productControllerUploadImage(String, List<File>)

Upload images for a product.
Parameters:
  • id: String - Product ID (required)
  • images: List<File> - Image files
Returns: Object Throws: ApiException - if the API call fails

Taxes

Configure and manage tax settings.

Methods

taxControllerCreate(CreateTaxDto)

Create a new tax configuration.
Parameters:
  • createTaxDto: CreateTaxDto - Tax details
Returns: TaxControllerCreate201Response Throws: ApiException - if the API call fails

taxControllerFindAll(String)

Get all tax configurations.
Parameters:
  • country: String - Filter by country (optional)
Returns: Object Throws: ApiException - if the API call fails

taxControllerFindOne(String)

Get a tax configuration by ID.
Parameters:
  • id: String - Tax ID (required)
Returns: Object Throws: ApiException - if the API call fails

taxControllerUpdate(String, UpdateTaxDto)

Update a tax configuration.
Parameters:
  • id: String - Tax ID (required)
  • updateTaxDto: UpdateTaxDto - Fields to update
Returns: Object Throws: ApiException - if the API call fails

taxControllerRemove(String)

Delete a tax configuration.
Parameters:
  • id: String - Tax ID (required)
Returns: void Throws: ApiException - if the API call fails

Test Payments

Process test payments in sandbox environment.

Methods

testPaymentControllerCreatePaymentV0(PaymentRequestDto)

Create a test payment.
Parameters:
  • paymentRequestDto: PaymentRequestDto - Payment details
Returns: PaymentResponseDto Throws: ApiException - if the API call fails

testPaymentControllerGetPaymentV0(String)

Get test payment details by ID.
Parameters:
  • id: String - Payment ID (required)
Returns: PaymentResponseDto Throws: ApiException - if the API call fails

testPaymentControllerRefundPaymentV0(String, BigDecimal)

Refund a test payment.
Parameters:
  • id: String - Payment ID (required)
  • refundAmount: BigDecimal - Amount to refund (optional, defaults to full amount)
Returns: 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.
Parameters:
  • createDirectBankTransferDto: CreateDirectBankTransferDto - Transfer details
Returns: Object Throws: ApiException - if the API call fails See also: Direct Bank Transfer Guide

transferControllerCreateDirectWalletTransfer(CreateDirectWalletTransferDto)

Create a direct wallet transfer.
Parameters:
  • createDirectWalletTransferDto: CreateDirectWalletTransferDto - Transfer details
Returns: 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).
Parameters:
  • createExternalBankTransferDto: CreateExternalBankTransferDto - Transfer details
Returns: Object Throws: ApiException - if the API call fails

transferControllerCreateExternalStablecoinTransfer(CreateExternalStablecoinTransferDto)

Create an external stablecoin transfer (from your wallet to external wallet).
Parameters:
  • createExternalStablecoinTransferDto: CreateExternalStablecoinTransferDto - Transfer details
Returns: Object Throws: ApiException - if the API call fails

transferControllerCreateStablecoinConversion(CreateStablecoinConversionDto)

Convert between different stablecoins or networks.
Parameters:
  • createStablecoinConversionDto: CreateStablecoinConversionDto - Conversion details
Returns: 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.
Returns: 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.
Parameters:
  • createWebhookDto: CreateWebhookDto - Webhook configuration
Returns: WebhookResponseDto Throws: ApiException - if the API call fails See also: Webhooks Overview

webhookControllerFindAll(Integer, Integer, Boolean)

Get all webhooks.
Parameters:
  • page: Integer - Page number (optional)
  • limit: Integer - Items per page (optional)
  • active: Boolean - Filter by active status (optional)
Returns: Object Throws: ApiException - if the API call fails

webhookControllerFindOne(String)

Get a webhook by ID.
Parameters:
  • id: String - Webhook ID (required)
Returns: WebhookResponseDto Throws: ApiException - if the API call fails

webhookControllerUpdate(String, UpdateWebhookDto)

Update a webhook.
Parameters:
  • id: String - Webhook ID (required)
  • updateWebhookDto: UpdateWebhookDto - Fields to update
Returns: WebhookResponseDto Throws: ApiException - if the API call fails

webhookControllerRemove(String)

Delete a webhook.
Parameters:
  • id: String - Webhook ID (required)
Returns: void Throws: ApiException - if the API call fails

Error Handling

All SDK methods throw ApiException 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