Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
86eb037
Update generated code for v1774 and 2025-05-28.preview
stripe-openapi[bot] May 30, 2025
4927faa
Update generated code for v1779 and 2025-05-28.preview
stripe-openapi[bot] Jun 2, 2025
2473d15
Update generated code for v1780 and 2025-05-28.preview
stripe-openapi[bot] Jun 3, 2025
d2706c0
Update generated code for v1782 and 2025-05-28.preview
stripe-openapi[bot] Jun 3, 2025
0aeb7b6
Update generated code for v1784 and 2025-05-28.preview
stripe-openapi[bot] Jun 4, 2025
922077b
Update generated code for v1785 and 2025-05-28.preview
stripe-openapi[bot] Jun 4, 2025
2607872
Update generated code for v1787 and 2025-05-28.preview
stripe-openapi[bot] Jun 4, 2025
d4d93ed
Update generated code for v1789 and 2025-05-28.preview
stripe-openapi[bot] Jun 6, 2025
7b8ac1a
Update generated code for v1791 and 2025-05-28.preview
stripe-openapi[bot] Jun 10, 2025
1491981
Update generated code for v1795 and 2025-05-28.preview
stripe-openapi[bot] Jun 12, 2025
0e404f7
Update generated code for v1796 and 2025-05-28.preview
stripe-openapi[bot] Jun 12, 2025
d19e281
Update generated code for v1796 and 2025-05-28.preview
stripe-openapi[bot] Jun 12, 2025
88210f0
Update generated code for v1797 and 2025-05-28.preview
stripe-openapi[bot] Jun 13, 2025
d91bfbd
Update generated code for v1799 and 2025-05-28.preview
stripe-openapi[bot] Jun 16, 2025
23bdf71
Update generated code for v1800 and 2025-05-28.preview
stripe-openapi[bot] Jun 17, 2025
c3f4d1d
Update generated code for v1800 and 2025-05-28.preview
stripe-openapi[bot] Jun 17, 2025
9b8c3e7
Update generated code for v1801 and 2025-05-28.preview
stripe-openapi[bot] Jun 17, 2025
423810f
Update generated code for v1803 and 2025-05-28.preview
stripe-openapi[bot] Jun 18, 2025
257ac20
Update generated code for v1806 and 2025-05-28.preview
stripe-openapi[bot] Jun 18, 2025
fc4d40e
Update generated code for v1806 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
3f1272f
Update generated code for v1807 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
f5007c7
Update generated code for v1808 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
b380166
Update generated code for v1809 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
8861383
Update generated code for v1811 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
2487f34
Update generated code for v1812 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
31e4ed5
Update generated code for v1813 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
fe4039d
Update generated code for v1814 and 2025-06-30.preview
stripe-openapi[bot] Jun 19, 2025
4673174
Update generated code for v1815 and 2025-06-30.preview
stripe-openapi[bot] Jun 20, 2025
68fd40f
Update generated code for v1816 and 2025-06-30.preview
stripe-openapi[bot] Jun 20, 2025
4a510b5
Update generated code for v1817 and 2025-06-30.preview
stripe-openapi[bot] Jun 20, 2025
3b1b1a3
Update generated code for v1818 and 2025-06-30.preview
stripe-openapi[bot] Jun 23, 2025
f5af593
Update generated code for v1819 and 2025-06-30.preview
stripe-openapi[bot] Jun 23, 2025
3687bb8
Update generated code for v1819 and 2025-06-30.preview
stripe-openapi[bot] Jun 23, 2025
755b804
Updated stripeclient snippets in Readme.md (#3137)
prathmesh-stripe Jun 23, 2025
feb72da
Merge upstream and update generated code for v1819 and 2025-06-30.pre…
stripe-openapi[bot] Jun 23, 2025
5d80daf
Update generated code for v1819 and 2025-06-30.preview
stripe-openapi[bot] Jun 24, 2025
0c54b7c
Link to the /changelog page instead of /upgrades (#3141)
ramya-stripe Jun 25, 2025
77f9791
Merge upstream and update generated code for v1819 and 2025-06-30.pre…
stripe-openapi[bot] Jun 26, 2025
0144a35
Update generated code for v1819 and 2025-06-30.preview
stripe-openapi[bot] Jun 26, 2025
680b3d8
Merge branch 'beta' into latest-codegen-beta
prathmesh-stripe Jun 30, 2025
31e6db8
Fixed test
prathmesh-stripe Jun 30, 2025
3b5d1cb
Update generated code for v1819 and 2025-06-30.preview
stripe-openapi[bot] Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions API_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-06-30.preview
105 changes: 53 additions & 52 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1773
v1819
58 changes: 37 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,31 @@ how to use the library.

## Usage

### Authentication
### Using StripeClient

Stripe authenticates API requests using your account’s secret key, which you can find in the Stripe Dashboard. By default, secret keys can be used to perform any API request without restriction.
In version 46 of the Stripe .NET SDK, we have enhanced the `StripeClient` class to be the entry point to access all services that had to be previously independently instantiated with global configuration. This improves discoverability during IDE auto-completion and creates a more intuitive developer experience for you.

Use `StripeConfiguration.ApiKey` property to set the secret key.
Each client instantiation can have its own configuration so you can access Stripe API with different API keys or different configuration (like number of retries) on a per client basis and without changing a global configuration.

```C#
// StripeClient pattern (Recommended)
var client = new StripeClient("sk_test_...");
Customer customer = client.V1.Customers.Get("cus_1234");

// Global Configuration pattern (Legacy)
StripeConfiguration.ApiKey = "sk_test_...";
var service = new CustomerService();
Customer customer = service.Get("cus_1234");
```

The previous global configuration pattern will continue to be supported.

### Authentication

Stripe authenticates API requests using your account’s secret key, which you can find in the Stripe Dashboard. By default, secret keys can be used to perform any API request without restriction.

```C#
var client = new StripeClient("sk_test_...");
```

### Creating a resource
Expand All @@ -63,8 +80,8 @@ var options = new CustomerCreateOptions
Email = "customer@example.com"
};

var service = new CustomerService();
Customer customer = service.Create(options);
var client = new StripeClient("sk_test_...");
Customer customer = client.V1.Customers.Create(options);

// Newly created customer is returned
Console.WriteLine(customer.Email);
Expand All @@ -75,8 +92,8 @@ Console.WriteLine(customer.Email);
The `Retrieve` method of the service class can be used to retrieve a resource:

```C#
var service = new CustomerService();
Customer customer = service.Get("cus_1234");
var client = new StripeClient("sk_test_...");
Customer customer = client.V1.Customers.Get("cus_1234");

Console.WriteLine(customer.Email);
```
Expand All @@ -91,8 +108,8 @@ var options = new CustomerUpdateOptions
Email = "updated-email@example.com"
};

