Skip to main content

Prerequisites

  • .NET 6.0 or later
  • A Smartbills account with an API key
  • NuGet package manager (included with .NET SDK)

Install via NuGet

ASP.NET Core Integration

For ASP.NET Core applications, install the companion package for dependency injection support:

Configuration

Basic Configuration

Configuration Options

ASP.NET Core Dependency Injection

When using the Smartbills.SDK.AspNetCore package, register the client in your Program.cs or Startup.cs:
Then inject the client into your services:
You can also inject the top-level client:

Environment Configuration

Store your credentials securely using appsettings.json or environment variables:
appsettings.json
For environment-specific overrides:
appsettings.Development.json
Never commit API keys to source control. Use environment variables, user secrets, or a vault service for production deployments.

User Secrets (Development)

For local development, use the .NET user secrets manager:

Per-Request Options

Every method accepts an optional SBRequestOptions parameter to override default settings for individual requests:

Verifying Installation

Create a simple console application to verify the SDK is working:

Next Steps

Usage Guide

Learn how to use InvoiceClient, FileClient, and BillingClient