stripe 20.4.0-alpha.3 → 20.4.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 20.4.0-alpha.4 - 2026-02-19
4
+ * [#2574](https://github.com/stripe/stripe-node/pull/2574) Update generated code for private-preview
5
+ * ⚠️ Add support for new value `spend_threshold` on enums `Billing.Alert.alert_type`, `Billing.AlertCreateParams.alert_type`, and `Billing.AlertListParams.alert_type`
6
+ * Add support for `spend_threshold` on `Billing.AlertCreateParams` and `Billing.Alert`
7
+ * Add support for `invoice_item`, `proration_details`, `proration`, and `subscription` on `InvoiceLineItem.parent.schedule_details`
8
+ * Add support for `custom` on `PaymentMethodUpdateParams`
9
+ * Add support for `payment_method_reference` and `usage` on `PaymentMethod.custom`
10
+ * Add support for `outstanding_usage_through` and `unused_time_from` on `SubscriptionPauseParams.bill_for`
11
+ * ⚠️ Remove support for `outstanding_usage` and `unused_time` on `SubscriptionPauseParams.bill_for`
12
+ * ⚠️ Remove support for `payment_behavior` on `SubscriptionResumeParams`
13
+
3
14
  ## 20.4.0-alpha.3 - 2026-02-11
4
15
  * [#2572](https://github.com/stripe/stripe-node/pull/2572) Update generated code for private-preview
5
16
  * Add support for new resources `V2.Billing.CadenceSpendModifier`, `V2.Billing.OneTimeItem`, and `V2.Billing.RateCardCustomPricingUnitOverageRate`
package/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v2169
1
+ v2176
package/VERSION CHANGED
@@ -1 +1 @@
1
- 20.4.0-alpha.3
1
+ 20.4.0-alpha.4
@@ -37,7 +37,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
37
37
  ];
38
38
  const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
39
39
  function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
40
- Stripe.PACKAGE_VERSION = '20.4.0-alpha.3';
40
+ Stripe.PACKAGE_VERSION = '20.4.0-alpha.4';
41
41
  Stripe.API_VERSION = apiVersion_js_1.ApiVersion;
42
42
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
43
43
  Stripe.StripeResource = StripeResource_js_1.StripeResource;
@@ -34,7 +34,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
34
34
  ];
35
35
  const defaultRequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS);
36
36
  export function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
37
- Stripe.PACKAGE_VERSION = '20.4.0-alpha.3';
37
+ Stripe.PACKAGE_VERSION = '20.4.0-alpha.4';
38
38
  Stripe.API_VERSION = ApiVersion;
39
39
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, determineProcessUserAgentProperties());
40
40
  Stripe.StripeResource = StripeResource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "20.4.0-alpha.3",