var service = new CustomerService();
Customer customer = service.Update("cus_123", options);
var client = new StripeClient("sk_test_...");
Customer customer = client.V1.Customers.Update("cus_123", options);

// The updated customer is returned
Console.WriteLine(customer.Email);
Expand All @@ -103,8 +120,8 @@ Console.WriteLine(customer.Email);
The `Delete` method of the service class can be used to delete a resource:

```C#
var service = new CustomerService();
Customer customer = service.Delete("cus_123", options);
var client = new StripeClient("sk_test_...");
Customer customer = client.V1.Customers.Delete("cus_123", options);
```

### Listing a resource
Expand All @@ -115,8 +132,8 @@ The `List` method on the service class can be used to list resources page-by-pag
> The `List` method returns only a single page, you have to manually continue the iteration using the `StartingAfter` parameter.

```C#
var service = new CustomerService();
var customers = service.List();
var client = new StripeClient("sk_test_...");
var customers = client.V1.Customers.List();

string lastId = null;

Expand Down Expand Up @@ -145,8 +162,8 @@ foreach (Customer customer in customers)
The `ListAutoPaging` method on the service class can be used to automatically iterate over all pages.

```C#
var service = new CustomerService();
var customers = service.ListAutoPaging();
var client = new StripeClient("sk_test_...");
var customers = client.V1.Customers.ListAutoPaging();

// Enumerate all pages of the list
foreach (Customer customer in customers)
Expand All @@ -157,7 +174,7 @@ foreach (Customer customer in customers)

### Per-request configuration

