CLI tool
stripe/stripe-dotnet avatar
stripe/stripe-dotnet

Stripe.net for .NET: Client Architecture, Installation, and Limits

Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com.

1,531 stars598 forksC#Apache-2.0

At a glance

What is it?
Stripe.net is Stripe's official .NET client for authenticated resource operations across supported .NET runtimes. It offers synchronous and asynchronous services, per-client configuration, pagination, retries, and customization through HttpClient, but its README leaves several operational details implicit.
Who is it for?
Adopt Stripe.net when a .NET application needs Stripe API access with typed resources, per-client configuration, and built-in pagination or retries. Do not choose it when a direct HTTP client is preferable or when the application requires undocumented behavior outside the published package.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Stripe.net Solves for .NET Applications

Stripe.net is the official client library for accessing Stripe's API from .NET. It targets developers building payment, customer, subscription, and other Stripe-backed workflows in applications that use .NET Standard 2.0+, .NET Core 8+, or .NET Framework 4.6.2+. The repository describes the package as both synchronous and asynchronous, so callers can choose the programming model appropriate to their application rather than depend on a single request style.

The library wraps Stripe resources as typed C# objects and exposes operations such as creating, retrieving, updating, deleting, and listing resources. That matters for applications that want the structure of Stripe's API represented directly in code instead of manually assembling HTTP requests, parsing JSON, and mapping response fields. Authentication also belongs to the client library, with a secret API key supplied either when constructing a client or through legacy global configuration.

The intended user is a .NET developer who already has a Stripe account and needs an API secret. Stripe.net does not replace the Stripe Dashboard, account provisioning, API policy, or backend reconciliation. It is a client for the API, not a payment dashboard or an operational administration system.

StripeClient Services and Per-Client Configuration

The README recommends the StripeClient pattern introduced in version 46 of the SDK as the entry point for services. A client exposes versioned service groups through a property path such as `client.V1.Customers`. This gives the application one object from which it can discover and call resource services, and it removes the need to create each service while relying on global configuration.

Each StripeClient instance can have its own configuration. That includes its API key and settings such as the number of retries. This is a meaningful distinction from the older pattern, where code assigns a key to `StripeConfiguration.ApiKey` and creates a service separately. The newer arrangement is better suited to applications that need multiple Stripe accounts, test and production credentials, or different retry policies within one process. The README says the legacy global configuration pattern remains supported, but it labels that approach as legacy.

The visible call path is straightforward. The application constructs a StripeClient, selects a service such as Customers, passes typed options when creating or updating a resource, and receives a typed resource object. Resource methods also accept an optional RequestOptions object. The documented fields include an API key, an idempotency key, and a Stripe Connect account identifier, which lets a caller control request-specific authentication and account context.

Installing Stripe.net and Making a Customer Call

The package is distributed through NuGet. The README provides several installation paths, including the .NET CLI, the NuGet CLI, and the Visual Studio Package Manager Console. The .NET CLI command is the shortest path for a command-line-based project:

bash
dotnet add package Stripe.net

This adds the `Stripe.net` package reference to the current project. The project must then use a supported target framework. The README states that the current support policy covers .NET Standard 2.0+, LTS versions of .NET Core 8+, and .NET Framework 4.6.2+. For Visual Studio users, the documented route is Manage NuGet Packages, Browse, search for "Stripe.net", select a version, and install it. The repository does not provide a separate application template or a required environment file.

A first API call can create a customer in a test environment. The following example uses a test secret key, creates typed options, and prints the returned email address:

csharp
var options = new CustomerCreateOptions
{
    Email = "[email protected]"
};

var client = new StripeClient("sk_test_...");
Customer customer = client.V1.Customers.Create(options);
Console.WriteLine(customer.Email);

The created customer is returned by the API and assigned to `customer`. A production application should not place a live secret key in source control. The README identifies the secret key as the authentication mechanism but does not prescribe a secret-management library.

Pagination, Idempotency, Retries, and HttpClient Control

Stripe.net supports two pagination styles. `List` returns one page, and the caller must continue with `StartingAfter`. The README's listing example tracks the last customer ID and passes it into `CustomerListOptions`. `ListAutoPaging` instead enumerates across pages automatically. For bulk imports, reports, and cleanup jobs, this distinction affects both control flow and memory use. Automatic iteration is simpler, while explicit paging gives the application direct control over when and how far it proceeds.