3
+ "version": "20.4.0-alpha.4",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -32,6 +32,11 @@ declare module 'stripe' {
32
32
  */
33
33
  livemode: boolean;
34
34
 
35
+ /**
36
+ * Encapsulates the alert's configuration to monitor spend on pricing plan subscriptions.
37
+ */
38
+ spend_threshold?: Alert.SpendThreshold | null;
39
+
35
40
  /**
36
41
  * Status of the alert. This can be active, inactive or archived.
37
42
  */
@@ -49,7 +54,10 @@ declare module 'stripe' {
49
54
  }
50
55
 
51
56
  namespace Alert {
52
- type AlertType = 'credit_balance_threshold' | 'usage_threshold';
57
+ type AlertType =
58
+ | 'credit_balance_threshold'
59
+ | 'spend_threshold'
60
+ | 'usage_threshold';
53
61
 
54
62
  interface CreditBalanceThreshold {
55
63
  /**
@@ -159,6 +167,136 @@ declare module 'stripe' {
159
167
  }
160
168
  }
161
169
 
170
+ interface SpendThreshold {
171
+ /**
172
+ * Defines the period over which spend is aggregated.
173
+ */
174
+ aggregation_period: 'billing';
175
+
176
+ /**
177
+ * Filters to scope the spend calculation.
178
+ */
179
+ filters: SpendThreshold.Filters | null;
180
+
181
+ /**
182
+ * Defines the granularity of spend aggregation.
183
+ */
184
+ group_by: 'pricing_plan_subscription' | null;
185
+
186
+ /**
187
+ * The threshold value configuration for a spend threshold alert.
188
+ */
189
+ gte: SpendThreshold.Gte;
190
+ }
191
+
192
+ namespace SpendThreshold {
193
+ interface Filters {
194
+ /**
195
+ * Filter by billable item IDs.
196
+ */
197
+ billable_items: Array<string> | null;
198
+
199
+ /**
200
+ * Filter by billing cadence ID.
201
+ */
202
+ billing_cadence: string | null;
203
+
204
+ /**
205
+ * Filter by pricing plan ID.
206
+ */
207
+ pricing_plan: string | null;
208
+
209
+ /**
210
+ * Filter by pricing plan subscription ID.
211
+ */
212
+ pricing_plan_subscription: string | null;
213
+ }
214
+
215
+ interface Gte {
216
+ /**
217
+ * The monetary amount. Present when type is `amount`.
218
+ */
219
+ amount: Gte.Amount | null;
220
+
221
+ /**
222
+ * The custom pricing unit amount. Present when type is `custom_pricing_unit`.
223
+ */
224
+ custom_pricing_unit: Gte.CustomPricingUnit | null;
225
+
226
+ /**
227
+ * The type of the threshold amount.
228
+ */
229
+ type: Gte.Type;
230
+ }
231
+
232
+ namespace Gte {
233
+ interface Amount {
234
+ /**
235
+ * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
236
+ */
237
+ currency: string;
238
+
239
+ /**
240
+ * A positive integer representing the amount.
241
+ */
242
+ value: number;
243
+ }
244
+
245
+ interface CustomPricingUnit {
246
+ /**
247
+ * The custom pricing unit object.
248
+ */
249
+ custom_pricing_unit_details: CustomPricingUnit.CustomPricingUnitDetails | null;
250
+
251
+ /**
252
+ * Unique identifier for the object.
253
+ */
254
+ id: string;
255
+
256
+ /**
257
+ * A positive decimal string representing the amount.
258
+ */
259
+ value: string;
260
+ }
261
+
262
+ namespace CustomPricingUnit {
263
+ interface CustomPricingUnitDetails {
264
+ /**
265
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
266
+ */
267
+ created: number;
268
+
269
+ /**
270
+ * The name of the custom pricing unit.
271
+ */
272
+ display_name: string;
273
+
274
+ /**
275
+ * Unique identifier for the object.
276
+ */
277
+ id: string;
278
+
279
+ /**
280
+ * A lookup key for the custom pricing unit.
281
+ */
282
+ lookup_key: string | null;
283
+
284
+ /**
285
+ * Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
286
+ */
287
+ metadata: Stripe.Metadata;
288
+
289
+ /**
290
+ * The status of the custom pricing unit.
291
+ */
292
+ status: string;
293
+ }
294
+ }
295
+
296
+ type Type = 'amount' | 'custom_pricing_unit';
297
+ }
298
+ }
299
+
162
300
  type Status = 'active' | 'archived' | 'inactive';
163
301
 
164
302
  interface UsageThreshold {
@@ -24,6 +24,11 @@ declare module 'stripe' {
24
24
  */
25
25
  expand?: Array<string>;
26
26
 
27
+ /**
28
+ * The configuration of the spend threshold.
29
+ */
30
+ spend_threshold?: AlertCreateParams.SpendThreshold;
31
+
27
32
  /**
28
33
  * The configuration of the usage threshold.
29
34
  */
@@ -31,7 +36,10 @@ declare module 'stripe' {
31
36
  }
32
37
 
33
38
  namespace AlertCreateParams {
34
- type AlertType = 'credit_balance_threshold' | 'usage_threshold';
39
+ type AlertType =
40
+ | 'credit_balance_threshold'
41
+ | 'spend_threshold'
42
+ | 'usage_threshold';
35
43
 
36
44
  interface CreditBalanceThreshold {
37
45
  /**
@@ -164,6 +172,97 @@ declare module 'stripe' {
164
172
  }
165
173
  }
166
174
 
175
+ interface SpendThreshold {
176
+ /**
177
+ * Defines the period over which spend is aggregated.
178
+ */
179
+ aggregation_period: 'billing';
180
+
181
+ /**
182
+ * Filters to scope the spend calculation.
183
+ */
184
+ filters?: SpendThreshold.Filters;
185
+
186
+ /**
187
+ * Defines the granularity of spend aggregation. Defaults to `pricing_plan_subscription`.
188
+ */
189
+ group_by?: 'pricing_plan_subscription';
190
+
191
+ /**
192
+ * Defines at which value the alert will fire.
193
+ */
194
+ gte: SpendThreshold.Gte;
195
+ }
196
+
197
+ namespace SpendThreshold {
198
+ interface Filters {
199
+ /**
200
+ * Filter by billable item IDs. Maximum of 20 billable items.
201
+ */
202
+ billable_items?: Array<string>;
203
+
204
+ /**
205
+ * Filter by billing cadence ID.
206
+ */
207
+ billing_cadence?: string;
208
+
209
+ /**
210
+ * Filter by pricing plan ID.
211
+ */
212
+ pricing_plan?: string;
213
+
214
+ /**
215
+ * Filter by pricing plan subscription ID.
216
+ */
217
+ pricing_plan_subscription?: string;
218
+ }
219
+
220
+ interface Gte {
221
+ /**
222
+ * The monetary amount. Required when type is `amount`.
223
+ */
224
+ amount?: Gte.Amount;
225
+
226
+ /**
227
+ * The custom pricing unit amount. Required when type is `custom_pricing_unit`.
228
+ */
229
+ custom_pricing_unit?: Gte.CustomPricingUnit;
230
+
231
+ /**
232
+ * The type of the threshold amount.
233
+ */
234
+ type: Gte.Type;
235
+ }
236
+
237
+ namespace Gte {
238
+ interface Amount {
239
+ /**
240
+ * Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `value` parameter.
241
+ */
242
+ currency: string;
243
+
244
+ /**
245
+ * An integer representing the amount of the threshold.
246
+ */
247
+ value: number;
248
+ }
249
+
250
+ interface CustomPricingUnit {
251
+ /**
252
+ * The ID of the custom pricing unit.
253
+ */
254
+ id: string;
255
+
256
+ /**
257
+ * A positive decimal string representing the amount of the custom pricing unit threshold.
258
+ */
259
+ value: string;
260
+ }
261
+
262
+ type Type = 'amount' | 'custom_pricing_unit';
263
+ }
264
+ }
265
+
167
266
  interface UsageThreshold {
168
267
  /**
169
268
  * The filters allows limiting the scope of this usage alert. You can only specify up to one filter at this time.
@@ -231,7 +330,10 @@ declare module 'stripe' {
231
330
  }
232
331
 
233
332
  namespace AlertListParams {
234
- type AlertType = 'credit_balance_threshold' | 'usage_threshold';
333
+ type AlertType =
334
+ | 'credit_balance_threshold'
335
+ | 'spend_threshold'
336
+ | 'usage_threshold';
235
337
  }
236
338
 
237
339
  interface AlertActivateParams {
@@ -272,9 +272,52 @@ declare module 'stripe' {
272
272
 
273
273
  interface ScheduleDetails {
274
274
  /**
275
- * The subscription schedule that generated this line item
275
+ * The subscription schedule that generated this line item.
276
276
  */
277
277
  schedule: string;
278
+
279
+ /**
280
+ * The invoice item that generated this line item.
281
+ */
282
+ invoice_item: string | null;
283
+
284
+ /**
285
+ * Whether this is a proration.
286
+ */
287
+ proration: boolean;
288
+
289
+ /**
290
+ * Additional details for proration line items.
291
+ */
292
+ proration_details: ScheduleDetails.ProrationDetails | null;
293
+
294
+ /**
295
+ * The subscription that the schedule belongs to.
296
+ */
297
+ subscription: string | null;
298
+ }
299
+
300
+ namespace ScheduleDetails {
301
+ interface ProrationDetails {
302
+ /**
303
+ * For a credit proration `line_item`, the original debit line_items to which the credit proration applies.
304
+ */
305
+ credited_items: ProrationDetails.CreditedItems | null;
306
+ }
307
+
308
+ namespace ProrationDetails {
309
+ interface CreditedItems {
310
+ /**
311
+ * Invoice containing the credited invoice line items
312
+ */
313
+ invoice: string;
314
+
315
+ /**
316
+ * Credited invoice line items
317
+ */
318
+ invoice_line_items: Array<string>;
319
+ }
320
+ }
278
321
  }
279
322
 
280
323
  interface SubscriptionItemDetails {
@@ -944,6 +944,16 @@ declare module 'stripe' {
944
944
  * ID of the Dashboard-only CustomPaymentMethodType. Not expandable.
945
945
  */
946
946
  type: string;
947
+
948
+ /**
949
+ * A reference to an external payment method, such as a PayPal Billing Agreement ID.
950
+ */
951
+ payment_method_reference?: string | null;
952
+
953
+ /**
954
+ * Indicates whether the payment method supports off-session payments.
955
+ */
956
+ usage?: 'off_session' | null;
947
957
  }
948
958
 
949
959
  namespace Custom {
@@ -972,6 +972,11 @@ declare module 'stripe' {
972
972
  */
973
973
  card?: PaymentMethodUpdateParams.Card;
974
974
 
975
+ /**
976
+ * If this is a `custom` PaymentMethod, this hash contains details about the Custom payment method.
977
+ */
978
+ custom?: PaymentMethodUpdateParams.Custom;
979
+
975
980
  /**
976
981
  * Specifies which fields in the response should be expanded.
977
982
  */
@@ -1053,6 +1058,18 @@ declare module 'stripe' {
1053
1058
  }
1054
1059
  }
1055
1060
 
1061
+ interface Custom {
1062
+ /**
1063
+ * A reference to an external payment method, such as a PayPal Billing Agreement ID.
1064
+ */
1065
+ payment_method_reference?: string;
1066
+
1067
+ /**
1068
+ * Indicates whether the payment method supports off-session payments.
1069
+ */
1070
+ usage?: 'off_session';
1071
+ }
1072
+
1056
1073
  interface Payto {
1057
1074
  /**
1058
1075
  * The account number for the bank account.
@@ -3185,14 +3185,38 @@ declare module 'stripe' {
3185
3185
  namespace SubscriptionPauseParams {
3186
3186
  interface BillFor {
3187
3187
  /**
3188
- * Controls whether to debit for accrued metered usage in the current billing period. The default is `true`.
3188
+ * Controls when to bill for metered usage in the current period. Defaults to `{ type: "now" }`.
3189
3189
  */
3190
- outstanding_usage?: boolean;
3190
+ outstanding_usage_through?: BillFor.OutstandingUsageThrough;
3191
3191
 
3192
3192
  /**
3193
- * Controls whether to credit for licensed items in the current billing period. The default is `true`.
3193
+ * Controls when to credit for unused time on licensed items. Defaults to `{ type: "now" }`.
3194
3194
  */
3195
- unused_time?: boolean;
3195
+ unused_time_from?: BillFor.UnusedTimeFrom;
3196
+ }
3197
+
3198
+ namespace BillFor {
3199
+ interface OutstandingUsageThrough {
3200
+ /**
3201
+ * When to bill metered usage in the current period.
3202
+ */
3203
+ type: OutstandingUsageThrough.Type;
3204
+ }
3205
+
3206
+ namespace OutstandingUsageThrough {
3207
+ type Type = 'none' | 'now';
3208
+ }
3209
+
3210
+ interface UnusedTimeFrom {
3211
+ /**
3212
+ * When to credit for unused time.
3213
+ */
3214
+ type: UnusedTimeFrom.Type;
3215
+ }
3216
+
3217
+ namespace UnusedTimeFrom {
3218
+ type Type = 'item_current_period_start' | 'none' | 'now';
3219
+ }
3196
3220
  }
3197
3221
 
3198
3222
  type InvoicingBehavior = 'invoice' | 'pending_invoice_item';
@@ -3209,11 +3233,6 @@ declare module 'stripe' {
3209
3233
  */
3210
3234
  expand?: Array<string>;
3211
3235
 
3212
- /**
3213
- * Controls when the subscription transitions from `paused` to `active`. Determines how payment on the invoice affects the resumption process.The default is `pending_if_incomplete`.
3214
- */
3215
- payment_behavior?: SubscriptionResumeParams.PaymentBehavior;
3216
-
3217
3236
  /**
3218
3237
  * Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor` being `unchanged`. When the `billing_cycle_anchor` is set to `now` (default value), no prorations are generated. If no value is passed, the default is `create_prorations`.
3219
3238
  */
@@ -3228,8 +3247,6 @@ declare module 'stripe' {
3228
3247
  namespace SubscriptionResumeParams {
3229
3248
  type BillingCycleAnchor = 'now' | 'unchanged';
3230
3249
 
3231
- type PaymentBehavior = 'allow_incomplete' | 'pending_if_incomplete';
3232
-
3233
3250
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
3234
3251
  }
3235
3252