All of the service methods accept an optional `RequestOptions` object. This is
All the service methods accept an optional `RequestOptions` object. This is
used if you want to set an [idempotency key][idempotency-keys], if you are
using [Stripe Connect][connect-auth], or if you want to pass the secret API
key on each method.
Expand Down Expand Up @@ -216,22 +233,21 @@ options.AddExtraParam("secret_feature_enabled", "true");
options.AddExtraParam("secret_parameter[primary]", "primary value");
options.AddExtraParam("secret_parameter[secondary]", "secondary value");

var service = new CustomerService();
var customer = service.Create(options);
var client = new StripeClient("sk_test_...");
var customer = client.V1.Customers.Create(options);
```

#### Properties

To retrieve undocumented properties from Stripe using C# you can use an option in the library to return the raw JSON object and return the property. An example of this is shown below:

```c#
var service = new CustomerService();
var customer = service.Get("cus_1234");
var client = new StripeClient("sk_test_...");
var customer = client.V1.Customers.Get("cus_1234");

customer.RawJObject["secret_feature_enabled"];
customer.RawJObject["secret_parameter"]["primary"];
customer.RawJObject["secret_parameter"]["secondary"];

```

This is only supported on objects returned directly from the Stripe.net SDK. If you are serializing Stripe objects to JSON you will need to handle undocumented properties separately.
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Constants/ApiVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ namespace Stripe
{
internal class ApiVersion
{
public const string Current = "2025-05-28.preview";
public const string Current = "2025-06-30.preview";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace Stripe
public class AccountSessionComponentsAccountManagementFeatures : StripeEntity<AccountSessionComponentsAccountManagementFeatures>
{
/// <summary>
/// Disables Stripe user authentication for this embedded component. This value can only be
/// true for accounts where <c>controller.requirement_collection</c> is <c>application</c>.
/// The default value is the opposite of the <c>external_account_collection</c> value. For
/// example, if you dont set <c>external_account_collection</c>, it defaults to true and
/// <c>disable_stripe_user_authentication</c> defaults to false.
/// Whether Stripe user authentication is disabled. This value can only be <c>true</c> for
/// accounts where <c>controller.requirement_collection</c> is <c>application</c> for the
/// account. The default value is the opposite of the <c>external_account_collection</c>
/// value. For example, if you don't set <c>external_account_collection</c>, it defaults to
/// <c>true</c> and <c>disable_stripe_user_authentication</c> defaults to <c>false</c>.
/// </summary>
[JsonProperty("disable_stripe_user_authentication")]
#if NET6_0_OR_GREATER
Expand All @@ -22,11 +22,10 @@ public class AccountSessionComponentsAccountManagementFeatures : StripeEntity<Ac
public bool DisableStripeUserAuthentication { get; set; }

/// <summary>
/// Whether to allow platforms to control bank account collection for their connected
/// accounts. This feature can only be false for accounts where you’re responsible for
/// collecting updated information when requirements are due or change, like custom
/// accounts. Otherwise, bank account collection is determined by compliance requirements.
/// The default value for this feature is <c>true</c>.
/// Whether external account collection is enabled. This feature can only be <c>false</c>
/// for accounts where you’re responsible for collecting updated information when
/// requirements are due or change, like Custom accounts. The default value for this feature
/// is <c>true</c>.
/// </summary>
[JsonProperty("external_account_collection")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace Stripe
public class AccountSessionComponentsAccountOnboardingFeatures : StripeEntity<AccountSessionComponentsAccountOnboardingFeatures>
{
/// <summary>
/// Disables Stripe user authentication for this embedded component. This value can only be
/// true for accounts where <c>controller.requirement_collection</c> is <c>application</c>.
/// The default value is the opposite of the <c>external_account_collection</c> value. For
/// example, if you dont set <c>external_account_collection</c>, it defaults to true and
/// <c>disable_stripe_user_authentication</c> defaults to false.
/// Whether Stripe user authentication is disabled. This value can only be <c>true</c> for
/// accounts where <c>controller.requirement_collection</c> is <c>application</c> for the
/// account. The default value is the opposite of the <c>external_account_collection</c>
/// value. For example, if you don't set <c>external_account_collection</c>, it defaults to
/// <c>true</c> and <c>disable_stripe_user_authentication</c> defaults to <c>false</c>.
/// </summary>
[JsonProperty("disable_stripe_user_authentication")]
#if NET6_0_OR_GREATER
Expand All @@ -22,11 +22,10 @@ public class AccountSessionComponentsAccountOnboardingFeatures : StripeEntity<Ac
public bool DisableStripeUserAuthentication { get; set; }

/// <summary>
/// Whether to allow platforms to control bank account collection for their connected
/// accounts. This feature can only be false for accounts where you’re responsible for
/// collecting updated information when requirements are due or change, like custom
/// accounts. Otherwise, bank account collection is determined by compliance requirements.
/// The default value for this feature is <c>true</c>.
/// Whether external account collection is enabled. This feature can only be <c>false</c>
/// for accounts where you’re responsible for collecting updated information when
/// requirements are due or change, like Custom accounts. The default value for this feature
/// is <c>true</c>.
/// </summary>
[JsonProperty("external_account_collection")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace Stripe
public class AccountSessionComponentsBalancesFeatures : StripeEntity<AccountSessionComponentsBalancesFeatures>
{
/// <summary>
/// Disables Stripe user authentication for this embedded component. This value can only be
/// true for accounts where <c>controller.requirement_collection</c> is <c>application</c>.
/// The default value is the opposite of the <c>external_account_collection</c> value. For
/// example, if you dont set <c>external_account_collection</c>, it defaults to true and
/// <c>disable_stripe_user_authentication</c> defaults to false.
/// Whether Stripe user authentication is disabled. This value can only be <c>true</c> for
/// accounts where <c>controller.requirement_collection</c> is <c>application</c> for the
/// account. The default value is the opposite of the <c>external_account_collection</c>
/// value. For example, if you don't set <c>external_account_collection</c>, it defaults to
/// <c>true</c> and <c>disable_stripe_user_authentication</c> defaults to <c>false</c>.
/// </summary>
[JsonProperty("disable_stripe_user_authentication")]
#if NET6_0_OR_GREATER
Expand All @@ -22,8 +22,9 @@ public class AccountSessionComponentsBalancesFeatures : StripeEntity<AccountSess
public bool DisableStripeUserAuthentication { get; set; }

/// <summary>
/// Whether to allow payout schedule to be changed. Default <c>true</c> when Stripe owns
/// Loss Liability, default <c>false</c> otherwise.
/// Whether to allow payout schedule to be changed. Defaults to <c>true</c> when
/// <c>controller.losses.payments</c> is set to <c>stripe</c> for the account, otherwise
/// <c>false</c>.
/// </summary>
[JsonProperty("edit_payout_schedule")]
#if NET6_0_OR_GREATER
Expand All @@ -32,11 +33,10 @@ public class AccountSessionComponentsBalancesFeatures : StripeEntity<AccountSess
public bool EditPayoutSchedule { get; set; }

/// <summary>
/// Whether to allow platforms to control bank account collection for their connected
/// accounts. This feature can only be false for accounts where you’re responsible for
/// collecting updated information when requirements are due or change, like custom
/// accounts. Otherwise, bank account collection is determined by compliance requirements.
/// The default value for this feature is <c>true</c>.
/// Whether external account collection is enabled. This feature can only be <c>false</c>
/// for accounts where you’re responsible for collecting updated information when
/// requirements are due or change, like Custom accounts. The default value for this feature
/// is <c>true</c>.
/// </summary>
[JsonProperty("external_account_collection")]
#if NET6_0_OR_GREATER
Expand All @@ -45,8 +45,9 @@ public class AccountSessionComponentsBalancesFeatures : StripeEntity<AccountSess
public bool ExternalAccountCollection { get; set; }

/// <summary>
/// Whether to allow creation of instant payouts. Default <c>true</c> when Stripe owns Loss
/// Liability, default <c>false</c> otherwise.
/// Whether to allow creation of instant payouts. Defaults to <c>true</c> when
/// <c>controller.losses.payments</c> is set to <c>stripe</c> for the account, otherwise
/// <c>false</c>.
/// </summary>
[JsonProperty("instant_payouts")]
#if NET6_0_OR_GREATER
Expand All @@ -55,8 +56,9 @@ public class AccountSessionComponentsBalancesFeatures : StripeEntity<AccountSess
public bool InstantPayouts { get; set; }

/// <summary>
/// Whether to allow creation of standard payouts. Default <c>true</c> when Stripe owns Loss
/// Liability, default <c>false</c> otherwise.
/// Whether to allow creation of standard payouts. Defaults to <c>true</c> when
/// <c>controller.losses.payments</c> is set to <c>stripe</c> for the account, otherwise
/// <c>false</c>.
/// </summary>
[JsonProperty("standard_payouts")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class AccountSessionComponentsDisputesListFeatures : StripeEntity<Account
public bool CapturePayments { get; set; }

/// <summary>
/// Whether to allow connected accounts to manage destination charges that are created on
/// behalf of them. This is <c>false</c> by default.
/// Whether connected accounts can manage destination charges that are created on behalf of
/// them. This is <c>false</c> by default.
/// </summary>
[JsonProperty("destination_on_behalf_of_charge_management")]
#if NET6_0_OR_GREATER
Expand All @@ -29,7 +29,7 @@ public class AccountSessionComponentsDisputesListFeatures : StripeEntity<Account
public bool DestinationOnBehalfOfChargeManagement { get; set; }

/// <summary>
/// Whether to allow responding to disputes, including submitting evidence and accepting
/// Whether responding to disputes is enabled, including submitting evidence and accepting
/// disputes. This is <c>true</c> by default.
/// </summary>
[JsonProperty("dispute_management")]
Expand All @@ -39,7 +39,7 @@ public class AccountSessionComponentsDisputesListFeatures : StripeEntity<Account
public bool DisputeManagement { get; set; }

/// <summary>
/// Whether to allow sending refunds. This is <c>true</c> by default.
/// Whether sending refunds is enabled. This is <c>true</c> by default.
/// </summary>
[JsonProperty("refund_management")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace Stripe
public class AccountSessionComponentsFinancialAccountFeatures : StripeEntity<AccountSessionComponentsFinancialAccountFeatures>
{
/// <summary>
/// Disables Stripe user authentication for this embedded component. This value can only be
/// true for accounts where <c>controller.requirement_collection</c> is <c>application</c>.
/// The default value is the opposite of the <c>external_account_collection</c> value. For
/// example, if you dont set <c>external_account_collection</c>, it defaults to true and
/// <c>disable_stripe_user_authentication</c> defaults to false.
/// Whether Stripe user authentication is disabled. This value can only be <c>true</c> for
/// accounts where <c>controller.requirement_collection</c> is <c>application</c> for the
/// account. The default value is the opposite of the <c>external_account_collection</c>
/// value. For example, if you don't set <c>external_account_collection</c>, it defaults to
/// <c>true</c> and <c>disable_stripe_user_authentication</c> defaults to <c>false</c>.
/// </summary>
[JsonProperty("disable_stripe_user_authentication")]
#if NET6_0_OR_GREATER
Expand All @@ -22,7 +22,10 @@ public class AccountSessionComponentsFinancialAccountFeatures : StripeEntity<Acc
public bool DisableStripeUserAuthentication { get; set; }

/// <summary>
/// Whether to allow external accounts to be linked for money transfer.
/// Whether external account collection is enabled. This feature can only be <c>false</c>
/// for accounts where you’re responsible for collecting updated information when
/// requirements are due or change, like Custom accounts. The default value for this feature
/// is <c>true</c>.
/// </summary>
[JsonProperty("external_account_collection")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ public class AccountSessionComponentsIssuingCardsListFeatures : StripeEntity<Acc
public bool CardholderManagement { get; set; }

/// <summary>
/// Disables Stripe user authentication for this embedded component. This feature can only
/// be false for accounts where you’re responsible for collecting updated information when
/// requirements are due or change, like custom accounts.
/// Whether Stripe user authentication is disabled. This value can only be <c>true</c> for
/// accounts where <c>controller.requirement_collection</c> is <c>application</c> for the
/// account. The default value is the opposite of the <c>external_account_collection</c>
/// value. For example, if you don't set <c>external_account_collection</c>, it defaults to
/// <c>true</c> and <c>disable_stripe_user_authentication</c> defaults to <c>false</c>.
/// </summary>
[JsonProperty("disable_stripe_user_authentication")]
#if NET6_0_OR_GREATER
Expand Down
Loading
Loading