The README also documents automatic retries for connection errors, timeouts, and selected responses such as HTTP `409 Conflict`. It states that two retries are performed by default and that the number can be configured. Idempotency keys are added to requests to make retries safe. The exact retry configuration key is not included in the README, so an adopter should confirm the current option and defaults in the package documentation or source before relying on a particular retry count.

Applications that need a proxy, custom message handler, or another specialized HTTP setup can provide their own `HttpClient` through the documented `SystemNetHttpClient` wrapper. This is an extension point for transport behavior, but the README does not claim that arbitrary middleware is supported.

Where Stripe.net Is the Wrong Choice

Stripe.net is not the right abstraction for a program that only needs an occasional Stripe request and does not otherwise use .NET. A direct HTTPS request can avoid adding a typed SDK dependency, at the cost of manually handling authentication, JSON, status codes, retries, idempotency, and response mapping. That alternative has a different approach: it keeps HTTP and API details in application code, while Stripe.net centralizes those concerns behind services and resource types. The choice depends on dependency size, local conventions, and how much Stripe-specific behavior the application needs.

There are also operational boundaries in the documentation. The README does not explain rollback, version compatibility guarantees for every Stripe API resource, or a detailed policy for upgrading generated models. The repository includes `CHANGELOG.md`, `VERSION`, `OPENAPI_VERSION`, and code-generation files, but those names alone do not establish a migration procedure or promise of automatic migration.

One README example for manual pagination declares `var customers = client.V1.Customers.List();` but later calls `service.List(...)`. The surrounding text establishes the intended `StartingAfter` mechanism, yet the variable name is inconsistent with the recommended client pattern. That example should be treated as documentation that needs correction or verification, not copied unchanged.

Maintenance, License, and Upgrade Boundaries

The repository is not archived, and its last push was on 2026-10-16. The listed recent releases include `v53.1.0-alpha.3` on 2026-10-14, `v53.1.0-alpha.2` on 2026-10-08, and `v53.1.0-beta.1` on 2026-10-01. Alpha and beta labels mean that a production adoption should check the release channel and migration notes before selecting a package version. The repository's `Makefile` marks itself deprecated and directs contributors to equivalent `just` commands, while the `justfile` exposes formatting, test, installation, and target-framework discovery tasks.

The project is licensed under Apache-2.0. That license governs the library's source and distribution terms. This review does not interpret legal obligations or assess how a particular application, commercial product, or deployment model interacts with the license.

An upgrade may affect more than the package version because the repository contains code-generation inputs and version files such as `CODEGEN_VERSION` and `OPENAPI_VERSION`. The README does not document whether generated types change without notice between releases, so version pinning and review of `CHANGELOG.md` are concrete checks for teams considering an upgrade.

Editorial conclusion

Adopt Stripe.net when a .NET application needs Stripe API access with typed resources, per-client configuration, and built-in pagination or retries. Do not choose it when a direct HTTP client is preferable or when the application requires undocumented behavior outside the published package. Verify the target runtime, package version, authentication model, retry settings, and exact service methods before adoption. The README recommends StripeClient for new code, so that is the first implementation detail to confirm.

Frequently asked questions

How do I install Stripe.net in a .NET project?

Run `dotnet add package Stripe.net` from the project directory. The README also documents `nuget install Stripe.net` and installation through the Visual Studio Package Manager Console.

Which .NET versions does Stripe.net support?

The README states support for .NET Standard 2.0+, LTS versions of .NET Core 8+, and .NET Framework 4.6.2+. The applicable target framework should match one of those support categories.

How do I create and retrieve a Stripe customer with Stripe.net?

Construct a `StripeClient` with a secret key, then call `client.V1.Customers.Create(options)` or `client.V1.Customers.Get("cus_1234")`. The README presents `StripeClient` as the recommended pattern.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. Releases
  5. stripe/stripe-dotnet on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/stripe-stripe-dotnet.svg)](https://hysenlabs.com/projects/stripe-stripe-dotnet)

Was this useful?