Skip to main content

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

Or via Package Manager Console:
Or add to your .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.
Returns: Task<IHealthControllerCheckV0ApiResponse>

HealthControllerPublicHealthCheckV0Async()

Public health check endpoint (no authentication required).
Returns: Task<IHealthControllerPublicHealthCheckV0ApiResponse>

App Balances

Query your application’s stablecoin balances.

Methods

BalanceControllerGetAllBalancesAsync()

Get all stablecoin balances for your application.
Returns: Task<IBalanceControllerGetAllBalancesApiResponse>

BalanceControllerGetUSDCBalanceAsync()

Get USDC balance only.
Returns: Task<IBalanceControllerGetUSDCBalanceApiResponse>

BalanceControllerGetEURCBalanceAsync()

Get EURC balance only.
Returns: Task<IBalanceControllerGetEURCBalanceApiResponse>

Customers

Manage customer records and KYC information.

Methods

CustomerControllerCreateAsync(createCustomerDto)

Create a new customer.
Parameters:
  • createCustomerDto: CreateCustomerDto - Customer details
Returns: Task<ICustomerControllerCreateApiResponse>

CustomerControllerFindAllAsync(page, limit, status)

Get all customers with optional filters.
Parameters:
  • page: int? - Page number (optional, default: 1)
  • limit: int? - Items per page (optional, default: 20)
  • status: string? - Filter by status (optional)
Returns: Task<ICustomerControllerFindAllApiResponse>

CustomerControllerFindOneAsync(id)

Get a customer by ID.
Parameters:
  • id: string - Customer ID
Returns: Task<ICustomerControllerFindOneApiResponse>

CustomerControllerUpdateAsync(id, updateCustomerDto)

Update a customer’s information.
Parameters:
  • id: string - Customer ID
  • updateCustomerDto: UpdateCustomerDto - Fields to update
Returns: Task<ICustomerControllerUpdateApiResponse>

Exchange Rates

Get real-time currency exchange rates.

Methods

ExchangeRateControllerGetExchangeRateAsync(from, to)

Get exchange rate between any two supported currencies.
Parameters:
  • varFrom: string? - Source currency code
  • to: string? - Target currency code
Returns: Task<IExchangeRateControllerGetExchangeRateApiResponse>

ExchangeRateControllerGetUSDToEURRateAsync()

Get USD to EUR exchange rate.
Returns: Task<IExchangeRateControllerGetUSDToEURRateApiResponse>

ExchangeRateControllerGetEURToUSDRateAsync()

Get EUR to USD exchange rate.
Returns: Task<IExchangeRateControllerGetEURToUSDRateApiResponse>

Invoices

Create and manage invoices for your customers.

Methods

InvoiceControllerCreateAsync(createInvoiceDto)

Create a new invoice.
Parameters:
  • createInvoiceDto: CreateInvoiceDto - Invoice details
Returns: Task<IInvoiceControllerCreateApiResponse>

InvoiceControllerFindAllAsync(page, limit, status)

Get all invoices.
Parameters:
  • page: int? - Page number (optional)
  • limit: int? - Items per page (optional)
  • status: string? - Filter by status (optional)
Returns: Task<IInvoiceControllerFindAllApiResponse>

InvoiceControllerFindOneAsync(id)

Get an invoice by ID.
Parameters:
  • id: string - Invoice ID
Returns: Task<IInvoiceControllerFindOneApiResponse>

InvoiceControllerUpdateAsync(id, updateInvoiceDto)

Update an invoice.
Parameters:
  • id: string - Invoice ID
  • updateInvoiceDto: UpdateInvoiceDto - Fields to update
Returns: Task<IInvoiceControllerUpdateApiResponse>

Liquidation Addresses

Manage cryptocurrency liquidation addresses for customers.

Methods

LiquidationAddressControllerCreateLiquidationAddressAsync(customerId, createLiquidationAddressDto)

Create a new liquidation address for a customer.
Parameters:
  • customerId: string - Customer ID
  • createLiquidationAddressDto: CreateLiquidationAddressDto - Address details
Returns: Task<ILiquidationAddressControllerCreateLiquidationAddressApiResponse>

LiquidationAddressControllerGetLiquidationAddressesAsync(customerId)

Get all liquidation addresses for a customer.
Parameters:
  • customerId: string - Customer ID
Returns: Task<ILiquidationAddressControllerGetLiquidationAddressesApiResponse>

LiquidationAddressControllerGetLiquidationAddressAsync(customerId, liquidationAddressId)

Get a specific liquidation address.
Parameters:
  • customerId: string - Customer ID
  • liquidationAddressId: string - Address ID
Returns: Task<ILiquidationAddressControllerGetLiquidationAddressApiResponse>

Payment Intents

Create payment intents for bank and stablecoin payments.

