Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2025
v2026
12 changes: 11 additions & 1 deletion src/Stripe.net/Entities/Invoices/InvoiceParent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ namespace Stripe

public class InvoiceParent : StripeEntity<InvoiceParent>
{
/// <summary>
/// Details about the billing cadence that generated this invoice.
/// </summary>
[JsonProperty("billing_cadence_details")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("billing_cadence_details")]
#endif
public InvoiceParentBillingCadenceDetails BillingCadenceDetails { get; set; }

/// <summary>
/// Details about the quote that generated this invoice.
/// </summary>
Expand All @@ -28,7 +37,8 @@ public class InvoiceParent : StripeEntity<InvoiceParent>

/// <summary>
/// The type of parent that generated this invoice.
/// One of: <c>quote_details</c>, or <c>subscription_details</c>.
/// One of: <c>billing_cadence_details</c>, <c>quote_details</c>, or
/// <c>subscription_details</c>.
/// </summary>
[JsonProperty("type")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class InvoiceParentBillingCadenceDetails : StripeEntity<InvoiceParentBillingCadenceDetails>
{
/// <summary>
/// The billing cadence that generated this invoice.
/// </summary>
[JsonProperty("billing_cadence")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("billing_cadence")]
#endif
public string BillingCadence { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ namespace Stripe

public class QuotePreviewInvoiceParent : StripeEntity<QuotePreviewInvoiceParent>
{
/// <summary>
/// Details about the billing cadence that generated this invoice.
/// </summary>
[JsonProperty("billing_cadence_details")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("billing_cadence_details")]
#endif
public QuotePreviewInvoiceParentBillingCadenceDetails BillingCadenceDetails { get; set; }

/// <summary>
/// Details about the quote that generated this invoice.
/// </summary>
Expand All @@ -28,7 +37,8 @@ public class QuotePreviewInvoiceParent : StripeEntity<QuotePreviewInvoiceParent>

/// <summary>
/// The type of parent that generated this invoice.
/// One of: <c>quote_details</c>, or <c>subscription_details</c>.
/// One of: <c>billing_cadence_details</c>, <c>quote_details</c>, or
/// <c>subscription_details</c>.
/// </summary>
[JsonProperty("type")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class QuotePreviewInvoiceParentBillingCadenceDetails : StripeEntity<QuotePreviewInvoiceParentBillingCadenceDetails>
{
/// <summary>
/// The billing cadence that generated this invoice.
/// </summary>
[JsonProperty("billing_cadence")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("billing_cadence")]
#endif
public string BillingCadence { get; set; }
}
}
13 changes: 13 additions & 0 deletions src/Stripe.net/Entities/Subscriptions/Subscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,19 @@ public Application Application
#endif
public SubscriptionAutomaticTax AutomaticTax { get; set; }

/// <summary>
/// The Billing Cadence which controls the timing of recurring invoice generation for this
/// subscription.If unset, the subscription will bill according to its own configured
/// schedule and create its own invoices.If set, this subscription will be billed by the
/// cadence instead, potentially sharing invoices with the other subscriptions linked to
/// that Cadence.
/// </summary>
[JsonProperty("billing_cadence")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("billing_cadence")]
#endif
public string BillingCadence { get; set; }

/// <summary>
/// The reference point that aligns future <a
/// href="https://stripe.com/docs/subscriptions/billing-cycle">billing cycle</a> dates. It
Expand Down
11 changes: 11 additions & 0 deletions src/Stripe.net/Services/Invoices/InvoiceCreatePreviewOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ public class InvoiceCreatePreviewOptions : BaseOptions
#endif
public InvoiceAutomaticTaxOptions AutomaticTax { get; set; }

/// <summary>
/// The identifier of the billing cadence for which you’d like to retrieve the upcoming
/// invoice.Cannot be provided when <c>subscription</c>, <c>schedule</c>,
/// <c>subscription_details</c> or <c>schedule_details</c> are provided.
/// </summary>
[JsonProperty("billing_cadence")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("billing_cadence")]
#endif
public string BillingCadence { get; set; }

/// <summary>
/// The currency to preview this invoice in. Defaults to that of <c>customer</c> if not
/// specified.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class SubscriptionAttachCadenceOptions : BaseOptions
{
/// <summary>
/// The Billing Cadence which controls the timing of recurring invoice generation for this
/// subscription. If unset, the subscription will bill according to its own configured
/// schedule and create its own invoices. If set, this subscription will be billed by the
/// cadence instead, potentially sharing invoices with the other subscriptions linked to
/// that Cadence.
/// </summary>
[JsonProperty("billing_cadence")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("billing_cadence")]
#endif
public string BillingCadence { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata
#endif
public DateTime? BackdateStartDate { get; set; }

/// <summary>
/// The Billing Cadence which controls the timing of recurring invoice generation for this
/// subscription. If unset, the subscription will bill according to its own configured
/// schedule and create its own invoices. If set, this subscription will be billed by the
/// cadence instead, potentially sharing invoices with the other subscriptions linked to
/// that Cadence.
/// </summary>
[JsonProperty("billing_cadence")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("billing_cadence")]
#endif
public string BillingCadence { get; set; }

/// <summary>
/// A future timestamp in UTC format to anchor the subscription's <a
/// href="https://stripe.com/docs/subscriptions/billing-cycle">billing cycle</a>. The anchor
Expand Down
20 changes: 20 additions & 0 deletions src/Stripe.net/Services/Subscriptions/SubscriptionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ public SubscriptionService(IStripeClient client)
{
}

/// <summary>
/// <p>Attach a Billing Cadence to an existing subscription. When attached, the subscription
/// is billed by the Billing Cadence, potentially sharing invoices with the other
/// subscriptions linked to the Billing Cadence.</p>.
/// </summary>
public virtual Subscription AttachCadence(string id, SubscriptionAttachCadenceOptions options = null, RequestOptions requestOptions = null)
{
return this.Request<Subscription>(BaseAddress.Api, HttpMethod.Post, $"/v1/subscriptions/{WebUtility.UrlEncode(id)}/attach_cadence", options, requestOptions);
}

/// <summary>
/// <p>Attach a Billing Cadence to an existing subscription. When attached, the subscription
/// is billed by the Billing Cadence, potentially sharing invoices with the other
/// subscriptions linked to the Billing Cadence.</p>.
/// </summary>
public virtual Task<Subscription> AttachCadenceAsync(string id, SubscriptionAttachCadenceOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
return this.RequestAsync<Subscription>(BaseAddress.Api, HttpMethod.Post, $"/v1/subscriptions/{WebUtility.UrlEncode(id)}/attach_cadence", options, requestOptions, cancellationToken);
}

/// <summary>
/// <p>Cancels a customer’s subscription immediately. The customer won’t be charged again
/// for the subscription. After it’s canceled, you can no longer update the subscription or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata
#endif
public SubscriptionAutomaticTaxOptions AutomaticTax { get; set; }

/// <summary>
/// The Billing Cadence which controls the timing of recurring invoice generation for this
/// subscription. If unset, the subscription will bill according to its own configured
/// schedule and create its own invoices. If set, this subscription will be billed by the
/// cadence instead, potentially sharing invoices with the other subscriptions linked to
/// that Cadence.
/// </summary>
[JsonProperty("billing_cadence")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("billing_cadence")]
#endif
public string BillingCadence { get; set; }

/// <summary>
/// Either <c>now</c> or <c>unchanged</c>. Setting the value to <c>now</c> resets the
/// subscription's billing cycle anchor to the current time (in UTC). For more information,
Expand Down
Loading