Overview
The Devdraft TypeScript SDK provides a complete client library for integrating payment processing, customer management, and webhook functionality into your TypeScript or JavaScript applications.Type-Safe
Full TypeScript support with comprehensive type definitions
Promise-Based
Modern async/await API for clean, readable code
Comprehensive
Access to all Devdraft API endpoints and features
Easy Integration
Simple configuration and intuitive method names
Installation
Quick Start
API Classes
The SDK is organized into API classes, each handling a specific domain:| API Class | Description |
|---|---|
| APIHealthApi | Service health checks and status monitoring |
| AppBalancesApi | Query application balances across stablecoins |
| CustomersApi | Customer management and KYC operations |
| ExchangeRatesApi | Real-time currency exchange rates |
| InvoicesApi | Invoice creation and management |
| LiquidationAddressesApi | Cryptocurrency liquidation addresses |
| PaymentIntentsApi | Payment intent creation for bank and stablecoin |
| PaymentLinksApi | Generate and manage payment links |
| ProductsApi | Product catalog management |
| TaxesApi | Tax configuration and management |
| TestPaymentsApi | Test payment processing in sandbox |
| TransfersApi | Initiate and manage fund transfers |
| WalletsApi | Wallet management and balances |
| WebhooksApi | Webhook configuration and management |
API Health
Monitor service health and availability.Methods
healthControllerCheckV0()
Authenticated health check endpoint requiring API credentials.
Promise<void>
healthControllerPublicHealthCheckV0()
Public health check endpoint (no authentication required).
Promise<PublicHealthResponseDto>
App Balances
Query your application’s stablecoin balances.Methods
balanceControllerGetAllBalances()
Get all stablecoin balances for your application.
Promise<AllBalancesResponse>
balanceControllerGetUSDCBalance()
Get USDC balance only.
Promise<AggregatedBalanceResponse>
balanceControllerGetEURCBalance()
Get EURC balance only.
Promise<AggregatedBalanceResponse>
Customers
Manage customer records and KYC information.Methods
customerControllerCreate(params)
Create a new customer.
createCustomerDto: CreateCustomerDto- Customer details
Promise<Customer>
customerControllerFindAll(params?)
Get all customers with optional filters.
page?: number- Page number (default: 1)limit?: number- Items per page (default: 20)status?: CustomerStatus- Filter by status
Promise<Customer[]>
customerControllerFindOne(params)
Get a customer by ID.
id: string- Customer ID
Promise<Customer>
customerControllerUpdate(params)
Update a customer’s information.
id: string- Customer IDupdateCustomerDto: UpdateCustomerDto- Fields to update
Promise<Customer>
Exchange Rates
Get real-time currency exchange rates.Methods
exchangeRateControllerGetExchangeRate(params)
Get exchange rate between any two supported currencies.
from: string- Source currency codeto: string- Target currency code
Promise<ExchangeRateResponseDto>
exchangeRateControllerGetUSDToEURRate()
Get USD to EUR exchange rate.
Promise<ExchangeRateResponseDto>
exchangeRateControllerGetEURToUSDRate()
Get EUR to USD exchange rate.
Promise<ExchangeRateResponseDto>
Invoices
Create and manage invoices for your customers.Methods
invoiceControllerCreate(params)
Create a new invoice.
createInvoiceDto: CreateInvoiceDto- Invoice details
Promise<Invoice>
invoiceControllerFindAll(params?)
Get all invoices.
page?: number- Page numberlimit?: number- Items per pagestatus?: string- Filter by status
Promise<Invoice[]>
invoiceControllerFindOne(params)
Get an invoice by ID.
id: string- Invoice ID
Promise<Invoice>
invoiceControllerUpdate(params)
Update an invoice.
id: string- Invoice IDupdateInvoiceDto: UpdateInvoiceDto- Fields to update
Promise<Invoice>
Liquidation Addresses
Manage cryptocurrency liquidation addresses for customers.Methods
liquidationAddressControllerCreateLiquidationAddress(params)
Create a new liquidation address for a customer.
customerId: string- Customer IDcreateLiquidationAddressDto: CreateLiquidationAddressDto- Address details
Promise<LiquidationAddressResponseDto>
liquidationAddressControllerGetLiquidationAddresses(params)
Get all liquidation addresses for a customer.
customerId: string- Customer ID
Promise<LiquidationAddressResponseDto[]>
liquidationAddressControllerGetLiquidationAddress(params)
Get a specific liquidation address.
customerId: string- Customer IDliquidationAddressId: string- Address ID
Promise<LiquidationAddressResponseDto>
Payment Intents
Create payment intents for bank and stablecoin payments.Methods
paymentIntentControllerCreateBankPaymentIntent(params)
Create a bank payment intent.
createBankPaymentIntentDto: CreateBankPaymentIntentDto- Intent details
Promise<PaymentIntent>
paymentIntentControllerCreateStablePaymentIntent(params)
Create a stablecoin payment intent.
createStablePaymentIntentDto: CreateStablePaymentIntentDto- Intent details
Promise<PaymentIntent>
Payment Links
Generate and manage payment links for easy customer payments.Methods
paymentLinksControllerCreate(params)
Create a new payment link.
createPaymentLinkDto: CreatePaymentLinkDto- Link details
Promise<PaymentLink>
paymentLinksControllerFindAll(params?)
Get all payment links.
page?: number- Page numberlimit?: number- Items per pageactive?: boolean- Filter by active status
Promise<PaymentLink[]>
paymentLinksControllerFindOne(params)
Get a payment link by ID.
id: string- Payment link ID
Promise<PaymentLink>
paymentLinksControllerUpdate(params)
Update a payment link.
id: string- Payment link IDupdatePaymentLinkDto: UpdatePaymentLinkDto- Fields to update
Promise<PaymentLink>
Products
Manage your product catalog.Methods
productControllerCreate(params)
Create a new product.
createProductDto: CreateProductDto- Product details
Promise<Product>
productControllerFindAll(params?)
Get all products.
category?: string- Filter by categoryactive?: boolean- Filter by active status
Promise<Product[]>
productControllerFindOne(params)
Get a product by ID.
id: string- Product ID
Promise<Product>
productControllerUpdate(params)
Update a product.
id: string- Product IDupdateProductDto: UpdateProductDto- Fields to update
Promise<Product>
productControllerRemove(params)
Delete a product.
id: string- Product ID
Promise<void>
productControllerUploadImage(params)
Upload images for a product.
id: string- Product IDimages: File[]- Image files
Promise<Product>
Taxes
Configure and manage tax settings.Methods
taxControllerCreate(params)
Create a new tax configuration.
createTaxDto: CreateTaxDto- Tax details
Promise<Tax>
taxControllerFindAll(params?)
Get all tax configurations.
country?: string- Filter by country
Promise<Tax[]>
taxControllerFindOne(params)
Get a tax configuration by ID.
id: string- Tax ID
Promise<Tax>
taxControllerUpdate(params)
Update a tax configuration.
id: string- Tax IDupdateTaxDto: UpdateTaxDto- Fields to update
Promise<Tax>
taxControllerRemove(params)
Delete a tax configuration.
id: string- Tax ID
Promise<void>
Test Payments
Process test payments in sandbox environment.Methods
testPaymentControllerCreatePaymentV0(params)
Create a test payment.
paymentRequestDto: PaymentRequestDto- Payment details
Promise<PaymentResponseDto>
testPaymentControllerGetPaymentV0(params)
Get test payment details by ID.
id: string- Payment ID
Promise<PaymentResponseDto>
testPaymentControllerRefundPaymentV0(params)
Refund a test payment.
id: string- Payment IDrefundAmount?: number- Amount to refund (optional, defaults to full amount)
Promise<RefundResponseDto>
Transfers
Initiate and manage fund transfers between different payment rails.Methods
transferControllerCreateDirectBankTransfer(params)
Create a direct bank transfer.
createDirectBankTransferDto: CreateDirectBankTransferDto- Transfer details
Promise<Transfer>
See also: Direct Bank Transfer Guide
transferControllerCreateDirectWalletTransfer(params)
Create a direct wallet transfer.
createDirectWalletTransferDto: CreateDirectWalletTransferDto- Transfer details
Promise<Transfer>
See also: Direct Wallet Transfer Guide
transferControllerCreateExternalBankTransfer(params)
Create an external bank transfer (from your wallet to external bank).
createExternalBankTransferDto: CreateExternalBankTransferDto- Transfer details
Promise<Transfer>
transferControllerCreateExternalStablecoinTransfer(params)
Create an external stablecoin transfer (from your wallet to external wallet).
createExternalStablecoinTransferDto: CreateExternalStablecoinTransferDto- Transfer details
Promise<Transfer>
transferControllerCreateStablecoinConversion(params)
Convert between different stablecoins or networks.
createStablecoinConversionDto: CreateStablecoinConversionDto- Conversion details
Promise<Conversion>
See also: Stablecoin Conversion Guide
Wallets
Manage wallets and query balances.Methods
walletControllerGetWallets()
Get all wallets for your application.
Promise<void>
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(params)
Create a new webhook.
createWebhookDto: CreateWebhookDto- Webhook configuration
Promise<WebhookResponseDto>
See also: Webhooks Overview
webhookControllerFindAll(params?)
Get all webhooks.
page?: number- Page numberlimit?: number- Items per pageactive?: boolean- Filter by active status
Promise<WebhookResponseDto[]>
webhookControllerFindOne(params)
Get a webhook by ID.
id: string- Webhook ID
Promise<WebhookResponseDto>
webhookControllerUpdate(params)
Update a webhook.
id: string- Webhook IDupdateWebhookDto: UpdateWebhookDto- Fields to update
Promise<WebhookResponseDto>
webhookControllerRemove(params)
Delete a webhook.
id: string- Webhook ID
Promise<void>
Error Handling
All SDK methods may throw errors. Handle them appropriately:Type Definitions
The SDK includes comprehensive TypeScript types for all requests and responses. Import them as needed:Best Practices
Implement Proper Error Handling
Always wrap API calls in try-catch blocks and handle errors appropriately.
Reuse Configuration
Create a single Configuration instance and reuse it across multiple API clients.
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