Methods

PaymentIntentControllerCreateBankPaymentIntentAsync(createBankPaymentIntentDto)

Create a bank payment intent.
Parameters:
  • createBankPaymentIntentDto: CreateBankPaymentIntentDto - Intent details
Returns: Task<IPaymentIntentControllerCreateBankPaymentIntentApiResponse>

PaymentIntentControllerCreateStablePaymentIntentAsync(createStablePaymentIntentDto)

Create a stablecoin payment intent.
Parameters:
  • createStablePaymentIntentDto: CreateStablePaymentIntentDto - Intent details
Returns: Task<IPaymentIntentControllerCreateStablePaymentIntentApiResponse>
Generate and manage payment links for easy customer payments.

Methods

PaymentLinksControllerCreateAsync(createPaymentLinkDto)

Create a new payment link.
Parameters:
  • createPaymentLinkDto: CreatePaymentLinkDto - Link details
Returns: Task<IPaymentLinksControllerCreateApiResponse>

PaymentLinksControllerFindAllAsync(page, limit, active)

Get all payment links.
Parameters:
  • page: int? - Page number (optional)
  • limit: int? - Items per page (optional)
  • active: bool? - Filter by active status (optional)
Returns: Task<IPaymentLinksControllerFindAllApiResponse>

PaymentLinksControllerFindOneAsync(id)

Get a payment link by ID.
Parameters:
  • id: string - Payment link ID
Returns: Task<IPaymentLinksControllerFindOneApiResponse>

PaymentLinksControllerUpdateAsync(id, updatePaymentLinkDto)

Update a payment link.
Parameters:
  • id: string - Payment link ID
  • updatePaymentLinkDto: UpdatePaymentLinkDto - Fields to update
Returns: Task<IPaymentLinksControllerUpdateApiResponse>

Transfers

Initiate and manage fund transfers between different payment rails.

Methods

TransferControllerCreateDirectBankTransferAsync(createDirectBankTransferDto)

Create a direct bank transfer.
Parameters:
  • createDirectBankTransferDto: CreateDirectBankTransferDto - Transfer details
Returns: Task<ITransferControllerCreateDirectBankTransferApiResponse> See also: Direct Bank Transfer Guide

TransferControllerCreateDirectWalletTransferAsync(createDirectWalletTransferDto)

Create a direct wallet transfer.
Parameters:
  • createDirectWalletTransferDto: CreateDirectWalletTransferDto - Transfer details
Returns: Task<ITransferControllerCreateDirectWalletTransferApiResponse> See also: Direct Wallet Transfer Guide

TransferControllerCreateExternalBankTransferAsync(createExternalBankTransferDto)

Create an external bank transfer (from your wallet to external bank).
Parameters:
  • createExternalBankTransferDto: CreateExternalBankTransferDto - Transfer details
Returns: Task<ITransferControllerCreateExternalBankTransferApiResponse>

TransferControllerCreateExternalStablecoinTransferAsync(createExternalStablecoinTransferDto)

Create an external stablecoin transfer (from your wallet to external wallet).
Parameters:
  • createExternalStablecoinTransferDto: CreateExternalStablecoinTransferDto - Transfer details
Returns: Task<ITransferControllerCreateExternalStablecoinTransferApiResponse>

TransferControllerCreateStablecoinConversionAsync(createStablecoinConversionDto)

Convert between different stablecoins or networks.
Parameters:
  • createStablecoinConversionDto: CreateStablecoinConversionDto - Conversion details
Returns: Task<ITransferControllerCreateStablecoinConversionApiResponse> See also: Stablecoin Conversion Guide

Wallets

Manage wallets and query balances.

Methods

WalletControllerGetWalletsAsync()

Get all wallets for your application.
Returns: 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.
Parameters:
  • createWebhookDto: CreateWebhookDto - Webhook configuration
Returns: Task<IWebhookControllerCreateApiResponse> See also: Webhooks Overview

WebhookControllerFindAllAsync(page, limit, active)

Get all webhooks.
Parameters:
  • page: int? - Page number (optional)
  • limit: int? - Items per page (optional)
  • active: bool? - Filter by active status (optional)
Returns: Task<IWebhookControllerFindAllApiResponse>

WebhookControllerFindOneAsync(id)

Get a webhook by ID.
Parameters:
  • id: string - Webhook ID
Returns: Task<IWebhookControllerFindOneApiResponse>

WebhookControllerUpdateAsync(id, updateWebhookDto)

Update a webhook.
Parameters:
  • id: string - Webhook ID
  • updateWebhookDto: UpdateWebhookDto - Fields to update
Returns: Task<IWebhookControllerUpdateApiResponse>

WebhookControllerRemoveAsync(id)

Delete a webhook.
Parameters:
  • id: string - Webhook ID
Returns: 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