diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9f46827f56..bfb4a2e0ea 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2025 \ No newline at end of file +v2026 \ No newline at end of file diff --git a/src/Stripe.net/Entities/Invoices/InvoiceParent.cs b/src/Stripe.net/Entities/Invoices/InvoiceParent.cs index 16b197ab88..b9ebce74ed 100644 --- a/src/Stripe.net/Entities/Invoices/InvoiceParent.cs +++ b/src/Stripe.net/Entities/Invoices/InvoiceParent.cs @@ -8,6 +8,15 @@ namespace Stripe public class InvoiceParent : StripeEntity { + /// + /// Details about the billing cadence that generated this invoice. + /// + [JsonProperty("billing_cadence_details")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("billing_cadence_details")] +#endif + public InvoiceParentBillingCadenceDetails BillingCadenceDetails { get; set; } + /// /// Details about the quote that generated this invoice. /// @@ -28,7 +37,8 @@ public class InvoiceParent : StripeEntity /// /// The type of parent that generated this invoice. - /// One of: quote_details, or subscription_details. + /// One of: billing_cadence_details, quote_details, or + /// subscription_details. /// [JsonProperty("type")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Entities/Invoices/InvoiceParentBillingCadenceDetails.cs b/src/Stripe.net/Entities/Invoices/InvoiceParentBillingCadenceDetails.cs new file mode 100644 index 0000000000..3c281a7d72 --- /dev/null +++ b/src/Stripe.net/Entities/Invoices/InvoiceParentBillingCadenceDetails.cs @@ -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 + { + /// + /// The billing cadence that generated this invoice. + /// + [JsonProperty("billing_cadence")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("billing_cadence")] +#endif + public string BillingCadence { get; set; } + } +} diff --git a/src/Stripe.net/Entities/QuotePreviewInvoices/QuotePreviewInvoiceParent.cs b/src/Stripe.net/Entities/QuotePreviewInvoices/QuotePreviewInvoiceParent.cs index 0a964c3ccc..c7ab048e3b 100644 --- a/src/Stripe.net/Entities/QuotePreviewInvoices/QuotePreviewInvoiceParent.cs +++ b/src/Stripe.net/Entities/QuotePreviewInvoices/QuotePreviewInvoiceParent.cs @@ -8,6 +8,15 @@ namespace Stripe public class QuotePreviewInvoiceParent : StripeEntity { + /// + /// Details about the billing cadence that generated this invoice. + /// + [JsonProperty("billing_cadence_details")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("billing_cadence_details")] +#endif + public QuotePreviewInvoiceParentBillingCadenceDetails BillingCadenceDetails { get; set; } + /// /// Details about the quote that generated this invoice. /// @@ -28,7 +37,8 @@ public class QuotePreviewInvoiceParent : StripeEntity /// /// The type of parent that generated this invoice. - /// One of: quote_details, or subscription_details. + /// One of: billing_cadence_details, quote_details, or + /// subscription_details. /// [JsonProperty("type")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Entities/QuotePreviewInvoices/QuotePreviewInvoiceParentBillingCadenceDetails.cs b/src/Stripe.net/Entities/QuotePreviewInvoices/QuotePreviewInvoiceParentBillingCadenceDetails.cs new file mode 100644 index 0000000000..5bc6c8456c --- /dev/null +++ b/src/Stripe.net/Entities/QuotePreviewInvoices/QuotePreviewInvoiceParentBillingCadenceDetails.cs @@ -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 + { + /// + /// The billing cadence that generated this invoice. + /// + [JsonProperty("billing_cadence")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("billing_cadence")] +#endif + public string BillingCadence { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Subscriptions/Subscription.cs b/src/Stripe.net/Entities/Subscriptions/Subscription.cs index 9ac82b6042..197ad5bbad 100644 --- a/src/Stripe.net/Entities/Subscriptions/Subscription.cs +++ b/src/Stripe.net/Entities/Subscriptions/Subscription.cs @@ -97,6 +97,19 @@ public Application Application #endif public SubscriptionAutomaticTax AutomaticTax { get; set; } + /// + /// 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. + /// + [JsonProperty("billing_cadence")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("billing_cadence")] +#endif + public string BillingCadence { get; set; } + /// /// The reference point that aligns future billing cycle dates. It diff --git a/src/Stripe.net/Services/Invoices/InvoiceCreatePreviewOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceCreatePreviewOptions.cs index 91dd53e0ac..1a5bdf3328 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceCreatePreviewOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceCreatePreviewOptions.cs @@ -18,6 +18,17 @@ public class InvoiceCreatePreviewOptions : BaseOptions #endif public InvoiceAutomaticTaxOptions AutomaticTax { get; set; } + /// + /// The identifier of the billing cadence for which you’d like to retrieve the upcoming + /// invoice.Cannot be provided when subscription, schedule, + /// subscription_details or schedule_details are provided. + /// + [JsonProperty("billing_cadence")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("billing_cadence")] +#endif + public string BillingCadence { get; set; } + /// /// The currency to preview this invoice in. Defaults to that of customer if not /// specified. diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionAttachCadenceOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionAttachCadenceOptions.cs new file mode 100644 index 0000000000..5b6c20dc68 --- /dev/null +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionAttachCadenceOptions.cs @@ -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 + { + /// + /// 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. + /// + [JsonProperty("billing_cadence")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("billing_cadence")] +#endif + public string BillingCadence { get; set; } + } +} diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs index 7fb0aca820..3afa2e8fbd 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs @@ -57,6 +57,19 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata #endif public DateTime? BackdateStartDate { get; set; } + /// + /// 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. + /// + [JsonProperty("billing_cadence")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("billing_cadence")] +#endif + public string BillingCadence { get; set; } + /// /// A future timestamp in UTC format to anchor the subscription's billing cycle. The anchor diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionService.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionService.cs index 4a0f53304f..c706ad6715 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionService.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionService.cs @@ -29,6 +29,26 @@ public SubscriptionService(IStripeClient client) { } + /// + ///

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.

. + ///
+ public virtual Subscription AttachCadence(string id, SubscriptionAttachCadenceOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v1/subscriptions/{WebUtility.UrlEncode(id)}/attach_cadence", options, requestOptions); + } + + /// + ///

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.

. + ///
+ public virtual Task AttachCadenceAsync(string id, SubscriptionAttachCadenceOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/subscriptions/{WebUtility.UrlEncode(id)}/attach_cadence", options, requestOptions, cancellationToken); + } + /// ///

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 diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs index 2d4f1c3d8c..e190d8ad24 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs @@ -45,6 +45,19 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata #endif public SubscriptionAutomaticTaxOptions AutomaticTax { get; set; } + ///

+ /// 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. + /// + [JsonProperty("billing_cadence")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("billing_cadence")] +#endif + public string BillingCadence { get; set; } + /// /// Either now or unchanged. Setting the value to now resets the /// subscription's billing cycle anchor to the current time (in UTC). For more information,