Overview
The Devdraft C# SDK provides a complete client library for integrating payment processing, customer management, and webhook functionality into your .NET applications.Async/Await
Full async/await support for modern .NET applications
Dependency Injection
Built-in support for Microsoft.Extensions.DependencyInjection
Type-Safe
Strong typing with generics and nullable reference types
Resilience
Polly integration for retry policies and circuit breakers
Installation
Using NuGet Package Manager
.csproj file:
Requirements
- .NET Standard 2.0 or higher
- .NET Core 3.1+ / .NET 5+ / .NET 6+ recommended
Quick Start
API Interfaces
The SDK is organized into API interfaces, each handling a specific domain:API Health
Monitor service health and availability.Methods
HealthControllerCheckV0Async()
Authenticated health check endpoint requiring API credentials.
Task<IHealthControllerCheckV0ApiResponse>
HealthControllerPublicHealthCheckV0Async()
Public health check endpoint (no authentication required).
Task<IHealthControllerPublicHealthCheckV0ApiResponse>
App Balances
Query your application’s stablecoin balances.Methods
BalanceControllerGetAllBalancesAsync()
Get all stablecoin balances for your application.
Task<IBalanceControllerGetAllBalancesApiResponse>
BalanceControllerGetUSDCBalanceAsync()
Get USDC balance only.
Task<IBalanceControllerGetUSDCBalanceApiResponse>
BalanceControllerGetEURCBalanceAsync()
Get EURC balance only.
Task<IBalanceControllerGetEURCBalanceApiResponse>
Customers
Manage customer records and KYC information.Methods
CustomerControllerCreateAsync(createCustomerDto)
Create a new customer.
createCustomerDto: CreateCustomerDto- Customer details
Task<ICustomerControllerCreateApiResponse>
CustomerControllerFindAllAsync(page, limit, status)
Get all customers with optional filters.
page: int?- Page number (optional, default: 1)limit: int?- Items per page (optional, default: 20)status: string?- Filter by status (optional)
Task<ICustomerControllerFindAllApiResponse>
CustomerControllerFindOneAsync(id)
Get a customer by ID.
id: string- Customer ID
Task<ICustomerControllerFindOneApiResponse>
CustomerControllerUpdateAsync(id, updateCustomerDto)
Update a customer’s information.
id: string- Customer IDupdateCustomerDto: UpdateCustomerDto- Fields to update
Task<ICustomerControllerUpdateApiResponse>
Exchange Rates
Get real-time currency exchange rates.Methods
ExchangeRateControllerGetExchangeRateAsync(from, to)
Get exchange rate between any two supported currencies.
varFrom: string?- Source currency codeto: string?- Target currency code
Task<IExchangeRateControllerGetExchangeRateApiResponse>
ExchangeRateControllerGetUSDToEURRateAsync()
Get USD to EUR exchange rate.
Task<IExchangeRateControllerGetUSDToEURRateApiResponse>
ExchangeRateControllerGetEURToUSDRateAsync()
Get EUR to USD exchange rate.
Task<IExchangeRateControllerGetEURToUSDRateApiResponse>
Invoices
Create and manage invoices for your customers.Methods
InvoiceControllerCreateAsync(createInvoiceDto)
Create a new invoice.
createInvoiceDto: CreateInvoiceDto- Invoice details
Task<IInvoiceControllerCreateApiResponse>
InvoiceControllerFindAllAsync(page, limit, status)
Get all invoices.
page: int?- Page number (optional)limit: int?- Items per page (optional)status: string?- Filter by status (optional)
Task<IInvoiceControllerFindAllApiResponse>
InvoiceControllerFindOneAsync(id)
Get an invoice by ID.
id: string- Invoice ID
Task<IInvoiceControllerFindOneApiResponse>
InvoiceControllerUpdateAsync(id, updateInvoiceDto)
Update an invoice.
id: string- Invoice IDupdateInvoiceDto: UpdateInvoiceDto- Fields to update
Task<IInvoiceControllerUpdateApiResponse>
Liquidation Addresses
Manage cryptocurrency liquidation addresses for customers.Methods
LiquidationAddressControllerCreateLiquidationAddressAsync(customerId, createLiquidationAddressDto)
Create a new liquidation address for a customer.
customerId: string- Customer IDcreateLiquidationAddressDto: CreateLiquidationAddressDto- Address details
Task<ILiquidationAddressControllerCreateLiquidationAddressApiResponse>
LiquidationAddressControllerGetLiquidationAddressesAsync(customerId)
Get all liquidation addresses for a customer.
customerId: string- Customer ID
Task<ILiquidationAddressControllerGetLiquidationAddressesApiResponse>
LiquidationAddressControllerGetLiquidationAddressAsync(customerId, liquidationAddressId)
Get a specific liquidation address.
customerId: string- Customer IDliquidationAddressId: string- Address ID
Task<ILiquidationAddressControllerGetLiquidationAddressApiResponse>
Payment Intents
Create payment intents for bank and stablecoin payments.Methods
PaymentIntentControllerCreateBankPaymentIntentAsync(createBankPaymentIntentDto)
Create a bank payment intent.
createBankPaymentIntentDto: CreateBankPaymentIntentDto- Intent details
Task<IPaymentIntentControllerCreateBankPaymentIntentApiResponse>
PaymentIntentControllerCreateStablePaymentIntentAsync(createStablePaymentIntentDto)
Create a stablecoin payment intent.
createStablePaymentIntentDto: CreateStablePaymentIntentDto- Intent details
Task<IPaymentIntentControllerCreateStablePaymentIntentApiResponse>
Payment Links
Generate and manage payment links for easy customer payments.Methods
PaymentLinksControllerCreateAsync(createPaymentLinkDto)
Create a new payment link.
createPaymentLinkDto: CreatePaymentLinkDto- Link details
Task<IPaymentLinksControllerCreateApiResponse>
PaymentLinksControllerFindAllAsync(page, limit, active)
Get all payment links.
page: int?- Page number (optional)limit: int?- Items per page (optional)active: bool?- Filter by active status (optional)
Task<IPaymentLinksControllerFindAllApiResponse>
PaymentLinksControllerFindOneAsync(id)
Get a payment link by ID.
id: string- Payment link ID
Task<IPaymentLinksControllerFindOneApiResponse>
PaymentLinksControllerUpdateAsync(id, updatePaymentLinkDto)
Update a payment link.
id: string- Payment link IDupdatePaymentLinkDto: UpdatePaymentLinkDto- Fields to update
Task<IPaymentLinksControllerUpdateApiResponse>
Transfers
Initiate and manage fund transfers between different payment rails.Methods
TransferControllerCreateDirectBankTransferAsync(createDirectBankTransferDto)
Create a direct bank transfer.
createDirectBankTransferDto: CreateDirectBankTransferDto- Transfer details
Task<ITransferControllerCreateDirectBankTransferApiResponse>
See also: Direct Bank Transfer Guide
TransferControllerCreateDirectWalletTransferAsync(createDirectWalletTransferDto)
Create a direct wallet transfer.
createDirectWalletTransferDto: CreateDirectWalletTransferDto- Transfer details
Task<ITransferControllerCreateDirectWalletTransferApiResponse>
See also: Direct Wallet Transfer Guide
TransferControllerCreateExternalBankTransferAsync(createExternalBankTransferDto)
Create an external bank transfer (from your wallet to external bank).
createExternalBankTransferDto: CreateExternalBankTransferDto- Transfer details
Task<ITransferControllerCreateExternalBankTransferApiResponse>
TransferControllerCreateExternalStablecoinTransferAsync(createExternalStablecoinTransferDto)
Create an external stablecoin transfer (from your wallet to external wallet).
createExternalStablecoinTransferDto: CreateExternalStablecoinTransferDto- Transfer details
Task<ITransferControllerCreateExternalStablecoinTransferApiResponse>
TransferControllerCreateStablecoinConversionAsync(createStablecoinConversionDto)
Convert between different stablecoins or networks.
createStablecoinConversionDto: CreateStablecoinConversionDto- Conversion details
Task<ITransferControllerCreateStablecoinConversionApiResponse>
See also: Stablecoin Conversion Guide
Wallets
Manage wallets and query balances.Methods
WalletControllerGetWalletsAsync()
Get all wallets for your application.
Task<IWalletControllerGetWalletsApiResponse>
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
WebhookControllerCreateAsync(createWebhookDto)
Create a new webhook.
createWebhookDto: CreateWebhookDto- Webhook configuration
Task<IWebhookControllerCreateApiResponse>
See also: Webhooks Overview
WebhookControllerFindAllAsync(page, limit, active)
Get all webhooks.
page: int?- Page number (optional)limit: int?- Items per page (optional)active: bool?- Filter by active status (optional)
Task<IWebhookControllerFindAllApiResponse>
WebhookControllerFindOneAsync(id)
Get a webhook by ID.
id: string- Webhook ID
Task<IWebhookControllerFindOneApiResponse>
WebhookControllerUpdateAsync(id, updateWebhookDto)
Update a webhook.
id: string- Webhook IDupdateWebhookDto: UpdateWebhookDto- Fields to update
Task<IWebhookControllerUpdateApiResponse>
WebhookControllerRemoveAsync(id)
Delete a webhook.
id: string- Webhook ID
Task<IWebhookControllerRemoveApiResponse>
Error Handling
All SDK methods return API response objects. Handle errors appropriately:Best Practices
1
Use Dependency Injection
Leverage .NET’s built-in DI container for better testability and maintainability.
2
Configure Resilience Policies
Use Polly policies for retry, timeout, and circuit breaker patterns.
3
Use Async/Await Properly
Always await async methods and don’t block on async code.
4
Handle Nullable Types
Use nullable reference types and check for null values.
5
Use Configuration for Credentials
Store credentials in appsettings.json or environment variables.
6
Implement Structured Logging
Use ILogger for structured logging.
Testing with xUnit
Example xUnit test for SDK integration:ASP.NET Core Integration
Example ASP.NET Core controller using the SDK: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
