orb-billing 5.48.0 → 5.76.0

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.
Files changed (205) hide show
  1. package/CHANGELOG.md +249 -0
  2. package/core.js +2 -2
  3. package/core.js.map +1 -1
  4. package/core.mjs +2 -2
  5. package/core.mjs.map +1 -1
  6. package/index.d.ts.map +1 -1
  7. package/index.js +11 -0
  8. package/index.js.map +1 -1
  9. package/index.mjs +11 -0
  10. package/index.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/alerts.d.ts +140 -3
  13. package/resources/alerts.d.ts.map +1 -1
  14. package/resources/alerts.js.map +1 -1
  15. package/resources/alerts.mjs.map +1 -1
  16. package/resources/beta/beta.d.ts +738 -7570
  17. package/resources/beta/beta.d.ts.map +1 -1
  18. package/resources/beta/beta.js.map +1 -1
  19. package/resources/beta/beta.mjs.map +1 -1
  20. package/resources/beta/external-plan-id.d.ts +664 -7572
  21. package/resources/beta/external-plan-id.d.ts.map +1 -1
  22. package/resources/coupons/coupons.d.ts +29 -0
  23. package/resources/coupons/coupons.d.ts.map +1 -1
  24. package/resources/coupons/coupons.js +21 -0
  25. package/resources/coupons/coupons.js.map +1 -1
  26. package/resources/coupons/coupons.mjs +21 -0
  27. package/resources/coupons/coupons.mjs.map +1 -1
  28. package/resources/coupons/subscriptions.d.ts +10 -0
  29. package/resources/coupons/subscriptions.d.ts.map +1 -1
  30. package/resources/coupons/subscriptions.js.map +1 -1
  31. package/resources/coupons/subscriptions.mjs.map +1 -1
  32. package/resources/credit-blocks.d.ts +138 -7
  33. package/resources/credit-blocks.d.ts.map +1 -1
  34. package/resources/credit-blocks.js +10 -7
  35. package/resources/credit-blocks.js.map +1 -1
  36. package/resources/credit-blocks.mjs +10 -7
  37. package/resources/credit-blocks.mjs.map +1 -1
  38. package/resources/credit-notes.d.ts +28 -0
  39. package/resources/credit-notes.d.ts.map +1 -1
  40. package/resources/credit-notes.js +20 -0
  41. package/resources/credit-notes.js.map +1 -1
  42. package/resources/credit-notes.mjs +20 -0
  43. package/resources/credit-notes.mjs.map +1 -1
  44. package/resources/customers/credits/credits.d.ts +129 -0
  45. package/resources/customers/credits/credits.d.ts.map +1 -1
  46. package/resources/customers/credits/credits.js.map +1 -1
  47. package/resources/customers/credits/credits.mjs.map +1 -1
  48. package/resources/customers/credits/ledger.d.ts +34 -20
  49. package/resources/customers/credits/ledger.d.ts.map +1 -1
  50. package/resources/customers/credits/ledger.js +28 -14
  51. package/resources/customers/credits/ledger.js.map +1 -1
  52. package/resources/customers/credits/ledger.mjs +28 -14
  53. package/resources/customers/credits/ledger.mjs.map +1 -1
  54. package/resources/customers/customers.d.ts +89 -6
  55. package/resources/customers/customers.d.ts.map +1 -1
  56. package/resources/customers/customers.js.map +1 -1
  57. package/resources/customers/customers.mjs.map +1 -1
  58. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +35 -1
  59. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -1
  60. package/resources/dimensional-price-groups/dimensional-price-groups.js +26 -0
  61. package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -1
  62. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +26 -0
  63. package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -1
  64. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +16 -0
  65. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
  66. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +16 -0
  67. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -1
  68. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +16 -0
  69. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -1
  70. package/resources/events/backfills.d.ts +37 -0
  71. package/resources/events/backfills.d.ts.map +1 -1
  72. package/resources/events/backfills.js +29 -0
  73. package/resources/events/backfills.js.map +1 -1
  74. package/resources/events/backfills.mjs +29 -0
  75. package/resources/events/backfills.mjs.map +1 -1
  76. package/resources/events/events.d.ts +41 -33
  77. package/resources/events/events.d.ts.map +1 -1
  78. package/resources/events/events.js +39 -31
  79. package/resources/events/events.js.map +1 -1
  80. package/resources/events/events.mjs +39 -31
  81. package/resources/events/events.mjs.map +1 -1
  82. package/resources/events/volume.d.ts +7 -0
  83. package/resources/events/volume.d.ts.map +1 -1
  84. package/resources/events/volume.js +7 -0
  85. package/resources/events/volume.js.map +1 -1
  86. package/resources/events/volume.mjs +7 -0
  87. package/resources/events/volume.mjs.map +1 -1
  88. package/resources/invoice-line-items.d.ts +89 -1
  89. package/resources/invoice-line-items.d.ts.map +1 -1
  90. package/resources/invoice-line-items.js +12 -0
  91. package/resources/invoice-line-items.js.map +1 -1
  92. package/resources/invoice-line-items.mjs +12 -0
  93. package/resources/invoice-line-items.mjs.map +1 -1
  94. package/resources/invoices.d.ts +200 -12
  95. package/resources/invoices.d.ts.map +1 -1
  96. package/resources/invoices.js +64 -0
  97. package/resources/invoices.js.map +1 -1
  98. package/resources/invoices.mjs +64 -0
  99. package/resources/invoices.mjs.map +1 -1
  100. package/resources/items.d.ts +30 -0
  101. package/resources/items.d.ts.map +1 -1
  102. package/resources/items.js +22 -0
  103. package/resources/items.js.map +1 -1
  104. package/resources/items.mjs +22 -0
  105. package/resources/items.mjs.map +1 -1
  106. package/resources/licenses/external-licenses.d.ts +13 -1
  107. package/resources/licenses/external-licenses.d.ts.map +1 -1
  108. package/resources/licenses/external-licenses.js +12 -0
  109. package/resources/licenses/external-licenses.js.map +1 -1
  110. package/resources/licenses/external-licenses.mjs +12 -0
  111. package/resources/licenses/external-licenses.mjs.map +1 -1
  112. package/resources/licenses/licenses.d.ts +44 -0
  113. package/resources/licenses/licenses.d.ts.map +1 -1
  114. package/resources/licenses/licenses.js +44 -0
  115. package/resources/licenses/licenses.js.map +1 -1
  116. package/resources/licenses/licenses.mjs +44 -0
  117. package/resources/licenses/licenses.mjs.map +1 -1
  118. package/resources/licenses/usage.d.ts +17 -2
  119. package/resources/licenses/usage.d.ts.map +1 -1
  120. package/resources/licenses/usage.js +8 -0
  121. package/resources/licenses/usage.js.map +1 -1
  122. package/resources/licenses/usage.mjs +8 -0
  123. package/resources/licenses/usage.mjs.map +1 -1
  124. package/resources/metrics.d.ts +42 -5
  125. package/resources/metrics.d.ts.map +1 -1
  126. package/resources/metrics.js +27 -2
  127. package/resources/metrics.js.map +1 -1
  128. package/resources/metrics.mjs +27 -2
  129. package/resources/metrics.mjs.map +1 -1
  130. package/resources/plans/external-plan-id.d.ts +6 -2
  131. package/resources/plans/external-plan-id.d.ts.map +1 -1
  132. package/resources/plans/external-plan-id.js +2 -2
  133. package/resources/plans/external-plan-id.mjs +2 -2
  134. package/resources/plans/migrations.d.ts +42 -0
  135. package/resources/plans/migrations.d.ts.map +1 -1
  136. package/resources/plans/migrations.js.map +1 -1
  137. package/resources/plans/migrations.mjs.map +1 -1
  138. package/resources/plans/plans.d.ts +382 -3754
  139. package/resources/plans/plans.d.ts.map +1 -1
  140. package/resources/plans/plans.js +2 -2
  141. package/resources/plans/plans.js.map +1 -1
  142. package/resources/plans/plans.mjs +2 -2
  143. package/resources/plans/plans.mjs.map +1 -1
  144. package/resources/prices/external-price-id.d.ts +14 -0
  145. package/resources/prices/external-price-id.d.ts.map +1 -1
  146. package/resources/prices/external-price-id.js +14 -0
  147. package/resources/prices/external-price-id.js.map +1 -1
  148. package/resources/prices/external-price-id.mjs +14 -0
  149. package/resources/prices/external-price-id.mjs.map +1 -1
  150. package/resources/prices/prices.d.ts +1632 -393
  151. package/resources/prices/prices.d.ts.map +1 -1
  152. package/resources/prices/prices.js +46 -0
  153. package/resources/prices/prices.js.map +1 -1
  154. package/resources/prices/prices.mjs +46 -0
  155. package/resources/prices/prices.mjs.map +1 -1
  156. package/resources/shared.d.ts +922 -52
  157. package/resources/shared.d.ts.map +1 -1
  158. package/resources/shared.js.map +1 -1
  159. package/resources/shared.mjs.map +1 -1
  160. package/resources/subscription-changes.d.ts +72 -1
  161. package/resources/subscription-changes.d.ts.map +1 -1
  162. package/resources/subscription-changes.js.map +1 -1
  163. package/resources/subscription-changes.mjs.map +1 -1
  164. package/resources/subscriptions.d.ts +3075 -464
  165. package/resources/subscriptions.d.ts.map +1 -1
  166. package/resources/subscriptions.js +111 -0
  167. package/resources/subscriptions.js.map +1 -1
  168. package/resources/subscriptions.mjs +111 -0
  169. package/resources/subscriptions.mjs.map +1 -1
  170. package/src/core.ts +2 -2
  171. package/src/index.ts +12 -0
  172. package/src/resources/alerts.ts +161 -3
  173. package/src/resources/beta/beta.ts +828 -8988
  174. package/src/resources/beta/external-plan-id.ts +745 -8997
  175. package/src/resources/coupons/coupons.ts +29 -0
  176. package/src/resources/coupons/subscriptions.ts +10 -0
  177. package/src/resources/credit-blocks.ts +166 -7
  178. package/src/resources/credit-notes.ts +28 -0
  179. package/src/resources/customers/credits/credits.ts +157 -0
  180. package/src/resources/customers/credits/ledger.ts +34 -20
  181. package/src/resources/customers/customers.ts +99 -6
  182. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +35 -1
  183. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +16 -0
  184. package/src/resources/events/backfills.ts +37 -0
  185. package/src/resources/events/events.ts +41 -33
  186. package/src/resources/events/volume.ts +7 -0
  187. package/src/resources/invoice-line-items.ts +104 -0
  188. package/src/resources/invoices.ts +215 -11
  189. package/src/resources/items.ts +30 -0
  190. package/src/resources/licenses/external-licenses.ts +13 -1
  191. package/src/resources/licenses/licenses.ts +44 -0
  192. package/src/resources/licenses/usage.ts +17 -2
  193. package/src/resources/metrics.ts +43 -5
  194. package/src/resources/plans/external-plan-id.ts +7 -2
  195. package/src/resources/plans/migrations.ts +42 -0
  196. package/src/resources/plans/plans.ts +456 -4482
  197. package/src/resources/prices/external-price-id.ts +14 -0
  198. package/src/resources/prices/prices.ts +1743 -264
  199. package/src/resources/shared.ts +1172 -50
  200. package/src/resources/subscription-changes.ts +88 -1
  201. package/src/resources/subscriptions.ts +4707 -1585
  202. package/src/version.ts +1 -1
  203. package/version.d.ts +1 -1
  204. package/version.js +1 -1
  205. package/version.mjs +1 -1
@@ -268,12 +268,25 @@ export declare class Subscriptions extends APIResource {
268
268
  * ## Limits
269
269
  *
270
270
  * By default, Orb limits the number of subscriptions per customer to 100.
271
+ *
272
+ * @example
273
+ * ```ts
274
+ * const mutatedSubscription =
275
+ * await client.subscriptions.create();
276
+ * ```
271
277
  */
272
278
  create(body: SubscriptionCreateParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
273
279
  /**
274
280
  * This endpoint can be used to update the `metadata`, `net terms`,
275
281
  * `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties
276
282
  * on a subscription.
283
+ *
284
+ * @example
285
+ * ```ts
286
+ * const subscription = await client.subscriptions.update(
287
+ * 'subscription_id',
288
+ * );
289
+ * ```
277
290
  */
278
291
  update(subscriptionId: string, body: SubscriptionUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Subscription>;
279
292
  /**
@@ -286,6 +299,19 @@ export declare class Subscriptions extends APIResource {
286
299
  * customer_id or external_customer_id query parameters. To filter subscriptions
287
300
  * for multiple customers, use the customer_id[] or external_customer_id[] query
288
301
  * parameters.
302
+ *
303
+ * Subscriptions can be filtered by status using the status query parameter (one of
304
+ * `active`, `ended`, or `upcoming`). To filter for multiple statuses in a single
305
+ * request, use the status[] query parameter, e.g.
306
+ * `status[]=active&status[]=ended`.
307
+ *
308
+ * @example
309
+ * ```ts
310
+ * // Automatically fetches more pages as needed.
311
+ * for await (const subscription of client.subscriptions.list()) {
312
+ * // ...
313
+ * }
314
+ * ```
289
315
  */
290
316
  list(query?: SubscriptionListParams, options?: Core.RequestOptions): Core.PagePromise<SubscriptionsPage, Subscription>;
291
317
  list(options?: Core.RequestOptions): Core.PagePromise<SubscriptionsPage, Subscription>;
@@ -351,11 +377,26 @@ export declare class Subscriptions extends APIResource {
351
377
  * Orb will void the intervening invoice and generate a new one based on the new
352
378
  * dates for the subscription. See the section on
353
379
  * [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors).
380
+ *
381
+ * @example
382
+ * ```ts
383
+ * const mutatedSubscription =
384
+ * await client.subscriptions.cancel('subscription_id', {
385
+ * cancel_option: 'end_of_subscription_term',
386
+ * });
387
+ * ```
354
388
  */
355
389
  cancel(subscriptionId: string, body: SubscriptionCancelParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
356
390
  /**
357
391
  * This endpoint is used to fetch a [Subscription](/core-concepts##subscription)
358
392
  * given an identifier.
393
+ *
394
+ * @example
395
+ * ```ts
396
+ * const subscription = await client.subscriptions.fetch(
397
+ * 'subscription_id',
398
+ * );
399
+ * ```
359
400
  */
360
401
  fetch(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<Subscription>;
361
402
  /**
@@ -369,6 +410,13 @@ export declare class Subscriptions extends APIResource {
369
410
  * this endpoint to limit your analysis of costs to a specific subscription for the
370
411
  * customer (e.g. to de-aggregate costs when a customer's subscription has started
371
412
  * and stopped on the same day).
413
+ *
414
+ * @example
415
+ * ```ts
416
+ * const response = await client.subscriptions.fetchCosts(
417
+ * 'subscription_id',
418
+ * );
419
+ * ```
372
420
  */
373
421
  fetchCosts(subscriptionId: string, query?: SubscriptionFetchCostsParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionFetchCostsResponse>;
374
422
  fetchCosts(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<SubscriptionFetchCostsResponse>;
@@ -377,6 +425,16 @@ export declare class Subscriptions extends APIResource {
377
425
  * associated with a subscription along with their start and end dates. This list
378
426
  * contains the subscription's initial plan along with past and future plan
379
427
  * changes.
428
+ *
429
+ * @example
430
+ * ```ts
431
+ * // Automatically fetches more pages as needed.
432
+ * for await (const subscriptionFetchScheduleResponse of client.subscriptions.fetchSchedule(
433
+ * 'subscription_id',
434
+ * )) {
435
+ * // ...
436
+ * }
437
+ * ```
380
438
  */
381
439
  fetchSchedule(subscriptionId: string, query?: SubscriptionFetchScheduleParams, options?: Core.RequestOptions): Core.PagePromise<SubscriptionFetchScheduleResponsesPage, SubscriptionFetchScheduleResponse>;
382
440
  fetchSchedule(subscriptionId: string, options?: Core.RequestOptions): Core.PagePromise<SubscriptionFetchScheduleResponsesPage, SubscriptionFetchScheduleResponse>;
@@ -575,6 +633,12 @@ export declare class Subscriptions extends APIResource {
575
633
  * - `first_dimension_value`: `us-east-1`
576
634
  * - `second_dimension_key`: `provider`
577
635
  * - `second_dimension_value`: `aws`
636
+ *
637
+ * @example
638
+ * ```ts
639
+ * const subscriptionUsage =
640
+ * await client.subscriptions.fetchUsage('subscription_id');
641
+ * ```
578
642
  */
579
643
  fetchUsage(subscriptionId: string, query?: SubscriptionFetchUsageParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionUsage>;
580
644
  fetchUsage(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<SubscriptionUsage>;
@@ -651,10 +715,27 @@ export declare class Subscriptions extends APIResource {
651
715
  * existing list of transitions can be retrieved using the
652
716
  * `fixed_fee_quantity_transitions` property on a subscription’s serialized price
653
717
  * intervals.
718
+ *
719
+ * @example
720
+ * ```ts
721
+ * const mutatedSubscription =
722
+ * await client.subscriptions.priceIntervals(
723
+ * 'subscription_id',
724
+ * );
725
+ * ```
654
726
  */
655
727
  priceIntervals(subscriptionId: string, body: SubscriptionPriceIntervalsParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
656
728
  /**
657
729
  * Redeem a coupon effective at a given time.
730
+ *
731
+ * @example
732
+ * ```ts
733
+ * const mutatedSubscription =
734
+ * await client.subscriptions.redeemCoupon(
735
+ * 'subscription_id',
736
+ * { change_option: 'requested_date' },
737
+ * );
738
+ * ```
658
739
  */
659
740
  redeemCoupon(subscriptionId: string, body: SubscriptionRedeemCouponParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
660
741
  /**
@@ -841,11 +922,28 @@ export declare class Subscriptions extends APIResource {
841
922
  * a plan change, adjusting the customer balance as needed. For details on this
842
923
  * behavior, see
843
924
  * [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees).
925
+ *
926
+ * @example
927
+ * ```ts
928
+ * const mutatedSubscription =
929
+ * await client.subscriptions.schedulePlanChange(
930
+ * 'subscription_id',
931
+ * { change_option: 'requested_date' },
932
+ * );
933
+ * ```
844
934
  */
845
935
  schedulePlanChange(subscriptionId: string, body: SubscriptionSchedulePlanChangeParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
846
936
  /**
847
937
  * Manually trigger a phase, effective the given date (or the current time, if not
848
938
  * specified).
939
+ *
940
+ * @example
941
+ * ```ts
942
+ * const mutatedSubscription =
943
+ * await client.subscriptions.triggerPhase(
944
+ * 'subscription_id',
945
+ * );
946
+ * ```
849
947
  */
850
948
  triggerPhase(subscriptionId: string, body: SubscriptionTriggerPhaseParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
851
949
  /**
@@ -855,6 +953,20 @@ export declare class Subscriptions extends APIResource {
855
953
  * To be eligible, the subscription must currently be active and have a future
856
954
  * cancellation. This operation will turn on auto-renew, ensuring that the
857
955
  * subscription does not end at the currently scheduled cancellation time.
956
+ *
957
+ * Note: uncancellation is a lossy operation. Price intervals that were cut short
958
+ * by the cancellation are extended to infinity (original end dates are lost), and
959
+ * future intervals or phases scheduled after the cancellation time are permanently
960
+ * deleted. For complex subscriptions with phases or scheduled plan changes,
961
+ * consider creating a new plan change instead of uncancelling.
962
+ *
963
+ * @example
964
+ * ```ts
965
+ * const mutatedSubscription =
966
+ * await client.subscriptions.unscheduleCancellation(
967
+ * 'subscription_id',
968
+ * );
969
+ * ```
858
970
  */
859
971
  unscheduleCancellation(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
860
972
  /**
@@ -863,11 +975,28 @@ export declare class Subscriptions extends APIResource {
863
975
  *
864
976
  * If there are no updates scheduled, a request validation error will be returned
865
977
  * with a 400 status code.
978
+ *
979
+ * @example
980
+ * ```ts
981
+ * const mutatedSubscription =
982
+ * await client.subscriptions.unscheduleFixedFeeQuantityUpdates(
983
+ * 'subscription_id',
984
+ * { price_id: 'price_id' },
985
+ * );
986
+ * ```
866
987
  */
867
988
  unscheduleFixedFeeQuantityUpdates(subscriptionId: string, body: SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
868
989
  /**
869
990
  * This endpoint can be used to unschedule any pending plan changes on an existing
870
991
  * subscription. When called, all upcoming plan changes will be unscheduled.
992
+ *
993
+ * @example
994
+ * ```ts
995
+ * const mutatedSubscription =
996
+ * await client.subscriptions.unschedulePendingPlanChanges(
997
+ * 'subscription_id',
998
+ * );
999
+ * ```
871
1000
  */
872
1001
  unschedulePendingPlanChanges(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
873
1002
  /**
@@ -885,6 +1014,15 @@ export declare class Subscriptions extends APIResource {
885
1014
  *
886
1015
  * If the fee is an in-advance fixed fee, it will also issue an immediate invoice
887
1016
  * for the difference for the remainder of the billing period.
1017
+ *
1018
+ * @example
1019
+ * ```ts
1020
+ * const mutatedSubscription =
1021
+ * await client.subscriptions.updateFixedFeeQuantity(
1022
+ * 'subscription_id',
1023
+ * { price_id: 'price_id', quantity: 0 },
1024
+ * );
1025
+ * ```
888
1026
  */
889
1027
  updateFixedFeeQuantity(subscriptionId: string, body: SubscriptionUpdateFixedFeeQuantityParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
890
1028
  /**
@@ -906,6 +1044,15 @@ export declare class Subscriptions extends APIResource {
906
1044
  * end date shift (so, e.g., if a plan change is scheduled or an add-on price was
907
1045
  * added, that change will be pushed back by the same amount of time the trial is
908
1046
  * extended).
1047
+ *
1048
+ * @example
1049
+ * ```ts
1050
+ * const mutatedSubscription =
1051
+ * await client.subscriptions.updateTrial(
1052
+ * 'subscription_id',
1053
+ * { trial_end_date: '2017-07-21T17:32:28Z' },
1054
+ * );
1055
+ * ```
909
1056
  */
910
1057
  updateTrial(subscriptionId: string, body: SubscriptionUpdateTrialParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChangesAPI.MutatedSubscription>;
911
1058
  }
@@ -3700,6 +3847,13 @@ export interface Subscription {
3700
3847
  * the plan's behavior. If null, defaults to the customer's setting.
3701
3848
  */
3702
3849
  auto_collection: boolean | null;
3850
+ /**
3851
+ * Determines whether invoices for this subscription will be automatically issued.
3852
+ * This resolves the effective setting for the subscription: a subscription-level
3853
+ * override if set, otherwise the customer-level setting, otherwise the
3854
+ * account-level default.
3855
+ */
3856
+ auto_issuance: boolean | null;
3703
3857
  billing_cycle_anchor_configuration: Shared.BillingCycleAnchorConfiguration;
3704
3858
  /**
3705
3859
  * The day of the month on which the billing cycle is anchored. If the maximum
@@ -3751,7 +3905,7 @@ export interface Subscription {
3751
3905
  * @deprecated The discount intervals for this subscription sorted by the
3752
3906
  * start_date. This field is deprecated in favor of `adjustment_intervals`.
3753
3907
  */
3754
- discount_intervals: Array<Shared.AmountDiscountInterval | Shared.PercentageDiscountInterval | Shared.UsageDiscountInterval>;
3908
+ discount_intervals: Array<Shared.AmountDiscountInterval | Shared.PercentageDiscountInterval | Shared.UsageDiscountInterval | Subscription.TieredPercentageDiscountInterval>;
3755
3909
  /**
3756
3910
  * The date Orb stops billing for this subscription.
3757
3911
  */
@@ -3811,6 +3965,70 @@ export interface Subscription {
3811
3965
  status: 'active' | 'ended' | 'upcoming';
3812
3966
  trial_info: Shared.SubscriptionTrialInfo;
3813
3967
  }
3968
+ export declare namespace Subscription {
3969
+ interface TieredPercentageDiscountInterval {
3970
+ /**
3971
+ * The price interval ids that this discount interval applies to.
3972
+ */
3973
+ applies_to_price_interval_ids: Array<string>;
3974
+ discount_type: 'tiered_percentage';
3975
+ /**
3976
+ * The end date of the discount interval.
3977
+ */
3978
+ end_date: string | null;
3979
+ /**
3980
+ * The filters that determine which prices this discount interval applies to.
3981
+ */
3982
+ filters: Array<TieredPercentageDiscountInterval.Filter>;
3983
+ /**
3984
+ * The start date of the discount interval.
3985
+ */
3986
+ start_date: string;
3987
+ /**
3988
+ * Only available if discount_type is `tiered_percentage`. The ordered, contiguous
3989
+ * bands of cumulative eligible spend, each discounted at its own percentage.
3990
+ */
3991
+ tiers: Array<TieredPercentageDiscountInterval.Tier>;
3992
+ }
3993
+ namespace TieredPercentageDiscountInterval {
3994
+ interface Filter {
3995
+ /**
3996
+ * The property of the price to filter on.
3997
+ */
3998
+ field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
3999
+ /**
4000
+ * Should prices that match the filter be included or excluded.
4001
+ */
4002
+ operator: 'includes' | 'excludes';
4003
+ /**
4004
+ * The IDs or values that match this filter.
4005
+ */
4006
+ values: Array<string>;
4007
+ }
4008
+ /**
4009
+ * One band of a tiered percentage discount. Bounds are denominated in the
4010
+ * discount's currency. `lower_bound` is the exclusive start of the band and
4011
+ * `upper_bound` is the inclusive end; `upper_bound` is null only for the
4012
+ * open-ended final tier.
4013
+ */
4014
+ interface Tier {
4015
+ /**
4016
+ * Exclusive lower bound of cumulative spend for this tier.
4017
+ */
4018
+ lower_bound: number;
4019
+ /**
4020
+ * The percentage (between 0 and 1) discounted from spend that falls within this
4021
+ * tier.
4022
+ */
4023
+ percentage: number;
4024
+ /**
4025
+ * Inclusive upper bound of cumulative spend for this tier; null for the final
4026
+ * open-ended tier.
4027
+ */
4028
+ upper_bound?: number | null;
4029
+ }
4030
+ }
4031
+ }
3814
4032
  export type SubscriptionUsage = SubscriptionUsage.UngroupedSubscriptionUsage | SubscriptionUsage.GroupedSubscriptionUsage;
3815
4033
  export declare namespace SubscriptionUsage {
3816
4034
  interface UngroupedSubscriptionUsage {
@@ -3905,6 +4123,13 @@ export interface SubscriptionCreateParams {
3905
4123
  * defaults to the behavior configured for this customer.
3906
4124
  */
3907
4125
  auto_collection?: boolean | null;
4126
+ /**
4127
+ * Used to determine if invoices for this subscription will be automatically
4128
+ * issued. If true, invoices will be automatically issued. If false, invoices will
4129
+ * require manual approval. If `null` is specified, this defaults to the behavior
4130
+ * configured for this customer.
4131
+ */
4132
+ auto_issuance?: boolean | null;
3908
4133
  /**
3909
4134
  * @deprecated
3910
4135
  */
@@ -4043,7 +4268,7 @@ export declare namespace SubscriptionCreateParams {
4043
4268
  /**
4044
4269
  * The definition of a new adjustment to create and add to the subscription.
4045
4270
  */
4046
- adjustment: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum;
4271
+ adjustment: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum | AddAdjustment.NewTieredPercentageDiscount;
4047
4272
  /**
4048
4273
  * The end date of the adjustment interval. This is the date that the adjustment
4049
4274
  * will stop affecting prices on the subscription.
@@ -4060,6 +4285,71 @@ export declare namespace SubscriptionCreateParams {
4060
4285
  */
4061
4286
  start_date?: string | null;
4062
4287
  }
4288
+ namespace AddAdjustment {
4289
+ interface NewTieredPercentageDiscount {
4290
+ adjustment_type: 'tiered_percentage_discount';
4291
+ tiers: Array<NewTieredPercentageDiscount.Tier>;
4292
+ /**
4293
+ * If set, the adjustment will apply to every price on the subscription.
4294
+ */
4295
+ applies_to_all?: true | null;
4296
+ /**
4297
+ * The set of item IDs to which this adjustment applies.
4298
+ */
4299
+ applies_to_item_ids?: Array<string> | null;
4300
+ /**
4301
+ * The set of price IDs to which this adjustment applies.
4302
+ */
4303
+ applies_to_price_ids?: Array<string> | null;
4304
+ /**
4305
+ * If set, only prices in the specified currency will have the adjustment applied.
4306
+ */
4307
+ currency?: string | null;
4308
+ /**
4309
+ * A list of filters that determine which prices this adjustment will apply to.
4310
+ */
4311
+ filters?: Array<NewTieredPercentageDiscount.Filter> | null;
4312
+ /**
4313
+ * When false, this adjustment will be applied to a single price. Otherwise, it
4314
+ * will be applied at the invoice level, possibly to multiple prices.
4315
+ */
4316
+ is_invoice_level?: boolean;
4317
+ /**
4318
+ * If set, only prices of the specified type will have the adjustment applied.
4319
+ */
4320
+ price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null;
4321
+ }
4322
+ namespace NewTieredPercentageDiscount {
4323
+ interface Tier {
4324
+ /**
4325
+ * Exclusive lower bound of cumulative spend for this tier.
4326
+ */
4327
+ lower_bound: number;
4328
+ /**
4329
+ * The percentage (0-1) discounted from spend in this tier.
4330
+ */
4331
+ percentage: number;
4332
+ /**
4333
+ * Inclusive upper bound of cumulative spend; null for the final open-ended tier.
4334
+ */
4335
+ upper_bound?: number | null;
4336
+ }
4337
+ interface Filter {
4338
+ /**
4339
+ * The property of the price to filter on.
4340
+ */
4341
+ field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
4342
+ /**
4343
+ * Should prices that match the filter be included or excluded.
4344
+ */
4345
+ operator: 'includes' | 'excludes';
4346
+ /**
4347
+ * The IDs or values that match this filter.
4348
+ */
4349
+ values: Array<string>;
4350
+ }
4351
+ }
4352
+ }
4063
4353
  interface AddPrice {
4064
4354
  /**
4065
4355
  * The definition of a new allocation price to create and add to the subscription.
@@ -4104,7 +4394,7 @@ export declare namespace SubscriptionCreateParams {
4104
4394
  /**
4105
4395
  * New subscription price request body params.
4106
4396
  */
4107
- price?: SubscriptionsAPI.NewSubscriptionUnitPrice | SubscriptionsAPI.NewSubscriptionTieredPrice | SubscriptionsAPI.NewSubscriptionBulkPrice | AddPrice.NewSubscriptionBulkWithFiltersPrice | SubscriptionsAPI.NewSubscriptionPackagePrice | SubscriptionsAPI.NewSubscriptionMatrixPrice | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice | SubscriptionsAPI.NewSubscriptionTieredPackagePrice | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice | AddPrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | AddPrice.NewSubscriptionCumulativeGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice | AddPrice.NewSubscriptionPercentCompositePrice | AddPrice.NewSubscriptionEventOutputPrice | null;
4397
+ price?: SubscriptionsAPI.NewSubscriptionUnitPrice | SubscriptionsAPI.NewSubscriptionTieredPrice | SubscriptionsAPI.NewSubscriptionBulkPrice | AddPrice.NewSubscriptionBulkWithFiltersPrice | SubscriptionsAPI.NewSubscriptionPackagePrice | SubscriptionsAPI.NewSubscriptionMatrixPrice | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice | SubscriptionsAPI.NewSubscriptionTieredPackagePrice | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice | AddPrice.NewSubscriptionMatrixWithThresholdDiscountsPrice | AddPrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | AddPrice.NewSubscriptionCumulativeGroupedAllocationPrice | AddPrice.NewSubscriptionDailyCreditAllowancePrice | AddPrice.NewSubscriptionMeteredAllowancePrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice | AddPrice.NewSubscriptionPercentCompositePrice | AddPrice.NewSubscriptionEventOutputPrice | null;
4108
4398
  /**
4109
4399
  * The id of the price to add to the subscription.
4110
4400
  */
@@ -4249,6 +4539,145 @@ export declare namespace SubscriptionCreateParams {
4249
4539
  }
4250
4540
  }
4251
4541
  }
4542
+ interface NewSubscriptionMatrixWithThresholdDiscountsPrice {
4543
+ /**
4544
+ * The cadence to bill for this price on.
4545
+ */
4546
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
4547
+ /**
4548
+ * The id of the item the price will be associated with.
4549
+ */
4550
+ item_id: string;
4551
+ /**
4552
+ * Configuration for matrix_with_threshold_discounts pricing
4553
+ */
4554
+ matrix_with_threshold_discounts_config: NewSubscriptionMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig;
4555
+ /**
4556
+ * The pricing model type
4557
+ */
4558
+ model_type: 'matrix_with_threshold_discounts';
4559
+ /**
4560
+ * The name of the price.
4561
+ */
4562
+ name: string;
4563
+ /**
4564
+ * The id of the billable metric for the price. Only needed if the price is
4565
+ * usage-based.
4566
+ */
4567
+ billable_metric_id?: string | null;
4568
+ /**
4569
+ * If the Price represents a fixed cost, the price will be billed in-advance if
4570
+ * this is true, and in-arrears if this is false.
4571
+ */
4572
+ billed_in_advance?: boolean | null;
4573
+ /**
4574
+ * For custom cadence: specifies the duration of the billing period in days or
4575
+ * months.
4576
+ */
4577
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
4578
+ /**
4579
+ * The per unit conversion rate of the price currency to the invoicing currency.
4580
+ */
4581
+ conversion_rate?: number | null;
4582
+ /**
4583
+ * The configuration for the rate of the price currency to the invoicing currency.
4584
+ */
4585
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
4586
+ /**
4587
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
4588
+ * price is billed.
4589
+ */
4590
+ currency?: string | null;
4591
+ /**
4592
+ * For dimensional price: specifies a price group and dimension values
4593
+ */
4594
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
4595
+ /**
4596
+ * An alias for the price.
4597
+ */
4598
+ external_price_id?: string | null;
4599
+ /**
4600
+ * If the Price represents a fixed cost, this represents the quantity of units
4601
+ * applied.
4602
+ */
4603
+ fixed_price_quantity?: number | null;
4604
+ /**
4605
+ * The property used to group this price on an invoice
4606
+ */
4607
+ invoice_grouping_key?: string | null;
4608
+ /**
4609
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
4610
+ * If unspecified, a single invoice is produced per billing cycle.
4611
+ */
4612
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
4613
+ /**
4614
+ * The ID of the license type to associate with this price.
4615
+ */
4616
+ license_type_id?: string | null;
4617
+ /**
4618
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4619
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4620
+ * by setting `metadata` to `null`.
4621
+ */
4622
+ metadata?: {
4623
+ [key: string]: string | null;
4624
+ } | null;
4625
+ /**
4626
+ * A transient ID that can be used to reference this price when adding adjustments
4627
+ * in the same API call.
4628
+ */
4629
+ reference_id?: string | null;
4630
+ }
4631
+ namespace NewSubscriptionMatrixWithThresholdDiscountsPrice {
4632
+ /**
4633
+ * Configuration for matrix_with_threshold_discounts pricing
4634
+ */
4635
+ interface MatrixWithThresholdDiscountsConfig {
4636
+ /**
4637
+ * Unit price used for usage that does not match any defined matrix cell.
4638
+ */
4639
+ default_unit_amount: string;
4640
+ /**
4641
+ * First matrix dimension key.
4642
+ */
4643
+ first_dimension: string;
4644
+ /**
4645
+ * Per-cell unit prices.
4646
+ */
4647
+ matrix_values: Array<MatrixWithThresholdDiscountsConfig.MatrixValue>;
4648
+ /**
4649
+ * Optional second matrix dimension key.
4650
+ */
4651
+ second_dimension?: string | null;
4652
+ threshold_discount_groups?: Array<MatrixWithThresholdDiscountsConfig.ThresholdDiscountGroup>;
4653
+ }
4654
+ namespace MatrixWithThresholdDiscountsConfig {
4655
+ interface MatrixValue {
4656
+ first_dimension_value: string;
4657
+ unit_amount: string;
4658
+ second_dimension_value?: string | null;
4659
+ }
4660
+ interface ThresholdDiscountGroup {
4661
+ /**
4662
+ * Discount rate applied to spend above the threshold.
4663
+ */
4664
+ above_threshold_discount_percentage: string;
4665
+ /**
4666
+ * Discount rate applied to spend at or below the threshold. Set to 0 for no
4667
+ * baseline discount.
4668
+ */
4669
+ below_threshold_discount_percentage: string;
4670
+ /**
4671
+ * Semicolon-separated list of matrix cell coordinates targeted by this group. Each
4672
+ * coordinate is `first,second` when the matrix has two dimensions, or just `first`
4673
+ * for a single-dimension matrix. Example: `blue,circle;green,triangle`.
4674
+ */
4675
+ cell_coordinates: string;
4676
+ threshold_amount: string;
4677
+ description?: string | null;
4678
+ }
4679
+ }
4680
+ }
4252
4681
  interface NewSubscriptionTieredWithProrationPrice {
4253
4682
  /**
4254
4683
  * The cadence to bill for this price on.
@@ -4589,11 +5018,15 @@ export declare namespace SubscriptionCreateParams {
4589
5018
  unit_amount: string;
4590
5019
  }
4591
5020
  }
4592
- interface NewSubscriptionPercentCompositePrice {
5021
+ interface NewSubscriptionDailyCreditAllowancePrice {
4593
5022
  /**
4594
5023
  * The cadence to bill for this price on.
4595
5024
  */
4596
5025
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5026
+ /**
5027
+ * Configuration for daily_credit_allowance pricing
5028
+ */
5029
+ daily_credit_allowance_config: NewSubscriptionDailyCreditAllowancePrice.DailyCreditAllowanceConfig;
4597
5030
  /**
4598
5031
  * The id of the item the price will be associated with.
4599
5032
  */
@@ -4601,15 +5034,11 @@ export declare namespace SubscriptionCreateParams {
4601
5034
  /**
4602
5035
  * The pricing model type
4603
5036
  */
4604
- model_type: 'percent';
5037
+ model_type: 'daily_credit_allowance';
4605
5038
  /**
4606
5039
  * The name of the price.
4607
5040
  */
4608
5041
  name: string;
4609
- /**
4610
- * Configuration for percent pricing
4611
- */
4612
- percent_config: NewSubscriptionPercentCompositePrice.PercentConfig;
4613
5042
  /**
4614
5043
  * The id of the billable metric for the price. Only needed if the price is
4615
5044
  * usage-based.
@@ -4678,34 +5107,69 @@ export declare namespace SubscriptionCreateParams {
4678
5107
  */
4679
5108
  reference_id?: string | null;
4680
5109
  }
4681
- namespace NewSubscriptionPercentCompositePrice {
5110
+ namespace NewSubscriptionDailyCreditAllowancePrice {
4682
5111
  /**
4683
- * Configuration for percent pricing
5112
+ * Configuration for daily_credit_allowance pricing
4684
5113
  */
4685
- interface PercentConfig {
5114
+ interface DailyCreditAllowanceConfig {
4686
5115
  /**
4687
- * What percent of the component subtotals to charge
5116
+ * Credits granted per day. Lose-it-or-use-it; does not roll over.
4688
5117
  */
4689
- percent: number;
5118
+ daily_allowance: string;
5119
+ /**
5120
+ * Default per-unit credit rate for any usage not bucketed into a specified
5121
+ * matrix_value
5122
+ */
5123
+ default_unit_amount: string;
5124
+ /**
5125
+ * One or two event property values to evaluate matrix groups by
5126
+ */
5127
+ dimensions: Array<string | null>;
5128
+ /**
5129
+ * Event property whose value identifies the day bucket the event belongs to (e.g.
5130
+ * 'event_day' set to an ISO date string in the customer's timezone). The allowance
5131
+ * resets per distinct value of this property.
5132
+ */
5133
+ event_day_property: string;
5134
+ /**
5135
+ * Per-dimension credit rates
5136
+ */
5137
+ matrix_values: Array<DailyCreditAllowanceConfig.MatrixValue>;
4690
5138
  }
4691
- }
4692
- interface NewSubscriptionEventOutputPrice {
4693
- /**
4694
- * The cadence to bill for this price on.
4695
- */
4696
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
4697
- /**
4698
- * Configuration for event_output pricing
5139
+ namespace DailyCreditAllowanceConfig {
5140
+ /**
5141
+ * Per-dimension credit price for the daily credit allowance model.
5142
+ */
5143
+ interface MatrixValue {
5144
+ /**
5145
+ * One or two matrix keys to filter usage to this value by. For example, ["model"]
5146
+ * could be used to apply a different credit rate to each AI model.
5147
+ */
5148
+ dimension_values: Array<string | null>;
5149
+ /**
5150
+ * Credits charged per unit of usage matching the specified dimension_values
5151
+ */
5152
+ unit_amount: string;
5153
+ }
5154
+ }
5155
+ }
5156
+ interface NewSubscriptionMeteredAllowancePrice {
5157
+ /**
5158
+ * The cadence to bill for this price on.
4699
5159
  */
4700
- event_output_config: NewSubscriptionEventOutputPrice.EventOutputConfig;
5160
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
4701
5161
  /**
4702
5162
  * The id of the item the price will be associated with.
4703
5163
  */
4704
5164
  item_id: string;
5165
+ /**
5166
+ * Configuration for metered_allowance pricing
5167
+ */
5168
+ metered_allowance_config: NewSubscriptionMeteredAllowancePrice.MeteredAllowanceConfig;
4705
5169
  /**
4706
5170
  * The pricing model type
4707
5171
  */
4708
- model_type: 'event_output';
5172
+ model_type: 'metered_allowance';
4709
5173
  /**
4710
5174
  * The name of the price.
4711
5175
  */
@@ -4778,109 +5242,43 @@ export declare namespace SubscriptionCreateParams {
4778
5242
  */
4779
5243
  reference_id?: string | null;
4780
5244
  }
4781
- namespace NewSubscriptionEventOutputPrice {
5245
+ namespace NewSubscriptionMeteredAllowancePrice {
4782
5246
  /**
4783
- * Configuration for event_output pricing
5247
+ * Configuration for metered_allowance pricing
4784
5248
  */
4785
- interface EventOutputConfig {
5249
+ interface MeteredAllowanceConfig {
4786
5250
  /**
4787
- * The key in the event data to extract the unit rate from.
5251
+ * The grouping_key value whose summed quantity represents the allowance for this
5252
+ * period (e.g. 'storage_snapshot' emitting 3 × avg storage). Capped at consumption
5253
+ * — credit can never exceed actual usage.
4788
5254
  */
4789
- unit_rating_key: string;
5255
+ allowance_grouping_value: string;
4790
5256
  /**
4791
- * If provided, this amount will be used as the unit rate when an event does not
4792
- * have a value for the `unit_rating_key`. If not provided, events missing a unit
4793
- * rate will be ignored.
5257
+ * The grouping_key value whose summed quantity represents consumption (e.g.
5258
+ * 'download'). Charged at unit_amount.
4794
5259
  */
4795
- default_unit_rate?: string | null;
5260
+ consumption_grouping_value: string;
4796
5261
  /**
4797
- * An optional key in the event data to group by (e.g., event ID). All events will
4798
- * also be grouped by their unit rate.
5262
+ * Event property used to partition the metric into consumption and allowance
5263
+ * quantities (e.g. 'event_name'). The metric is queried with this key and the two
5264
+ * values below select which partition is which.
4799
5265
  */
4800
- grouping_key?: string | null;
5266
+ grouping_key: string;
5267
+ /**
5268
+ * Per-unit price applied to gross consumption and to the allowance credit.
5269
+ */
5270
+ unit_amount: string;
5271
+ /**
5272
+ * Sub-line label for the credit row (e.g. 'Up to 3x free egress').
5273
+ */
5274
+ allowance_display_name?: string;
5275
+ /**
5276
+ * Sub-line label for the gross consumption row (e.g. 'bytes gotten').
5277
+ */
5278
+ consumption_display_name?: string;
4801
5279
  }
4802
5280
  }
4803
- }
4804
- interface RemoveAdjustment {
4805
- /**
4806
- * The id of the adjustment to remove on the subscription.
4807
- */
4808
- adjustment_id: string;
4809
- }
4810
- interface RemovePrice {
4811
- /**
4812
- * The external price id of the price to remove on the subscription.
4813
- */
4814
- external_price_id?: string | null;
4815
- /**
4816
- * The id of the price to remove on the subscription.
4817
- */
4818
- price_id?: string | null;
4819
- }
4820
- interface ReplaceAdjustment {
4821
- /**
4822
- * The definition of a new adjustment to create and add to the subscription.
4823
- */
4824
- adjustment: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum;
4825
- /**
4826
- * The id of the adjustment on the plan to replace in the subscription.
4827
- */
4828
- replaces_adjustment_id: string;
4829
- }
4830
- interface ReplacePrice {
4831
- /**
4832
- * The id of the price on the plan to replace in the subscription.
4833
- */
4834
- replaces_price_id: string;
4835
- /**
4836
- * The definition of a new allocation price to create and add to the subscription.
4837
- */
4838
- allocation_price?: Shared.NewAllocationPrice | null;
4839
- /**
4840
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
4841
- * discounts for the replacement price.
4842
- */
4843
- discounts?: Array<SubscriptionsAPI.DiscountOverride> | null;
4844
- /**
4845
- * The external price id of the price to add to the subscription.
4846
- */
4847
- external_price_id?: string | null;
4848
- /**
4849
- * The new quantity of the price, if the price is a fixed price.
4850
- */
4851
- fixed_price_quantity?: number | null;
4852
- /**
4853
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
4854
- * amount for the replacement price.
4855
- */
4856
- maximum_amount?: string | null;
4857
- /**
4858
- * Override values for parameterized billable metric variables. Keys are parameter
4859
- * names, values are the override values.
4860
- */
4861
- metric_parameter_overrides?: {
4862
- [key: string]: unknown;
4863
- } | null;
4864
- /**
4865
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
4866
- * amount for the replacement price.
4867
- */
4868
- minimum_amount?: string | null;
4869
- /**
4870
- * New subscription price request body params.
4871
- */
4872
- price?: SubscriptionsAPI.NewSubscriptionUnitPrice | SubscriptionsAPI.NewSubscriptionTieredPrice | SubscriptionsAPI.NewSubscriptionBulkPrice | ReplacePrice.NewSubscriptionBulkWithFiltersPrice | SubscriptionsAPI.NewSubscriptionPackagePrice | SubscriptionsAPI.NewSubscriptionMatrixPrice | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice | SubscriptionsAPI.NewSubscriptionTieredPackagePrice | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice | ReplacePrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | ReplacePrice.NewSubscriptionCumulativeGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice | ReplacePrice.NewSubscriptionPercentCompositePrice | ReplacePrice.NewSubscriptionEventOutputPrice | null;
4873
- /**
4874
- * The id of the price to add to the subscription.
4875
- */
4876
- price_id?: string | null;
4877
- }
4878
- namespace ReplacePrice {
4879
- interface NewSubscriptionBulkWithFiltersPrice {
4880
- /**
4881
- * Configuration for bulk_with_filters pricing
4882
- */
4883
- bulk_with_filters_config: NewSubscriptionBulkWithFiltersPrice.BulkWithFiltersConfig;
5281
+ interface NewSubscriptionPercentCompositePrice {
4884
5282
  /**
4885
5283
  * The cadence to bill for this price on.
4886
5284
  */
@@ -4892,11 +5290,15 @@ export declare namespace SubscriptionCreateParams {
4892
5290
  /**
4893
5291
  * The pricing model type
4894
5292
  */
4895
- model_type: 'bulk_with_filters';
5293
+ model_type: 'percent';
4896
5294
  /**
4897
5295
  * The name of the price.
4898
5296
  */
4899
5297
  name: string;
5298
+ /**
5299
+ * Configuration for percent pricing
5300
+ */
5301
+ percent_config: NewSubscriptionPercentCompositePrice.PercentConfig;
4900
5302
  /**
4901
5303
  * The id of the billable metric for the price. Only needed if the price is
4902
5304
  * usage-based.
@@ -4965,54 +5367,40 @@ export declare namespace SubscriptionCreateParams {
4965
5367
  */
4966
5368
  reference_id?: string | null;
4967
5369
  }
4968
- namespace NewSubscriptionBulkWithFiltersPrice {
5370
+ namespace NewSubscriptionPercentCompositePrice {
4969
5371
  /**
4970
- * Configuration for bulk_with_filters pricing
5372
+ * Configuration for percent pricing
4971
5373
  */
4972
- interface BulkWithFiltersConfig {
5374
+ interface PercentConfig {
4973
5375
  /**
4974
- * Property filters to apply (all must match)
5376
+ * Fraction of the component subtotals to charge (0 < percent <= 1).
4975
5377
  */
4976
- filters: Array<BulkWithFiltersConfig.Filter>;
5378
+ percent: number;
4977
5379
  /**
4978
- * Bulk tiers for rating based on total usage volume
5380
+ * Maximum amount to charge. If unset, the fee has no upper bound.
4979
5381
  */
4980
- tiers: Array<BulkWithFiltersConfig.Tier>;
4981
- }
4982
- namespace BulkWithFiltersConfig {
5382
+ maximum_amount?: string | null;
4983
5383
  /**
4984
- * Configuration for a single property filter
5384
+ * Minimum amount to charge. If unset, the fee is bounded below by 0.
4985
5385
  */
4986
- interface Filter {
4987
- /**
4988
- * Event property key to filter on
4989
- */
4990
- property_key: string;
4991
- /**
4992
- * Event property value to match
4993
- */
4994
- property_value: string;
4995
- }
5386
+ minimum_amount?: string | null;
4996
5387
  /**
4997
- * Configuration for a single bulk pricing tier
5388
+ * If true, the minimum_amount is prorated based on the service period. The
5389
+ * maximum_amount is an absolute cap (never prorated), and the percent applied to
5390
+ * upstream subtotals is never prorated either.
4998
5391
  */
4999
- interface Tier {
5000
- /**
5001
- * Amount per unit
5002
- */
5003
- unit_amount: string;
5004
- /**
5005
- * The lower bound for this tier
5006
- */
5007
- tier_lower_bound?: string | null;
5008
- }
5392
+ prorated?: boolean;
5009
5393
  }
5010
5394
  }
5011
- interface NewSubscriptionTieredWithProrationPrice {
5395
+ interface NewSubscriptionEventOutputPrice {
5012
5396
  /**
5013
5397
  * The cadence to bill for this price on.
5014
5398
  */
5015
5399
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5400
+ /**
5401
+ * Configuration for event_output pricing
5402
+ */
5403
+ event_output_config: NewSubscriptionEventOutputPrice.EventOutputConfig;
5016
5404
  /**
5017
5405
  * The id of the item the price will be associated with.
5018
5406
  */
@@ -5020,15 +5408,11 @@ export declare namespace SubscriptionCreateParams {
5020
5408
  /**
5021
5409
  * The pricing model type
5022
5410
  */
5023
- model_type: 'tiered_with_proration';
5411
+ model_type: 'event_output';
5024
5412
  /**
5025
5413
  * The name of the price.
5026
5414
  */
5027
5415
  name: string;
5028
- /**
5029
- * Configuration for tiered_with_proration pricing
5030
- */
5031
- tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig;
5032
5416
  /**
5033
5417
  * The id of the billable metric for the price. Only needed if the price is
5034
5418
  * usage-based.
@@ -5097,73 +5481,209 @@ export declare namespace SubscriptionCreateParams {
5097
5481
  */
5098
5482
  reference_id?: string | null;
5099
5483
  }
5100
- namespace NewSubscriptionTieredWithProrationPrice {
5484
+ namespace NewSubscriptionEventOutputPrice {
5101
5485
  /**
5102
- * Configuration for tiered_with_proration pricing
5486
+ * Configuration for event_output pricing
5103
5487
  */
5104
- interface TieredWithProrationConfig {
5488
+ interface EventOutputConfig {
5105
5489
  /**
5106
- * Tiers for rating based on total usage quantities into the specified tier with
5107
- * proration
5490
+ * The key in the event data to extract the unit rate from.
5108
5491
  */
5109
- tiers: Array<TieredWithProrationConfig.Tier>;
5110
- }
5111
- namespace TieredWithProrationConfig {
5492
+ unit_rating_key: string;
5112
5493
  /**
5113
- * Configuration for a single tiered with proration tier
5494
+ * If provided, this amount will be used as the unit rate when an event does not
5495
+ * have a value for the `unit_rating_key`. If not provided, events missing a unit
5496
+ * rate will be ignored.
5114
5497
  */
5115
- interface Tier {
5116
- /**
5117
- * Inclusive tier starting value
5118
- */
5119
- tier_lower_bound: string;
5120
- /**
5121
- * Amount per unit
5122
- */
5123
- unit_amount: string;
5124
- }
5498
+ default_unit_rate?: string | null;
5499
+ /**
5500
+ * An optional key in the event data to group by (e.g., event ID). All events will
5501
+ * also be grouped by their unit rate.
5502
+ */
5503
+ grouping_key?: string | null;
5125
5504
  }
5126
5505
  }
5127
- interface NewSubscriptionGroupedWithMinMaxThresholdsPrice {
5128
- /**
5129
- * The cadence to bill for this price on.
5130
- */
5131
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5132
- /**
5133
- * Configuration for grouped_with_min_max_thresholds pricing
5134
- */
5135
- grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
5506
+ }
5507
+ interface RemoveAdjustment {
5508
+ /**
5509
+ * The id of the adjustment to remove on the subscription.
5510
+ */
5511
+ adjustment_id: string;
5512
+ }
5513
+ interface RemovePrice {
5514
+ /**
5515
+ * The external price id of the price to remove on the subscription.
5516
+ */
5517
+ external_price_id?: string | null;
5518
+ /**
5519
+ * The id of the price to remove on the subscription.
5520
+ */
5521
+ price_id?: string | null;
5522
+ }
5523
+ interface ReplaceAdjustment {
5524
+ /**
5525
+ * The definition of a new adjustment to create and add to the subscription.
5526
+ */
5527
+ adjustment: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum | ReplaceAdjustment.NewTieredPercentageDiscount;
5528
+ /**
5529
+ * The id of the adjustment on the plan to replace in the subscription.
5530
+ */
5531
+ replaces_adjustment_id: string;
5532
+ }
5533
+ namespace ReplaceAdjustment {
5534
+ interface NewTieredPercentageDiscount {
5535
+ adjustment_type: 'tiered_percentage_discount';
5536
+ tiers: Array<NewTieredPercentageDiscount.Tier>;
5136
5537
  /**
5137
- * The id of the item the price will be associated with.
5538
+ * If set, the adjustment will apply to every price on the subscription.
5138
5539
  */
5139
- item_id: string;
5540
+ applies_to_all?: true | null;
5140
5541
  /**
5141
- * The pricing model type
5542
+ * The set of item IDs to which this adjustment applies.
5142
5543
  */
5143
- model_type: 'grouped_with_min_max_thresholds';
5544
+ applies_to_item_ids?: Array<string> | null;
5144
5545
  /**
5145
- * The name of the price.
5546
+ * The set of price IDs to which this adjustment applies.
5146
5547
  */
5147
- name: string;
5548
+ applies_to_price_ids?: Array<string> | null;
5148
5549
  /**
5149
- * The id of the billable metric for the price. Only needed if the price is
5150
- * usage-based.
5550
+ * If set, only prices in the specified currency will have the adjustment applied.
5151
5551
  */
5152
- billable_metric_id?: string | null;
5552
+ currency?: string | null;
5153
5553
  /**
5154
- * If the Price represents a fixed cost, the price will be billed in-advance if
5155
- * this is true, and in-arrears if this is false.
5554
+ * A list of filters that determine which prices this adjustment will apply to.
5156
5555
  */
5157
- billed_in_advance?: boolean | null;
5556
+ filters?: Array<NewTieredPercentageDiscount.Filter> | null;
5158
5557
  /**
5159
- * For custom cadence: specifies the duration of the billing period in days or
5160
- * months.
5558
+ * When false, this adjustment will be applied to a single price. Otherwise, it
5559
+ * will be applied at the invoice level, possibly to multiple prices.
5161
5560
  */
5162
- billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5561
+ is_invoice_level?: boolean;
5163
5562
  /**
5164
- * The per unit conversion rate of the price currency to the invoicing currency.
5563
+ * If set, only prices of the specified type will have the adjustment applied.
5165
5564
  */
5166
- conversion_rate?: number | null;
5565
+ price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null;
5566
+ }
5567
+ namespace NewTieredPercentageDiscount {
5568
+ interface Tier {
5569
+ /**
5570
+ * Exclusive lower bound of cumulative spend for this tier.
5571
+ */
5572
+ lower_bound: number;
5573
+ /**
5574
+ * The percentage (0-1) discounted from spend in this tier.
5575
+ */
5576
+ percentage: number;
5577
+ /**
5578
+ * Inclusive upper bound of cumulative spend; null for the final open-ended tier.
5579
+ */
5580
+ upper_bound?: number | null;
5581
+ }
5582
+ interface Filter {
5583
+ /**
5584
+ * The property of the price to filter on.
5585
+ */
5586
+ field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
5587
+ /**
5588
+ * Should prices that match the filter be included or excluded.
5589
+ */
5590
+ operator: 'includes' | 'excludes';
5591
+ /**
5592
+ * The IDs or values that match this filter.
5593
+ */
5594
+ values: Array<string>;
5595
+ }
5596
+ }
5597
+ }
5598
+ interface ReplacePrice {
5599
+ /**
5600
+ * The id of the price on the plan to replace in the subscription.
5601
+ */
5602
+ replaces_price_id: string;
5603
+ /**
5604
+ * The definition of a new allocation price to create and add to the subscription.
5605
+ */
5606
+ allocation_price?: Shared.NewAllocationPrice | null;
5607
+ /**
5608
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
5609
+ * discounts for the replacement price.
5610
+ */
5611
+ discounts?: Array<SubscriptionsAPI.DiscountOverride> | null;
5612
+ /**
5613
+ * The external price id of the price to add to the subscription.
5614
+ */
5615
+ external_price_id?: string | null;
5616
+ /**
5617
+ * The new quantity of the price, if the price is a fixed price.
5618
+ */
5619
+ fixed_price_quantity?: number | null;
5620
+ /**
5621
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
5622
+ * amount for the replacement price.
5623
+ */
5624
+ maximum_amount?: string | null;
5625
+ /**
5626
+ * Override values for parameterized billable metric variables. Keys are parameter
5627
+ * names, values are the override values.
5628
+ */
5629
+ metric_parameter_overrides?: {
5630
+ [key: string]: unknown;
5631
+ } | null;
5632
+ /**
5633
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
5634
+ * amount for the replacement price.
5635
+ */
5636
+ minimum_amount?: string | null;
5637
+ /**
5638
+ * New subscription price request body params.
5639
+ */
5640
+ price?: SubscriptionsAPI.NewSubscriptionUnitPrice | SubscriptionsAPI.NewSubscriptionTieredPrice | SubscriptionsAPI.NewSubscriptionBulkPrice | ReplacePrice.NewSubscriptionBulkWithFiltersPrice | SubscriptionsAPI.NewSubscriptionPackagePrice | SubscriptionsAPI.NewSubscriptionMatrixPrice | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice | SubscriptionsAPI.NewSubscriptionTieredPackagePrice | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice | ReplacePrice.NewSubscriptionMatrixWithThresholdDiscountsPrice | ReplacePrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | ReplacePrice.NewSubscriptionCumulativeGroupedAllocationPrice | ReplacePrice.NewSubscriptionDailyCreditAllowancePrice | ReplacePrice.NewSubscriptionMeteredAllowancePrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice | ReplacePrice.NewSubscriptionPercentCompositePrice | ReplacePrice.NewSubscriptionEventOutputPrice | null;
5641
+ /**
5642
+ * The id of the price to add to the subscription.
5643
+ */
5644
+ price_id?: string | null;
5645
+ }
5646
+ namespace ReplacePrice {
5647
+ interface NewSubscriptionBulkWithFiltersPrice {
5648
+ /**
5649
+ * Configuration for bulk_with_filters pricing
5650
+ */
5651
+ bulk_with_filters_config: NewSubscriptionBulkWithFiltersPrice.BulkWithFiltersConfig;
5652
+ /**
5653
+ * The cadence to bill for this price on.
5654
+ */
5655
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5656
+ /**
5657
+ * The id of the item the price will be associated with.
5658
+ */
5659
+ item_id: string;
5660
+ /**
5661
+ * The pricing model type
5662
+ */
5663
+ model_type: 'bulk_with_filters';
5664
+ /**
5665
+ * The name of the price.
5666
+ */
5667
+ name: string;
5668
+ /**
5669
+ * The id of the billable metric for the price. Only needed if the price is
5670
+ * usage-based.
5671
+ */
5672
+ billable_metric_id?: string | null;
5673
+ /**
5674
+ * If the Price represents a fixed cost, the price will be billed in-advance if
5675
+ * this is true, and in-arrears if this is false.
5676
+ */
5677
+ billed_in_advance?: boolean | null;
5678
+ /**
5679
+ * For custom cadence: specifies the duration of the billing period in days or
5680
+ * months.
5681
+ */
5682
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5683
+ /**
5684
+ * The per unit conversion rate of the price currency to the invoicing currency.
5685
+ */
5686
+ conversion_rate?: number | null;
5167
5687
  /**
5168
5688
  * The configuration for the rate of the price currency to the invoicing currency.
5169
5689
  */
@@ -5213,46 +5733,66 @@ export declare namespace SubscriptionCreateParams {
5213
5733
  */
5214
5734
  reference_id?: string | null;
5215
5735
  }
5216
- namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice {
5736
+ namespace NewSubscriptionBulkWithFiltersPrice {
5217
5737
  /**
5218
- * Configuration for grouped_with_min_max_thresholds pricing
5738
+ * Configuration for bulk_with_filters pricing
5219
5739
  */
5220
- interface GroupedWithMinMaxThresholdsConfig {
5740
+ interface BulkWithFiltersConfig {
5221
5741
  /**
5222
- * The event property used to group before applying thresholds
5742
+ * Property filters to apply (all must match)
5223
5743
  */
5224
- grouping_key: string;
5744
+ filters: Array<BulkWithFiltersConfig.Filter>;
5225
5745
  /**
5226
- * The maximum amount to charge each group
5746
+ * Bulk tiers for rating based on total usage volume
5227
5747
  */
5228
- maximum_charge: string;
5748
+ tiers: Array<BulkWithFiltersConfig.Tier>;
5749
+ }
5750
+ namespace BulkWithFiltersConfig {
5229
5751
  /**
5230
- * The minimum amount to charge each group, regardless of usage
5752
+ * Configuration for a single property filter
5231
5753
  */
5232
- minimum_charge: string;
5754
+ interface Filter {
5755
+ /**
5756
+ * Event property key to filter on
5757
+ */
5758
+ property_key: string;
5759
+ /**
5760
+ * Event property value to match
5761
+ */
5762
+ property_value: string;
5763
+ }
5233
5764
  /**
5234
- * The base price charged per group
5765
+ * Configuration for a single bulk pricing tier
5235
5766
  */
5236
- per_unit_rate: string;
5767
+ interface Tier {
5768
+ /**
5769
+ * Amount per unit
5770
+ */
5771
+ unit_amount: string;
5772
+ /**
5773
+ * The lower bound for this tier
5774
+ */
5775
+ tier_lower_bound?: string | null;
5776
+ }
5237
5777
  }
5238
5778
  }
5239
- interface NewSubscriptionCumulativeGroupedAllocationPrice {
5779
+ interface NewSubscriptionMatrixWithThresholdDiscountsPrice {
5240
5780
  /**
5241
5781
  * The cadence to bill for this price on.
5242
5782
  */
5243
5783
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5244
- /**
5245
- * Configuration for cumulative_grouped_allocation pricing
5246
- */
5247
- cumulative_grouped_allocation_config: NewSubscriptionCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig;
5248
5784
  /**
5249
5785
  * The id of the item the price will be associated with.
5250
5786
  */
5251
5787
  item_id: string;
5788
+ /**
5789
+ * Configuration for matrix_with_threshold_discounts pricing
5790
+ */
5791
+ matrix_with_threshold_discounts_config: NewSubscriptionMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig;
5252
5792
  /**
5253
5793
  * The pricing model type
5254
5794
  */
5255
- model_type: 'cumulative_grouped_allocation';
5795
+ model_type: 'matrix_with_threshold_discounts';
5256
5796
  /**
5257
5797
  * The name of the price.
5258
5798
  */
@@ -5325,30 +5865,57 @@ export declare namespace SubscriptionCreateParams {
5325
5865
  */
5326
5866
  reference_id?: string | null;
5327
5867
  }
5328
- namespace NewSubscriptionCumulativeGroupedAllocationPrice {
5868
+ namespace NewSubscriptionMatrixWithThresholdDiscountsPrice {
5329
5869
  /**
5330
- * Configuration for cumulative_grouped_allocation pricing
5870
+ * Configuration for matrix_with_threshold_discounts pricing
5331
5871
  */
5332
- interface CumulativeGroupedAllocationConfig {
5872
+ interface MatrixWithThresholdDiscountsConfig {
5333
5873
  /**
5334
- * The overall allocation across all groups
5874
+ * Unit price used for usage that does not match any defined matrix cell.
5335
5875
  */
5336
- cumulative_allocation: string;
5876
+ default_unit_amount: string;
5337
5877
  /**
5338
- * The allocation per individual group
5878
+ * First matrix dimension key.
5339
5879
  */
5340
- group_allocation: string;
5880
+ first_dimension: string;
5341
5881
  /**
5342
- * The event property used to group usage before applying allocations
5882
+ * Per-cell unit prices.
5343
5883
  */
5344
- grouping_key: string;
5884
+ matrix_values: Array<MatrixWithThresholdDiscountsConfig.MatrixValue>;
5345
5885
  /**
5346
- * The amount to charge for each unit outside of the allocation
5886
+ * Optional second matrix dimension key.
5347
5887
  */
5348
- unit_amount: string;
5888
+ second_dimension?: string | null;
5889
+ threshold_discount_groups?: Array<MatrixWithThresholdDiscountsConfig.ThresholdDiscountGroup>;
5890
+ }
5891
+ namespace MatrixWithThresholdDiscountsConfig {
5892
+ interface MatrixValue {
5893
+ first_dimension_value: string;
5894
+ unit_amount: string;
5895
+ second_dimension_value?: string | null;
5896
+ }
5897
+ interface ThresholdDiscountGroup {
5898
+ /**
5899
+ * Discount rate applied to spend above the threshold.
5900
+ */
5901
+ above_threshold_discount_percentage: string;
5902
+ /**
5903
+ * Discount rate applied to spend at or below the threshold. Set to 0 for no
5904
+ * baseline discount.
5905
+ */
5906
+ below_threshold_discount_percentage: string;
5907
+ /**
5908
+ * Semicolon-separated list of matrix cell coordinates targeted by this group. Each
5909
+ * coordinate is `first,second` when the matrix has two dimensions, or just `first`
5910
+ * for a single-dimension matrix. Example: `blue,circle;green,triangle`.
5911
+ */
5912
+ cell_coordinates: string;
5913
+ threshold_amount: string;
5914
+ description?: string | null;
5915
+ }
5349
5916
  }
5350
5917
  }
5351
- interface NewSubscriptionPercentCompositePrice {
5918
+ interface NewSubscriptionTieredWithProrationPrice {
5352
5919
  /**
5353
5920
  * The cadence to bill for this price on.
5354
5921
  */
@@ -5360,15 +5927,15 @@ export declare namespace SubscriptionCreateParams {
5360
5927
  /**
5361
5928
  * The pricing model type
5362
5929
  */
5363
- model_type: 'percent';
5930
+ model_type: 'tiered_with_proration';
5364
5931
  /**
5365
5932
  * The name of the price.
5366
5933
  */
5367
5934
  name: string;
5368
5935
  /**
5369
- * Configuration for percent pricing
5936
+ * Configuration for tiered_with_proration pricing
5370
5937
  */
5371
- percent_config: NewSubscriptionPercentCompositePrice.PercentConfig;
5938
+ tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig;
5372
5939
  /**
5373
5940
  * The id of the billable metric for the price. Only needed if the price is
5374
5941
  * usage-based.
@@ -5437,26 +6004,42 @@ export declare namespace SubscriptionCreateParams {
5437
6004
  */
5438
6005
  reference_id?: string | null;
5439
6006
  }
5440
- namespace NewSubscriptionPercentCompositePrice {
6007
+ namespace NewSubscriptionTieredWithProrationPrice {
5441
6008
  /**
5442
- * Configuration for percent pricing
6009
+ * Configuration for tiered_with_proration pricing
5443
6010
  */
5444
- interface PercentConfig {
6011
+ interface TieredWithProrationConfig {
6012
+ /**
6013
+ * Tiers for rating based on total usage quantities into the specified tier with
6014
+ * proration
6015
+ */
6016
+ tiers: Array<TieredWithProrationConfig.Tier>;
6017
+ }
6018
+ namespace TieredWithProrationConfig {
5445
6019
  /**
5446
- * What percent of the component subtotals to charge
6020
+ * Configuration for a single tiered with proration tier
5447
6021
  */
5448
- percent: number;
6022
+ interface Tier {
6023
+ /**
6024
+ * Inclusive tier starting value
6025
+ */
6026
+ tier_lower_bound: string;
6027
+ /**
6028
+ * Amount per unit
6029
+ */
6030
+ unit_amount: string;
6031
+ }
5449
6032
  }
5450
6033
  }
5451
- interface NewSubscriptionEventOutputPrice {
6034
+ interface NewSubscriptionGroupedWithMinMaxThresholdsPrice {
5452
6035
  /**
5453
6036
  * The cadence to bill for this price on.
5454
6037
  */
5455
6038
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5456
6039
  /**
5457
- * Configuration for event_output pricing
6040
+ * Configuration for grouped_with_min_max_thresholds pricing
5458
6041
  */
5459
- event_output_config: NewSubscriptionEventOutputPrice.EventOutputConfig;
6042
+ grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
5460
6043
  /**
5461
6044
  * The id of the item the price will be associated with.
5462
6045
  */
@@ -5464,7 +6047,7 @@ export declare namespace SubscriptionCreateParams {
5464
6047
  /**
5465
6048
  * The pricing model type
5466
6049
  */
5467
- model_type: 'event_output';
6050
+ model_type: 'grouped_with_min_max_thresholds';
5468
6051
  /**
5469
6052
  * The name of the price.
5470
6053
  */
@@ -5537,42 +6120,647 @@ export declare namespace SubscriptionCreateParams {
5537
6120
  */
5538
6121
  reference_id?: string | null;
5539
6122
  }
5540
- namespace NewSubscriptionEventOutputPrice {
6123
+ namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice {
5541
6124
  /**
5542
- * Configuration for event_output pricing
6125
+ * Configuration for grouped_with_min_max_thresholds pricing
5543
6126
  */
5544
- interface EventOutputConfig {
6127
+ interface GroupedWithMinMaxThresholdsConfig {
5545
6128
  /**
5546
- * The key in the event data to extract the unit rate from.
6129
+ * The event property used to group before applying thresholds
5547
6130
  */
5548
- unit_rating_key: string;
6131
+ grouping_key: string;
5549
6132
  /**
5550
- * If provided, this amount will be used as the unit rate when an event does not
5551
- * have a value for the `unit_rating_key`. If not provided, events missing a unit
5552
- * rate will be ignored.
6133
+ * The maximum amount to charge each group
5553
6134
  */
5554
- default_unit_rate?: string | null;
6135
+ maximum_charge: string;
5555
6136
  /**
5556
- * An optional key in the event data to group by (e.g., event ID). All events will
5557
- * also be grouped by their unit rate.
6137
+ * The minimum amount to charge each group, regardless of usage
5558
6138
  */
5559
- grouping_key?: string | null;
6139
+ minimum_charge: string;
6140
+ /**
6141
+ * The base price charged per group
6142
+ */
6143
+ per_unit_rate: string;
5560
6144
  }
5561
6145
  }
5562
- }
5563
- }
5564
- export interface SubscriptionUpdateParams {
5565
- /**
5566
- * Determines whether issued invoices for this subscription will automatically be
5567
- * charged with the saved payment method on the due date. This property defaults to
5568
- * the plan's behavior.
5569
- */
5570
- auto_collection?: boolean | null;
5571
- /**
5572
- * Determines the default memo on this subscription's invoices. Note that if this
5573
- * is not provided, it is determined by the plan configuration.
5574
- */
5575
- default_invoice_memo?: string | null;
6146
+ interface NewSubscriptionCumulativeGroupedAllocationPrice {
6147
+ /**
6148
+ * The cadence to bill for this price on.
6149
+ */
6150
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6151
+ /**
6152
+ * Configuration for cumulative_grouped_allocation pricing
6153
+ */
6154
+ cumulative_grouped_allocation_config: NewSubscriptionCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig;
6155
+ /**
6156
+ * The id of the item the price will be associated with.
6157
+ */
6158
+ item_id: string;
6159
+ /**
6160
+ * The pricing model type
6161
+ */
6162
+ model_type: 'cumulative_grouped_allocation';
6163
+ /**
6164
+ * The name of the price.
6165
+ */
6166
+ name: string;
6167
+ /**
6168
+ * The id of the billable metric for the price. Only needed if the price is
6169
+ * usage-based.
6170
+ */
6171
+ billable_metric_id?: string | null;
6172
+ /**
6173
+ * If the Price represents a fixed cost, the price will be billed in-advance if
6174
+ * this is true, and in-arrears if this is false.
6175
+ */
6176
+ billed_in_advance?: boolean | null;
6177
+ /**
6178
+ * For custom cadence: specifies the duration of the billing period in days or
6179
+ * months.
6180
+ */
6181
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6182
+ /**
6183
+ * The per unit conversion rate of the price currency to the invoicing currency.
6184
+ */
6185
+ conversion_rate?: number | null;
6186
+ /**
6187
+ * The configuration for the rate of the price currency to the invoicing currency.
6188
+ */
6189
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
6190
+ /**
6191
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
6192
+ * price is billed.
6193
+ */
6194
+ currency?: string | null;
6195
+ /**
6196
+ * For dimensional price: specifies a price group and dimension values
6197
+ */
6198
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
6199
+ /**
6200
+ * An alias for the price.
6201
+ */
6202
+ external_price_id?: string | null;
6203
+ /**
6204
+ * If the Price represents a fixed cost, this represents the quantity of units
6205
+ * applied.
6206
+ */
6207
+ fixed_price_quantity?: number | null;
6208
+ /**
6209
+ * The property used to group this price on an invoice
6210
+ */
6211
+ invoice_grouping_key?: string | null;
6212
+ /**
6213
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
6214
+ * If unspecified, a single invoice is produced per billing cycle.
6215
+ */
6216
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6217
+ /**
6218
+ * The ID of the license type to associate with this price.
6219
+ */
6220
+ license_type_id?: string | null;
6221
+ /**
6222
+ * User-specified key/value pairs for the resource. Individual keys can be removed
6223
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
6224
+ * by setting `metadata` to `null`.
6225
+ */
6226
+ metadata?: {
6227
+ [key: string]: string | null;
6228
+ } | null;
6229
+ /**
6230
+ * A transient ID that can be used to reference this price when adding adjustments
6231
+ * in the same API call.
6232
+ */
6233
+ reference_id?: string | null;
6234
+ }
6235
+ namespace NewSubscriptionCumulativeGroupedAllocationPrice {
6236
+ /**
6237
+ * Configuration for cumulative_grouped_allocation pricing
6238
+ */
6239
+ interface CumulativeGroupedAllocationConfig {
6240
+ /**
6241
+ * The overall allocation across all groups
6242
+ */
6243
+ cumulative_allocation: string;
6244
+ /**
6245
+ * The allocation per individual group
6246
+ */
6247
+ group_allocation: string;
6248
+ /**
6249
+ * The event property used to group usage before applying allocations
6250
+ */
6251
+ grouping_key: string;
6252
+ /**
6253
+ * The amount to charge for each unit outside of the allocation
6254
+ */
6255
+ unit_amount: string;
6256
+ }
6257
+ }
6258
+ interface NewSubscriptionDailyCreditAllowancePrice {
6259
+ /**
6260
+ * The cadence to bill for this price on.
6261
+ */
6262
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6263
+ /**
6264
+ * Configuration for daily_credit_allowance pricing
6265
+ */
6266
+ daily_credit_allowance_config: NewSubscriptionDailyCreditAllowancePrice.DailyCreditAllowanceConfig;
6267
+ /**
6268
+ * The id of the item the price will be associated with.
6269
+ */
6270
+ item_id: string;
6271
+ /**
6272
+ * The pricing model type
6273
+ */
6274
+ model_type: 'daily_credit_allowance';
6275
+ /**
6276
+ * The name of the price.
6277
+ */
6278
+ name: string;
6279
+ /**
6280
+ * The id of the billable metric for the price. Only needed if the price is
6281
+ * usage-based.
6282
+ */
6283
+ billable_metric_id?: string | null;
6284
+ /**
6285
+ * If the Price represents a fixed cost, the price will be billed in-advance if
6286
+ * this is true, and in-arrears if this is false.
6287
+ */
6288
+ billed_in_advance?: boolean | null;
6289
+ /**
6290
+ * For custom cadence: specifies the duration of the billing period in days or
6291
+ * months.
6292
+ */
6293
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6294
+ /**
6295
+ * The per unit conversion rate of the price currency to the invoicing currency.
6296
+ */
6297
+ conversion_rate?: number | null;
6298
+ /**
6299
+ * The configuration for the rate of the price currency to the invoicing currency.
6300
+ */
6301
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
6302
+ /**
6303
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
6304
+ * price is billed.
6305
+ */
6306
+ currency?: string | null;
6307
+ /**
6308
+ * For dimensional price: specifies a price group and dimension values
6309
+ */
6310
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
6311
+ /**
6312
+ * An alias for the price.
6313
+ */
6314
+ external_price_id?: string | null;
6315
+ /**
6316
+ * If the Price represents a fixed cost, this represents the quantity of units
6317
+ * applied.
6318
+ */
6319
+ fixed_price_quantity?: number | null;
6320
+ /**
6321
+ * The property used to group this price on an invoice
6322
+ */
6323
+ invoice_grouping_key?: string | null;
6324
+ /**
6325
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
6326
+ * If unspecified, a single invoice is produced per billing cycle.
6327
+ */
6328
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6329
+ /**
6330
+ * The ID of the license type to associate with this price.
6331
+ */
6332
+ license_type_id?: string | null;
6333
+ /**
6334
+ * User-specified key/value pairs for the resource. Individual keys can be removed
6335
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
6336
+ * by setting `metadata` to `null`.
6337
+ */
6338
+ metadata?: {
6339
+ [key: string]: string | null;
6340
+ } | null;
6341
+ /**
6342
+ * A transient ID that can be used to reference this price when adding adjustments
6343
+ * in the same API call.
6344
+ */
6345
+ reference_id?: string | null;
6346
+ }
6347
+ namespace NewSubscriptionDailyCreditAllowancePrice {
6348
+ /**
6349
+ * Configuration for daily_credit_allowance pricing
6350
+ */
6351
+ interface DailyCreditAllowanceConfig {
6352
+ /**
6353
+ * Credits granted per day. Lose-it-or-use-it; does not roll over.
6354
+ */
6355
+ daily_allowance: string;
6356
+ /**
6357
+ * Default per-unit credit rate for any usage not bucketed into a specified
6358
+ * matrix_value
6359
+ */
6360
+ default_unit_amount: string;
6361
+ /**
6362
+ * One or two event property values to evaluate matrix groups by
6363
+ */
6364
+ dimensions: Array<string | null>;
6365
+ /**
6366
+ * Event property whose value identifies the day bucket the event belongs to (e.g.
6367
+ * 'event_day' set to an ISO date string in the customer's timezone). The allowance
6368
+ * resets per distinct value of this property.
6369
+ */
6370
+ event_day_property: string;
6371
+ /**
6372
+ * Per-dimension credit rates
6373
+ */
6374
+ matrix_values: Array<DailyCreditAllowanceConfig.MatrixValue>;
6375
+ }
6376
+ namespace DailyCreditAllowanceConfig {
6377
+ /**
6378
+ * Per-dimension credit price for the daily credit allowance model.
6379
+ */
6380
+ interface MatrixValue {
6381
+ /**
6382
+ * One or two matrix keys to filter usage to this value by. For example, ["model"]
6383
+ * could be used to apply a different credit rate to each AI model.
6384
+ */
6385
+ dimension_values: Array<string | null>;
6386
+ /**
6387
+ * Credits charged per unit of usage matching the specified dimension_values
6388
+ */
6389
+ unit_amount: string;
6390
+ }
6391
+ }
6392
+ }
6393
+ interface NewSubscriptionMeteredAllowancePrice {
6394
+ /**
6395
+ * The cadence to bill for this price on.
6396
+ */
6397
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6398
+ /**
6399
+ * The id of the item the price will be associated with.
6400
+ */
6401
+ item_id: string;
6402
+ /**
6403
+ * Configuration for metered_allowance pricing
6404
+ */
6405
+ metered_allowance_config: NewSubscriptionMeteredAllowancePrice.MeteredAllowanceConfig;
6406
+ /**
6407
+ * The pricing model type
6408
+ */
6409
+ model_type: 'metered_allowance';
6410
+ /**
6411
+ * The name of the price.
6412
+ */
6413
+ name: string;
6414
+ /**
6415
+ * The id of the billable metric for the price. Only needed if the price is
6416
+ * usage-based.
6417
+ */
6418
+ billable_metric_id?: string | null;
6419
+ /**
6420
+ * If the Price represents a fixed cost, the price will be billed in-advance if
6421
+ * this is true, and in-arrears if this is false.
6422
+ */
6423
+ billed_in_advance?: boolean | null;
6424
+ /**
6425
+ * For custom cadence: specifies the duration of the billing period in days or
6426
+ * months.
6427
+ */
6428
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6429
+ /**
6430
+ * The per unit conversion rate of the price currency to the invoicing currency.
6431
+ */
6432
+ conversion_rate?: number | null;
6433
+ /**
6434
+ * The configuration for the rate of the price currency to the invoicing currency.
6435
+ */
6436
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
6437
+ /**
6438
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
6439
+ * price is billed.
6440
+ */
6441
+ currency?: string | null;
6442
+ /**
6443
+ * For dimensional price: specifies a price group and dimension values
6444
+ */
6445
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
6446
+ /**
6447
+ * An alias for the price.
6448
+ */
6449
+ external_price_id?: string | null;
6450
+ /**
6451
+ * If the Price represents a fixed cost, this represents the quantity of units
6452
+ * applied.
6453
+ */
6454
+ fixed_price_quantity?: number | null;
6455
+ /**
6456
+ * The property used to group this price on an invoice
6457
+ */
6458
+ invoice_grouping_key?: string | null;
6459
+ /**
6460
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
6461
+ * If unspecified, a single invoice is produced per billing cycle.
6462
+ */
6463
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6464
+ /**
6465
+ * The ID of the license type to associate with this price.
6466
+ */
6467
+ license_type_id?: string | null;
6468
+ /**
6469
+ * User-specified key/value pairs for the resource. Individual keys can be removed
6470
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
6471
+ * by setting `metadata` to `null`.
6472
+ */
6473
+ metadata?: {
6474
+ [key: string]: string | null;
6475
+ } | null;
6476
+ /**
6477
+ * A transient ID that can be used to reference this price when adding adjustments
6478
+ * in the same API call.
6479
+ */
6480
+ reference_id?: string | null;
6481
+ }
6482
+ namespace NewSubscriptionMeteredAllowancePrice {
6483
+ /**
6484
+ * Configuration for metered_allowance pricing
6485
+ */
6486
+ interface MeteredAllowanceConfig {
6487
+ /**
6488
+ * The grouping_key value whose summed quantity represents the allowance for this
6489
+ * period (e.g. 'storage_snapshot' emitting 3 × avg storage). Capped at consumption
6490
+ * — credit can never exceed actual usage.
6491
+ */
6492
+ allowance_grouping_value: string;
6493
+ /**
6494
+ * The grouping_key value whose summed quantity represents consumption (e.g.
6495
+ * 'download'). Charged at unit_amount.
6496
+ */
6497
+ consumption_grouping_value: string;
6498
+ /**
6499
+ * Event property used to partition the metric into consumption and allowance
6500
+ * quantities (e.g. 'event_name'). The metric is queried with this key and the two
6501
+ * values below select which partition is which.
6502
+ */
6503
+ grouping_key: string;
6504
+ /**
6505
+ * Per-unit price applied to gross consumption and to the allowance credit.
6506
+ */
6507
+ unit_amount: string;
6508
+ /**
6509
+ * Sub-line label for the credit row (e.g. 'Up to 3x free egress').
6510
+ */
6511
+ allowance_display_name?: string;
6512
+ /**
6513
+ * Sub-line label for the gross consumption row (e.g. 'bytes gotten').
6514
+ */
6515
+ consumption_display_name?: string;
6516
+ }
6517
+ }
6518
+ interface NewSubscriptionPercentCompositePrice {
6519
+ /**
6520
+ * The cadence to bill for this price on.
6521
+ */
6522
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6523
+ /**
6524
+ * The id of the item the price will be associated with.
6525
+ */
6526
+ item_id: string;
6527
+ /**
6528
+ * The pricing model type
6529
+ */
6530
+ model_type: 'percent';
6531
+ /**
6532
+ * The name of the price.
6533
+ */
6534
+ name: string;
6535
+ /**
6536
+ * Configuration for percent pricing
6537
+ */
6538
+ percent_config: NewSubscriptionPercentCompositePrice.PercentConfig;
6539
+ /**
6540
+ * The id of the billable metric for the price. Only needed if the price is
6541
+ * usage-based.
6542
+ */
6543
+ billable_metric_id?: string | null;
6544
+ /**
6545
+ * If the Price represents a fixed cost, the price will be billed in-advance if
6546
+ * this is true, and in-arrears if this is false.
6547
+ */
6548
+ billed_in_advance?: boolean | null;
6549
+ /**
6550
+ * For custom cadence: specifies the duration of the billing period in days or
6551
+ * months.
6552
+ */
6553
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6554
+ /**
6555
+ * The per unit conversion rate of the price currency to the invoicing currency.
6556
+ */
6557
+ conversion_rate?: number | null;
6558
+ /**
6559
+ * The configuration for the rate of the price currency to the invoicing currency.
6560
+ */
6561
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
6562
+ /**
6563
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
6564
+ * price is billed.
6565
+ */
6566
+ currency?: string | null;
6567
+ /**
6568
+ * For dimensional price: specifies a price group and dimension values
6569
+ */
6570
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
6571
+ /**
6572
+ * An alias for the price.
6573
+ */
6574
+ external_price_id?: string | null;
6575
+ /**
6576
+ * If the Price represents a fixed cost, this represents the quantity of units
6577
+ * applied.
6578
+ */
6579
+ fixed_price_quantity?: number | null;
6580
+ /**
6581
+ * The property used to group this price on an invoice
6582
+ */
6583
+ invoice_grouping_key?: string | null;
6584
+ /**
6585
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
6586
+ * If unspecified, a single invoice is produced per billing cycle.
6587
+ */
6588
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6589
+ /**
6590
+ * The ID of the license type to associate with this price.
6591
+ */
6592
+ license_type_id?: string | null;
6593
+ /**
6594
+ * User-specified key/value pairs for the resource. Individual keys can be removed
6595
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
6596
+ * by setting `metadata` to `null`.
6597
+ */
6598
+ metadata?: {
6599
+ [key: string]: string | null;
6600
+ } | null;
6601
+ /**
6602
+ * A transient ID that can be used to reference this price when adding adjustments
6603
+ * in the same API call.
6604
+ */
6605
+ reference_id?: string | null;
6606
+ }
6607
+ namespace NewSubscriptionPercentCompositePrice {
6608
+ /**
6609
+ * Configuration for percent pricing
6610
+ */
6611
+ interface PercentConfig {
6612
+ /**
6613
+ * Fraction of the component subtotals to charge (0 < percent <= 1).
6614
+ */
6615
+ percent: number;
6616
+ /**
6617
+ * Maximum amount to charge. If unset, the fee has no upper bound.
6618
+ */
6619
+ maximum_amount?: string | null;
6620
+ /**
6621
+ * Minimum amount to charge. If unset, the fee is bounded below by 0.
6622
+ */
6623
+ minimum_amount?: string | null;
6624
+ /**
6625
+ * If true, the minimum_amount is prorated based on the service period. The
6626
+ * maximum_amount is an absolute cap (never prorated), and the percent applied to
6627
+ * upstream subtotals is never prorated either.
6628
+ */
6629
+ prorated?: boolean;
6630
+ }
6631
+ }
6632
+ interface NewSubscriptionEventOutputPrice {
6633
+ /**
6634
+ * The cadence to bill for this price on.
6635
+ */
6636
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6637
+ /**
6638
+ * Configuration for event_output pricing
6639
+ */
6640
+ event_output_config: NewSubscriptionEventOutputPrice.EventOutputConfig;
6641
+ /**
6642
+ * The id of the item the price will be associated with.
6643
+ */
6644
+ item_id: string;
6645
+ /**
6646
+ * The pricing model type
6647
+ */
6648
+ model_type: 'event_output';
6649
+ /**
6650
+ * The name of the price.
6651
+ */
6652
+ name: string;
6653
+ /**
6654
+ * The id of the billable metric for the price. Only needed if the price is
6655
+ * usage-based.
6656
+ */
6657
+ billable_metric_id?: string | null;
6658
+ /**
6659
+ * If the Price represents a fixed cost, the price will be billed in-advance if
6660
+ * this is true, and in-arrears if this is false.
6661
+ */
6662
+ billed_in_advance?: boolean | null;
6663
+ /**
6664
+ * For custom cadence: specifies the duration of the billing period in days or
6665
+ * months.
6666
+ */
6667
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6668
+ /**
6669
+ * The per unit conversion rate of the price currency to the invoicing currency.
6670
+ */
6671
+ conversion_rate?: number | null;
6672
+ /**
6673
+ * The configuration for the rate of the price currency to the invoicing currency.
6674
+ */
6675
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
6676
+ /**
6677
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
6678
+ * price is billed.
6679
+ */
6680
+ currency?: string | null;
6681
+ /**
6682
+ * For dimensional price: specifies a price group and dimension values
6683
+ */
6684
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
6685
+ /**
6686
+ * An alias for the price.
6687
+ */
6688
+ external_price_id?: string | null;
6689
+ /**
6690
+ * If the Price represents a fixed cost, this represents the quantity of units
6691
+ * applied.
6692
+ */
6693
+ fixed_price_quantity?: number | null;
6694
+ /**
6695
+ * The property used to group this price on an invoice
6696
+ */
6697
+ invoice_grouping_key?: string | null;
6698
+ /**
6699
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
6700
+ * If unspecified, a single invoice is produced per billing cycle.
6701
+ */
6702
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6703
+ /**
6704
+ * The ID of the license type to associate with this price.
6705
+ */
6706
+ license_type_id?: string | null;
6707
+ /**
6708
+ * User-specified key/value pairs for the resource. Individual keys can be removed
6709
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
6710
+ * by setting `metadata` to `null`.
6711
+ */
6712
+ metadata?: {
6713
+ [key: string]: string | null;
6714
+ } | null;
6715
+ /**
6716
+ * A transient ID that can be used to reference this price when adding adjustments
6717
+ * in the same API call.
6718
+ */
6719
+ reference_id?: string | null;
6720
+ }
6721
+ namespace NewSubscriptionEventOutputPrice {
6722
+ /**
6723
+ * Configuration for event_output pricing
6724
+ */
6725
+ interface EventOutputConfig {
6726
+ /**
6727
+ * The key in the event data to extract the unit rate from.
6728
+ */
6729
+ unit_rating_key: string;
6730
+ /**
6731
+ * If provided, this amount will be used as the unit rate when an event does not
6732
+ * have a value for the `unit_rating_key`. If not provided, events missing a unit
6733
+ * rate will be ignored.
6734
+ */
6735
+ default_unit_rate?: string | null;
6736
+ /**
6737
+ * An optional key in the event data to group by (e.g., event ID). All events will
6738
+ * also be grouped by their unit rate.
6739
+ */
6740
+ grouping_key?: string | null;
6741
+ }
6742
+ }
6743
+ }
6744
+ }
6745
+ export interface SubscriptionUpdateParams {
6746
+ /**
6747
+ * Determines whether issued invoices for this subscription will automatically be
6748
+ * charged with the saved payment method on the due date. This property defaults to
6749
+ * the plan's behavior.
6750
+ */
6751
+ auto_collection?: boolean | null;
6752
+ /**
6753
+ * Used to determine if invoices for this subscription will be automatically
6754
+ * issued. If true, invoices will be automatically issued. If false, invoices will
6755
+ * require manual approval. If `null` is specified, this defaults to the behavior
6756
+ * configured for this customer.
6757
+ */
6758
+ auto_issuance?: boolean | null;
6759
+ /**
6760
+ * Determines the default memo on this subscription's invoices. Note that if this
6761
+ * is not provided, it is determined by the plan configuration.
6762
+ */
6763
+ default_invoice_memo?: string | null;
5576
6764
  /**
5577
6765
  * When this subscription's accrued usage reaches this threshold, an invoice will
5578
6766
  * be issued for the subscription. If not specified, invoices will only be issued
@@ -5775,7 +6963,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
5775
6963
  /**
5776
6964
  * New floating price request body params.
5777
6965
  */
5778
- price?: Shared.NewFloatingUnitPrice | Shared.NewFloatingTieredPrice | Shared.NewFloatingBulkPrice | Add.NewFloatingBulkWithFiltersPrice | Shared.NewFloatingPackagePrice | Shared.NewFloatingMatrixPrice | Shared.NewFloatingThresholdTotalAmountPrice | Shared.NewFloatingTieredPackagePrice | Shared.NewFloatingTieredWithMinimumPrice | Shared.NewFloatingGroupedTieredPrice | Shared.NewFloatingTieredPackageWithMinimumPrice | Shared.NewFloatingPackageWithAllocationPrice | Shared.NewFloatingUnitWithPercentPrice | Shared.NewFloatingMatrixWithAllocationPrice | Shared.NewFloatingTieredWithProrationPrice | Shared.NewFloatingUnitWithProrationPrice | Shared.NewFloatingGroupedAllocationPrice | Shared.NewFloatingBulkWithProrationPrice | Shared.NewFloatingGroupedWithProratedMinimumPrice | Shared.NewFloatingGroupedWithMeteredMinimumPrice | Add.NewFloatingGroupedWithMinMaxThresholdsPrice | Shared.NewFloatingMatrixWithDisplayNamePrice | Shared.NewFloatingGroupedTieredPackagePrice | Shared.NewFloatingMaxGroupTieredPackagePrice | Shared.NewFloatingScalableMatrixWithUnitPricingPrice | Shared.NewFloatingScalableMatrixWithTieredPricingPrice | Shared.NewFloatingCumulativeGroupedBulkPrice | Add.NewFloatingCumulativeGroupedAllocationPrice | Shared.NewFloatingMinimumCompositePrice | Add.NewFloatingPercentCompositePrice | Add.NewFloatingEventOutputPrice | null;
6966
+ price?: Shared.NewFloatingUnitPrice | Shared.NewFloatingTieredPrice | Shared.NewFloatingBulkPrice | Add.NewFloatingBulkWithFiltersPrice | Shared.NewFloatingPackagePrice | Shared.NewFloatingMatrixPrice | Shared.NewFloatingThresholdTotalAmountPrice | Shared.NewFloatingTieredPackagePrice | Shared.NewFloatingTieredWithMinimumPrice | Shared.NewFloatingGroupedTieredPrice | Shared.NewFloatingTieredPackageWithMinimumPrice | Shared.NewFloatingPackageWithAllocationPrice | Shared.NewFloatingUnitWithPercentPrice | Shared.NewFloatingMatrixWithAllocationPrice | Add.NewFloatingMatrixWithThresholdDiscountsPrice | Shared.NewFloatingTieredWithProrationPrice | Shared.NewFloatingUnitWithProrationPrice | Shared.NewFloatingGroupedAllocationPrice | Shared.NewFloatingBulkWithProrationPrice | Shared.NewFloatingGroupedWithProratedMinimumPrice | Shared.NewFloatingGroupedWithMeteredMinimumPrice | Add.NewFloatingGroupedWithMinMaxThresholdsPrice | Shared.NewFloatingMatrixWithDisplayNamePrice | Shared.NewFloatingGroupedTieredPackagePrice | Shared.NewFloatingMaxGroupTieredPackagePrice | Shared.NewFloatingScalableMatrixWithUnitPricingPrice | Shared.NewFloatingScalableMatrixWithTieredPricingPrice | Shared.NewFloatingCumulativeGroupedBulkPrice | Add.NewFloatingCumulativeGroupedAllocationPrice | Add.NewFloatingDailyCreditAllowancePrice | Add.NewFloatingMeteredAllowancePrice | Shared.NewFloatingMinimumCompositePrice | Add.NewFloatingPercentCompositePrice | Add.NewFloatingEventOutputPrice | null;
5779
6967
  /**
5780
6968
  * The id of the price to add to the subscription.
5781
6969
  */
@@ -5793,42 +6981,297 @@ export declare namespace SubscriptionPriceIntervalsParams {
5793
6981
  namespace Add {
5794
6982
  interface AmountDiscountCreationParams {
5795
6983
  /**
5796
- * Only available if discount_type is `amount`.
6984
+ * Only available if discount_type is `amount`.
6985
+ */
6986
+ amount_discount: number;
6987
+ discount_type: 'amount';
6988
+ }
6989
+ interface PercentageDiscountCreationParams {
6990
+ discount_type: 'percentage';
6991
+ /**
6992
+ * Only available if discount_type is `percentage`. This is a number between 0
6993
+ * and 1.
6994
+ */
6995
+ percentage_discount: number;
6996
+ }
6997
+ interface UsageDiscountCreationParams {
6998
+ discount_type: 'usage';
6999
+ /**
7000
+ * Only available if discount_type is `usage`. Number of usage units that this
7001
+ * discount is for.
7002
+ */
7003
+ usage_discount: number;
7004
+ }
7005
+ interface FixedFeeQuantityTransition {
7006
+ /**
7007
+ * The date that the fixed fee quantity transition should take effect.
7008
+ */
7009
+ effective_date: string;
7010
+ /**
7011
+ * The quantity of the fixed fee quantity transition.
7012
+ */
7013
+ quantity: number;
7014
+ }
7015
+ interface NewFloatingBulkWithFiltersPrice {
7016
+ /**
7017
+ * Configuration for bulk_with_filters pricing
7018
+ */
7019
+ bulk_with_filters_config: NewFloatingBulkWithFiltersPrice.BulkWithFiltersConfig;
7020
+ /**
7021
+ * The cadence to bill for this price on.
7022
+ */
7023
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
7024
+ /**
7025
+ * An ISO 4217 currency string for which this price is billed in.
7026
+ */
7027
+ currency: string;
7028
+ /**
7029
+ * The id of the item the price will be associated with.
7030
+ */
7031
+ item_id: string;
7032
+ /**
7033
+ * The pricing model type
7034
+ */
7035
+ model_type: 'bulk_with_filters';
7036
+ /**
7037
+ * The name of the price.
7038
+ */
7039
+ name: string;
7040
+ /**
7041
+ * The id of the billable metric for the price. Only needed if the price is
7042
+ * usage-based.
7043
+ */
7044
+ billable_metric_id?: string | null;
7045
+ /**
7046
+ * If the Price represents a fixed cost, the price will be billed in-advance if
7047
+ * this is true, and in-arrears if this is false.
7048
+ */
7049
+ billed_in_advance?: boolean | null;
7050
+ /**
7051
+ * For custom cadence: specifies the duration of the billing period in days or
7052
+ * months.
7053
+ */
7054
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
7055
+ /**
7056
+ * The per unit conversion rate of the price currency to the invoicing currency.
7057
+ */
7058
+ conversion_rate?: number | null;
7059
+ /**
7060
+ * The configuration for the rate of the price currency to the invoicing currency.
7061
+ */
7062
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
7063
+ /**
7064
+ * For dimensional price: specifies a price group and dimension values
7065
+ */
7066
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
7067
+ /**
7068
+ * An alias for the price.
7069
+ */
7070
+ external_price_id?: string | null;
7071
+ /**
7072
+ * If the Price represents a fixed cost, this represents the quantity of units
7073
+ * applied.
7074
+ */
7075
+ fixed_price_quantity?: number | null;
7076
+ /**
7077
+ * The property used to group this price on an invoice
7078
+ */
7079
+ invoice_grouping_key?: string | null;
7080
+ /**
7081
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
7082
+ * If unspecified, a single invoice is produced per billing cycle.
7083
+ */
7084
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
7085
+ /**
7086
+ * The ID of the license type to associate with this price.
7087
+ */
7088
+ license_type_id?: string | null;
7089
+ /**
7090
+ * User-specified key/value pairs for the resource. Individual keys can be removed
7091
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
7092
+ * by setting `metadata` to `null`.
7093
+ */
7094
+ metadata?: {
7095
+ [key: string]: string | null;
7096
+ } | null;
7097
+ }
7098
+ namespace NewFloatingBulkWithFiltersPrice {
7099
+ /**
7100
+ * Configuration for bulk_with_filters pricing
7101
+ */
7102
+ interface BulkWithFiltersConfig {
7103
+ /**
7104
+ * Property filters to apply (all must match)
7105
+ */
7106
+ filters: Array<BulkWithFiltersConfig.Filter>;
7107
+ /**
7108
+ * Bulk tiers for rating based on total usage volume
7109
+ */
7110
+ tiers: Array<BulkWithFiltersConfig.Tier>;
7111
+ }
7112
+ namespace BulkWithFiltersConfig {
7113
+ /**
7114
+ * Configuration for a single property filter
7115
+ */
7116
+ interface Filter {
7117
+ /**
7118
+ * Event property key to filter on
7119
+ */
7120
+ property_key: string;
7121
+ /**
7122
+ * Event property value to match
7123
+ */
7124
+ property_value: string;
7125
+ }
7126
+ /**
7127
+ * Configuration for a single bulk pricing tier
7128
+ */
7129
+ interface Tier {
7130
+ /**
7131
+ * Amount per unit
7132
+ */
7133
+ unit_amount: string;
7134
+ /**
7135
+ * The lower bound for this tier
7136
+ */
7137
+ tier_lower_bound?: string | null;
7138
+ }
7139
+ }
7140
+ }
7141
+ interface NewFloatingMatrixWithThresholdDiscountsPrice {
7142
+ /**
7143
+ * The cadence to bill for this price on.
5797
7144
  */
5798
- amount_discount: number;
5799
- discount_type: 'amount';
5800
- }
5801
- interface PercentageDiscountCreationParams {
5802
- discount_type: 'percentage';
7145
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5803
7146
  /**
5804
- * Only available if discount_type is `percentage`. This is a number between 0
5805
- * and 1.
7147
+ * An ISO 4217 currency string for which this price is billed in.
5806
7148
  */
5807
- percentage_discount: number;
5808
- }
5809
- interface UsageDiscountCreationParams {
5810
- discount_type: 'usage';
7149
+ currency: string;
5811
7150
  /**
5812
- * Only available if discount_type is `usage`. Number of usage units that this
5813
- * discount is for.
7151
+ * The id of the item the price will be associated with.
5814
7152
  */
5815
- usage_discount: number;
5816
- }
5817
- interface FixedFeeQuantityTransition {
7153
+ item_id: string;
5818
7154
  /**
5819
- * The date that the fixed fee quantity transition should take effect.
7155
+ * Configuration for matrix_with_threshold_discounts pricing
5820
7156
  */
5821
- effective_date: string;
7157
+ matrix_with_threshold_discounts_config: NewFloatingMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig;
5822
7158
  /**
5823
- * The quantity of the fixed fee quantity transition.
7159
+ * The pricing model type
5824
7160
  */
5825
- quantity: number;
7161
+ model_type: 'matrix_with_threshold_discounts';
7162
+ /**
7163
+ * The name of the price.
7164
+ */
7165
+ name: string;
7166
+ /**
7167
+ * The id of the billable metric for the price. Only needed if the price is
7168
+ * usage-based.
7169
+ */
7170
+ billable_metric_id?: string | null;
7171
+ /**
7172
+ * If the Price represents a fixed cost, the price will be billed in-advance if
7173
+ * this is true, and in-arrears if this is false.
7174
+ */
7175
+ billed_in_advance?: boolean | null;
7176
+ /**
7177
+ * For custom cadence: specifies the duration of the billing period in days or
7178
+ * months.
7179
+ */
7180
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
7181
+ /**
7182
+ * The per unit conversion rate of the price currency to the invoicing currency.
7183
+ */
7184
+ conversion_rate?: number | null;
7185
+ /**
7186
+ * The configuration for the rate of the price currency to the invoicing currency.
7187
+ */
7188
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
7189
+ /**
7190
+ * For dimensional price: specifies a price group and dimension values
7191
+ */
7192
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
7193
+ /**
7194
+ * An alias for the price.
7195
+ */
7196
+ external_price_id?: string | null;
7197
+ /**
7198
+ * If the Price represents a fixed cost, this represents the quantity of units
7199
+ * applied.
7200
+ */
7201
+ fixed_price_quantity?: number | null;
7202
+ /**
7203
+ * The property used to group this price on an invoice
7204
+ */
7205
+ invoice_grouping_key?: string | null;
7206
+ /**
7207
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
7208
+ * If unspecified, a single invoice is produced per billing cycle.
7209
+ */
7210
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
7211
+ /**
7212
+ * The ID of the license type to associate with this price.
7213
+ */
7214
+ license_type_id?: string | null;
7215
+ /**
7216
+ * User-specified key/value pairs for the resource. Individual keys can be removed
7217
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
7218
+ * by setting `metadata` to `null`.
7219
+ */
7220
+ metadata?: {
7221
+ [key: string]: string | null;
7222
+ } | null;
5826
7223
  }
5827
- interface NewFloatingBulkWithFiltersPrice {
7224
+ namespace NewFloatingMatrixWithThresholdDiscountsPrice {
5828
7225
  /**
5829
- * Configuration for bulk_with_filters pricing
7226
+ * Configuration for matrix_with_threshold_discounts pricing
5830
7227
  */
5831
- bulk_with_filters_config: NewFloatingBulkWithFiltersPrice.BulkWithFiltersConfig;
7228
+ interface MatrixWithThresholdDiscountsConfig {
7229
+ /**
7230
+ * Unit price used for usage that does not match any defined matrix cell.
7231
+ */
7232
+ default_unit_amount: string;
7233
+ /**
7234
+ * First matrix dimension key.
7235
+ */
7236
+ first_dimension: string;
7237
+ /**
7238
+ * Per-cell unit prices.
7239
+ */
7240
+ matrix_values: Array<MatrixWithThresholdDiscountsConfig.MatrixValue>;
7241
+ /**
7242
+ * Optional second matrix dimension key.
7243
+ */
7244
+ second_dimension?: string | null;
7245
+ threshold_discount_groups?: Array<MatrixWithThresholdDiscountsConfig.ThresholdDiscountGroup>;
7246
+ }
7247
+ namespace MatrixWithThresholdDiscountsConfig {
7248
+ interface MatrixValue {
7249
+ first_dimension_value: string;
7250
+ unit_amount: string;
7251
+ second_dimension_value?: string | null;
7252
+ }
7253
+ interface ThresholdDiscountGroup {
7254
+ /**
7255
+ * Discount rate applied to spend above the threshold.
7256
+ */
7257
+ above_threshold_discount_percentage: string;
7258
+ /**
7259
+ * Discount rate applied to spend at or below the threshold. Set to 0 for no
7260
+ * baseline discount.
7261
+ */
7262
+ below_threshold_discount_percentage: string;
7263
+ /**
7264
+ * Semicolon-separated list of matrix cell coordinates targeted by this group. Each
7265
+ * coordinate is `first,second` when the matrix has two dimensions, or just `first`
7266
+ * for a single-dimension matrix. Example: `blue,circle;green,triangle`.
7267
+ */
7268
+ cell_coordinates: string;
7269
+ threshold_amount: string;
7270
+ description?: string | null;
7271
+ }
7272
+ }
7273
+ }
7274
+ interface NewFloatingGroupedWithMinMaxThresholdsPrice {
5832
7275
  /**
5833
7276
  * The cadence to bill for this price on.
5834
7277
  */
@@ -5837,6 +7280,10 @@ export declare namespace SubscriptionPriceIntervalsParams {
5837
7280
  * An ISO 4217 currency string for which this price is billed in.
5838
7281
  */
5839
7282
  currency: string;
7283
+ /**
7284
+ * Configuration for grouped_with_min_max_thresholds pricing
7285
+ */
7286
+ grouped_with_min_max_thresholds_config: NewFloatingGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
5840
7287
  /**
5841
7288
  * The id of the item the price will be associated with.
5842
7289
  */
@@ -5844,7 +7291,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
5844
7291
  /**
5845
7292
  * The pricing model type
5846
7293
  */
5847
- model_type: 'bulk_with_filters';
7294
+ model_type: 'grouped_with_min_max_thresholds';
5848
7295
  /**
5849
7296
  * The name of the price.
5850
7297
  */
@@ -5907,50 +7354,136 @@ export declare namespace SubscriptionPriceIntervalsParams {
5907
7354
  [key: string]: string | null;
5908
7355
  } | null;
5909
7356
  }
5910
- namespace NewFloatingBulkWithFiltersPrice {
7357
+ namespace NewFloatingGroupedWithMinMaxThresholdsPrice {
5911
7358
  /**
5912
- * Configuration for bulk_with_filters pricing
7359
+ * Configuration for grouped_with_min_max_thresholds pricing
5913
7360
  */
5914
- interface BulkWithFiltersConfig {
7361
+ interface GroupedWithMinMaxThresholdsConfig {
5915
7362
  /**
5916
- * Property filters to apply (all must match)
7363
+ * The event property used to group before applying thresholds
5917
7364
  */
5918
- filters: Array<BulkWithFiltersConfig.Filter>;
7365
+ grouping_key: string;
5919
7366
  /**
5920
- * Bulk tiers for rating based on total usage volume
7367
+ * The maximum amount to charge each group
5921
7368
  */
5922
- tiers: Array<BulkWithFiltersConfig.Tier>;
7369
+ maximum_charge: string;
7370
+ /**
7371
+ * The minimum amount to charge each group, regardless of usage
7372
+ */
7373
+ minimum_charge: string;
7374
+ /**
7375
+ * The base price charged per group
7376
+ */
7377
+ per_unit_rate: string;
5923
7378
  }
5924
- namespace BulkWithFiltersConfig {
7379
+ }
7380
+ interface NewFloatingCumulativeGroupedAllocationPrice {
7381
+ /**
7382
+ * The cadence to bill for this price on.
7383
+ */
7384
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
7385
+ /**
7386
+ * Configuration for cumulative_grouped_allocation pricing
7387
+ */
7388
+ cumulative_grouped_allocation_config: NewFloatingCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig;
7389
+ /**
7390
+ * An ISO 4217 currency string for which this price is billed in.
7391
+ */
7392
+ currency: string;
7393
+ /**
7394
+ * The id of the item the price will be associated with.
7395
+ */
7396
+ item_id: string;
7397
+ /**
7398
+ * The pricing model type
7399
+ */
7400
+ model_type: 'cumulative_grouped_allocation';
7401
+ /**
7402
+ * The name of the price.
7403
+ */
7404
+ name: string;
7405
+ /**
7406
+ * The id of the billable metric for the price. Only needed if the price is
7407
+ * usage-based.
7408
+ */
7409
+ billable_metric_id?: string | null;
7410
+ /**
7411
+ * If the Price represents a fixed cost, the price will be billed in-advance if
7412
+ * this is true, and in-arrears if this is false.
7413
+ */
7414
+ billed_in_advance?: boolean | null;
7415
+ /**
7416
+ * For custom cadence: specifies the duration of the billing period in days or
7417
+ * months.
7418
+ */
7419
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
7420
+ /**
7421
+ * The per unit conversion rate of the price currency to the invoicing currency.
7422
+ */
7423
+ conversion_rate?: number | null;
7424
+ /**
7425
+ * The configuration for the rate of the price currency to the invoicing currency.
7426
+ */
7427
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
7428
+ /**
7429
+ * For dimensional price: specifies a price group and dimension values
7430
+ */
7431
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
7432
+ /**
7433
+ * An alias for the price.
7434
+ */
7435
+ external_price_id?: string | null;
7436
+ /**
7437
+ * If the Price represents a fixed cost, this represents the quantity of units
7438
+ * applied.
7439
+ */
7440
+ fixed_price_quantity?: number | null;
7441
+ /**
7442
+ * The property used to group this price on an invoice
7443
+ */
7444
+ invoice_grouping_key?: string | null;
7445
+ /**
7446
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
7447
+ * If unspecified, a single invoice is produced per billing cycle.
7448
+ */
7449
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
7450
+ /**
7451
+ * The ID of the license type to associate with this price.
7452
+ */
7453
+ license_type_id?: string | null;
7454
+ /**
7455
+ * User-specified key/value pairs for the resource. Individual keys can be removed
7456
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
7457
+ * by setting `metadata` to `null`.
7458
+ */
7459
+ metadata?: {
7460
+ [key: string]: string | null;
7461
+ } | null;
7462
+ }
7463
+ namespace NewFloatingCumulativeGroupedAllocationPrice {
7464
+ /**
7465
+ * Configuration for cumulative_grouped_allocation pricing
7466
+ */
7467
+ interface CumulativeGroupedAllocationConfig {
5925
7468
  /**
5926
- * Configuration for a single property filter
7469
+ * The overall allocation across all groups
5927
7470
  */
5928
- interface Filter {
5929
- /**
5930
- * Event property key to filter on
5931
- */
5932
- property_key: string;
5933
- /**
5934
- * Event property value to match
5935
- */
5936
- property_value: string;
5937
- }
7471
+ cumulative_allocation: string;
7472
+ /**
7473
+ * The allocation per individual group
7474
+ */
7475
+ group_allocation: string;
5938
7476
  /**
5939
- * Configuration for a single bulk pricing tier
7477
+ * The event property used to group usage before applying allocations
5940
7478
  */
5941
- interface Tier {
5942
- /**
5943
- * Amount per unit
5944
- */
5945
- unit_amount: string;
5946
- /**
5947
- * The lower bound for this tier
5948
- */
5949
- tier_lower_bound?: string | null;
5950
- }
7479
+ grouping_key: string;
7480
+ /**
7481
+ * The amount to charge for each unit outside of the allocation
7482
+ */
7483
+ unit_amount: string;
5951
7484
  }
5952
7485
  }
5953
- interface NewFloatingGroupedWithMinMaxThresholdsPrice {
7486
+ interface NewFloatingDailyCreditAllowancePrice {
5954
7487
  /**
5955
7488
  * The cadence to bill for this price on.
5956
7489
  */
@@ -5960,9 +7493,9 @@ export declare namespace SubscriptionPriceIntervalsParams {
5960
7493
  */
5961
7494
  currency: string;
5962
7495
  /**
5963
- * Configuration for grouped_with_min_max_thresholds pricing
7496
+ * Configuration for daily_credit_allowance pricing
5964
7497
  */
5965
- grouped_with_min_max_thresholds_config: NewFloatingGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
7498
+ daily_credit_allowance_config: NewFloatingDailyCreditAllowancePrice.DailyCreditAllowanceConfig;
5966
7499
  /**
5967
7500
  * The id of the item the price will be associated with.
5968
7501
  */
@@ -5970,7 +7503,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
5970
7503
  /**
5971
7504
  * The pricing model type
5972
7505
  */
5973
- model_type: 'grouped_with_min_max_thresholds';
7506
+ model_type: 'daily_credit_allowance';
5974
7507
  /**
5975
7508
  * The name of the price.
5976
7509
  */
@@ -6033,38 +7566,57 @@ export declare namespace SubscriptionPriceIntervalsParams {
6033
7566
  [key: string]: string | null;
6034
7567
  } | null;
6035
7568
  }
6036
- namespace NewFloatingGroupedWithMinMaxThresholdsPrice {
7569
+ namespace NewFloatingDailyCreditAllowancePrice {
6037
7570
  /**
6038
- * Configuration for grouped_with_min_max_thresholds pricing
7571
+ * Configuration for daily_credit_allowance pricing
6039
7572
  */
6040
- interface GroupedWithMinMaxThresholdsConfig {
7573
+ interface DailyCreditAllowanceConfig {
6041
7574
  /**
6042
- * The event property used to group before applying thresholds
7575
+ * Credits granted per day. Lose-it-or-use-it; does not roll over.
6043
7576
  */
6044
- grouping_key: string;
7577
+ daily_allowance: string;
6045
7578
  /**
6046
- * The maximum amount to charge each group
7579
+ * Default per-unit credit rate for any usage not bucketed into a specified
7580
+ * matrix_value
6047
7581
  */
6048
- maximum_charge: string;
7582
+ default_unit_amount: string;
6049
7583
  /**
6050
- * The minimum amount to charge each group, regardless of usage
7584
+ * One or two event property values to evaluate matrix groups by
6051
7585
  */
6052
- minimum_charge: string;
7586
+ dimensions: Array<string | null>;
6053
7587
  /**
6054
- * The base price charged per group
7588
+ * Event property whose value identifies the day bucket the event belongs to (e.g.
7589
+ * 'event_day' set to an ISO date string in the customer's timezone). The allowance
7590
+ * resets per distinct value of this property.
6055
7591
  */
6056
- per_unit_rate: string;
7592
+ event_day_property: string;
7593
+ /**
7594
+ * Per-dimension credit rates
7595
+ */
7596
+ matrix_values: Array<DailyCreditAllowanceConfig.MatrixValue>;
7597
+ }
7598
+ namespace DailyCreditAllowanceConfig {
7599
+ /**
7600
+ * Per-dimension credit price for the daily credit allowance model.
7601
+ */
7602
+ interface MatrixValue {
7603
+ /**
7604
+ * One or two matrix keys to filter usage to this value by. For example, ["model"]
7605
+ * could be used to apply a different credit rate to each AI model.
7606
+ */
7607
+ dimension_values: Array<string | null>;
7608
+ /**
7609
+ * Credits charged per unit of usage matching the specified dimension_values
7610
+ */
7611
+ unit_amount: string;
7612
+ }
6057
7613
  }
6058
7614
  }
6059
- interface NewFloatingCumulativeGroupedAllocationPrice {
7615
+ interface NewFloatingMeteredAllowancePrice {
6060
7616
  /**
6061
7617
  * The cadence to bill for this price on.
6062
7618
  */
6063
7619
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6064
- /**
6065
- * Configuration for cumulative_grouped_allocation pricing
6066
- */
6067
- cumulative_grouped_allocation_config: NewFloatingCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig;
6068
7620
  /**
6069
7621
  * An ISO 4217 currency string for which this price is billed in.
6070
7622
  */
@@ -6073,10 +7625,14 @@ export declare namespace SubscriptionPriceIntervalsParams {
6073
7625
  * The id of the item the price will be associated with.
6074
7626
  */
6075
7627
  item_id: string;
7628
+ /**
7629
+ * Configuration for metered_allowance pricing
7630
+ */
7631
+ metered_allowance_config: NewFloatingMeteredAllowancePrice.MeteredAllowanceConfig;
6076
7632
  /**
6077
7633
  * The pricing model type
6078
7634
  */
6079
- model_type: 'cumulative_grouped_allocation';
7635
+ model_type: 'metered_allowance';
6080
7636
  /**
6081
7637
  * The name of the price.
6082
7638
  */
@@ -6139,27 +7695,40 @@ export declare namespace SubscriptionPriceIntervalsParams {
6139
7695
  [key: string]: string | null;
6140
7696
  } | null;
6141
7697
  }
6142
- namespace NewFloatingCumulativeGroupedAllocationPrice {
7698
+ namespace NewFloatingMeteredAllowancePrice {
6143
7699
  /**
6144
- * Configuration for cumulative_grouped_allocation pricing
7700
+ * Configuration for metered_allowance pricing
6145
7701
  */
6146
- interface CumulativeGroupedAllocationConfig {
7702
+ interface MeteredAllowanceConfig {
6147
7703
  /**
6148
- * The overall allocation across all groups
7704
+ * The grouping_key value whose summed quantity represents the allowance for this
7705
+ * period (e.g. 'storage_snapshot' emitting 3 × avg storage). Capped at consumption
7706
+ * — credit can never exceed actual usage.
6149
7707
  */
6150
- cumulative_allocation: string;
7708
+ allowance_grouping_value: string;
6151
7709
  /**
6152
- * The allocation per individual group
7710
+ * The grouping_key value whose summed quantity represents consumption (e.g.
7711
+ * 'download'). Charged at unit_amount.
6153
7712
  */
6154
- group_allocation: string;
7713
+ consumption_grouping_value: string;
6155
7714
  /**
6156
- * The event property used to group usage before applying allocations
7715
+ * Event property used to partition the metric into consumption and allowance
7716
+ * quantities (e.g. 'event_name'). The metric is queried with this key and the two
7717
+ * values below select which partition is which.
6157
7718
  */
6158
7719
  grouping_key: string;
6159
7720
  /**
6160
- * The amount to charge for each unit outside of the allocation
7721
+ * Per-unit price applied to gross consumption and to the allowance credit.
6161
7722
  */
6162
7723
  unit_amount: string;
7724
+ /**
7725
+ * Sub-line label for the credit row (e.g. 'Up to 3x free egress').
7726
+ */
7727
+ allowance_display_name?: string;
7728
+ /**
7729
+ * Sub-line label for the gross consumption row (e.g. 'bytes gotten').
7730
+ */
7731
+ consumption_display_name?: string;
6163
7732
  }
6164
7733
  }
6165
7734
  interface NewFloatingPercentCompositePrice {
@@ -6251,9 +7820,23 @@ export declare namespace SubscriptionPriceIntervalsParams {
6251
7820
  */
6252
7821
  interface PercentConfig {
6253
7822
  /**
6254
- * What percent of the component subtotals to charge
7823
+ * Fraction of the component subtotals to charge (0 < percent <= 1).
6255
7824
  */
6256
7825
  percent: number;
7826
+ /**
7827
+ * Maximum amount to charge. If unset, the fee has no upper bound.
7828
+ */
7829
+ maximum_amount?: string | null;
7830
+ /**
7831
+ * Minimum amount to charge. If unset, the fee is bounded below by 0.
7832
+ */
7833
+ minimum_amount?: string | null;
7834
+ /**
7835
+ * If true, the minimum_amount is prorated based on the service period. The
7836
+ * maximum_amount is an absolute cap (never prorated), and the percent applied to
7837
+ * upstream subtotals is never prorated either.
7838
+ */
7839
+ prorated?: boolean;
6257
7840
  }
6258
7841
  }
6259
7842
  interface NewFloatingEventOutputPrice {
@@ -6373,7 +7956,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
6373
7956
  /**
6374
7957
  * The definition of a new adjustment to create and add to the subscription.
6375
7958
  */
6376
- adjustment?: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum | null;
7959
+ adjustment?: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum | AddAdjustment.NewTieredPercentageDiscount | null;
6377
7960
  /**
6378
7961
  * The ID of the adjustment to add to the subscription. Adjustment IDs can be
6379
7962
  * re-used from existing subscriptions or plans, but adjustments associated with
@@ -6388,6 +7971,71 @@ export declare namespace SubscriptionPriceIntervalsParams {
6388
7971
  */
6389
7972
  end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
6390
7973
  }
7974
+ namespace AddAdjustment {
7975
+ interface NewTieredPercentageDiscount {
7976
+ adjustment_type: 'tiered_percentage_discount';
7977
+ tiers: Array<NewTieredPercentageDiscount.Tier>;
7978
+ /**
7979
+ * If set, the adjustment will apply to every price on the subscription.
7980
+ */
7981
+ applies_to_all?: true | null;
7982
+ /**
7983
+ * The set of item IDs to which this adjustment applies.
7984
+ */
7985
+ applies_to_item_ids?: Array<string> | null;
7986
+ /**
7987
+ * The set of price IDs to which this adjustment applies.
7988
+ */
7989
+ applies_to_price_ids?: Array<string> | null;
7990
+ /**
7991
+ * If set, only prices in the specified currency will have the adjustment applied.
7992
+ */
7993
+ currency?: string | null;
7994
+ /**
7995
+ * A list of filters that determine which prices this adjustment will apply to.
7996
+ */
7997
+ filters?: Array<NewTieredPercentageDiscount.Filter> | null;
7998
+ /**
7999
+ * When false, this adjustment will be applied to a single price. Otherwise, it
8000
+ * will be applied at the invoice level, possibly to multiple prices.
8001
+ */
8002
+ is_invoice_level?: boolean;
8003
+ /**
8004
+ * If set, only prices of the specified type will have the adjustment applied.
8005
+ */
8006
+ price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null;
8007
+ }
8008
+ namespace NewTieredPercentageDiscount {
8009
+ interface Tier {
8010
+ /**
8011
+ * Exclusive lower bound of cumulative spend for this tier.
8012
+ */
8013
+ lower_bound: number;
8014
+ /**
8015
+ * The percentage (0-1) discounted from spend in this tier.
8016
+ */
8017
+ percentage: number;
8018
+ /**
8019
+ * Inclusive upper bound of cumulative spend; null for the final open-ended tier.
8020
+ */
8021
+ upper_bound?: number | null;
8022
+ }
8023
+ interface Filter {
8024
+ /**
8025
+ * The property of the price to filter on.
8026
+ */
8027
+ field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
8028
+ /**
8029
+ * Should prices that match the filter be included or excluded.
8030
+ */
8031
+ operator: 'includes' | 'excludes';
8032
+ /**
8033
+ * The IDs or values that match this filter.
8034
+ */
8035
+ values: Array<string>;
8036
+ }
8037
+ }
8038
+ }
6391
8039
  interface Edit {
6392
8040
  /**
6393
8041
  * The id of the price interval to edit.
@@ -6519,6 +8167,13 @@ export interface SubscriptionSchedulePlanChangeParams {
6519
8167
  * defaults to the behavior configured for this customer.
6520
8168
  */
6521
8169
  auto_collection?: boolean | null;
8170
+ /**
8171
+ * Used to determine if invoices for this subscription will be automatically
8172
+ * issued. If true, invoices will be automatically issued. If false, invoices will
8173
+ * require manual approval. If `null` is specified, this defaults to the behavior
8174
+ * configured for this customer.
8175
+ */
8176
+ auto_issuance?: boolean | null;
6522
8177
  /**
6523
8178
  * Reset billing periods to be aligned with the plan change's effective date or
6524
8179
  * start of the month. Defaults to `unchanged` which keeps subscription's existing
@@ -6635,7 +8290,7 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
6635
8290
  /**
6636
8291
  * The definition of a new adjustment to create and add to the subscription.
6637
8292
  */
6638
- adjustment: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum;
8293
+ adjustment: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum | AddAdjustment.NewTieredPercentageDiscount;
6639
8294
  /**
6640
8295
  * The end date of the adjustment interval. This is the date that the adjustment
6641
8296
  * will stop affecting prices on the subscription.
@@ -6652,6 +8307,71 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
6652
8307
  */
6653
8308
  start_date?: string | null;
6654
8309
  }
8310
+ namespace AddAdjustment {
8311
+ interface NewTieredPercentageDiscount {
8312
+ adjustment_type: 'tiered_percentage_discount';
8313
+ tiers: Array<NewTieredPercentageDiscount.Tier>;
8314
+ /**
8315
+ * If set, the adjustment will apply to every price on the subscription.
8316
+ */
8317
+ applies_to_all?: true | null;
8318
+ /**
8319
+ * The set of item IDs to which this adjustment applies.
8320
+ */
8321
+ applies_to_item_ids?: Array<string> | null;
8322
+ /**
8323
+ * The set of price IDs to which this adjustment applies.
8324
+ */
8325
+ applies_to_price_ids?: Array<string> | null;
8326
+ /**
8327
+ * If set, only prices in the specified currency will have the adjustment applied.
8328
+ */
8329
+ currency?: string | null;
8330
+ /**
8331
+ * A list of filters that determine which prices this adjustment will apply to.
8332
+ */
8333
+ filters?: Array<NewTieredPercentageDiscount.Filter> | null;
8334
+ /**
8335
+ * When false, this adjustment will be applied to a single price. Otherwise, it
8336
+ * will be applied at the invoice level, possibly to multiple prices.
8337
+ */
8338
+ is_invoice_level?: boolean;
8339
+ /**
8340
+ * If set, only prices of the specified type will have the adjustment applied.
8341
+ */
8342
+ price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null;
8343
+ }
8344
+ namespace NewTieredPercentageDiscount {
8345
+ interface Tier {
8346
+ /**
8347
+ * Exclusive lower bound of cumulative spend for this tier.
8348
+ */
8349
+ lower_bound: number;
8350
+ /**
8351
+ * The percentage (0-1) discounted from spend in this tier.
8352
+ */
8353
+ percentage: number;
8354
+ /**
8355
+ * Inclusive upper bound of cumulative spend; null for the final open-ended tier.
8356
+ */
8357
+ upper_bound?: number | null;
8358
+ }
8359
+ interface Filter {
8360
+ /**
8361
+ * The property of the price to filter on.
8362
+ */
8363
+ field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
8364
+ /**
8365
+ * Should prices that match the filter be included or excluded.
8366
+ */
8367
+ operator: 'includes' | 'excludes';
8368
+ /**
8369
+ * The IDs or values that match this filter.
8370
+ */
8371
+ values: Array<string>;
8372
+ }
8373
+ }
8374
+ }
6655
8375
  interface AddPrice {
6656
8376
  /**
6657
8377
  * The definition of a new allocation price to create and add to the subscription.
@@ -6696,7 +8416,7 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
6696
8416
  /**
6697
8417
  * New subscription price request body params.
6698
8418
  */
6699
- price?: SubscriptionsAPI.NewSubscriptionUnitPrice | SubscriptionsAPI.NewSubscriptionTieredPrice | SubscriptionsAPI.NewSubscriptionBulkPrice | AddPrice.NewSubscriptionBulkWithFiltersPrice | SubscriptionsAPI.NewSubscriptionPackagePrice | SubscriptionsAPI.NewSubscriptionMatrixPrice | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice | SubscriptionsAPI.NewSubscriptionTieredPackagePrice | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice | AddPrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | AddPrice.NewSubscriptionCumulativeGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice | AddPrice.NewSubscriptionPercentCompositePrice | AddPrice.NewSubscriptionEventOutputPrice | null;
8419
+ price?: SubscriptionsAPI.NewSubscriptionUnitPrice | SubscriptionsAPI.NewSubscriptionTieredPrice | SubscriptionsAPI.NewSubscriptionBulkPrice | AddPrice.NewSubscriptionBulkWithFiltersPrice | SubscriptionsAPI.NewSubscriptionPackagePrice | SubscriptionsAPI.NewSubscriptionMatrixPrice | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice | SubscriptionsAPI.NewSubscriptionTieredPackagePrice | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice | AddPrice.NewSubscriptionMatrixWithThresholdDiscountsPrice | AddPrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | AddPrice.NewSubscriptionCumulativeGroupedAllocationPrice | AddPrice.NewSubscriptionDailyCreditAllowancePrice | AddPrice.NewSubscriptionMeteredAllowancePrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice | AddPrice.NewSubscriptionPercentCompositePrice | AddPrice.NewSubscriptionEventOutputPrice | null;
6700
8420
  /**
6701
8421
  * The id of the price to add to the subscription.
6702
8422
  */
@@ -6725,7 +8445,139 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
6725
8445
  /**
6726
8446
  * The pricing model type
6727
8447
  */
6728
- model_type: 'bulk_with_filters';
8448
+ model_type: 'bulk_with_filters';
8449
+ /**
8450
+ * The name of the price.
8451
+ */
8452
+ name: string;
8453
+ /**
8454
+ * The id of the billable metric for the price. Only needed if the price is
8455
+ * usage-based.
8456
+ */
8457
+ billable_metric_id?: string | null;
8458
+ /**
8459
+ * If the Price represents a fixed cost, the price will be billed in-advance if
8460
+ * this is true, and in-arrears if this is false.
8461
+ */
8462
+ billed_in_advance?: boolean | null;
8463
+ /**
8464
+ * For custom cadence: specifies the duration of the billing period in days or
8465
+ * months.
8466
+ */
8467
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
8468
+ /**
8469
+ * The per unit conversion rate of the price currency to the invoicing currency.
8470
+ */
8471
+ conversion_rate?: number | null;
8472
+ /**
8473
+ * The configuration for the rate of the price currency to the invoicing currency.
8474
+ */
8475
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
8476
+ /**
8477
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
8478
+ * price is billed.
8479
+ */
8480
+ currency?: string | null;
8481
+ /**
8482
+ * For dimensional price: specifies a price group and dimension values
8483
+ */
8484
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
8485
+ /**
8486
+ * An alias for the price.
8487
+ */
8488
+ external_price_id?: string | null;
8489
+ /**
8490
+ * If the Price represents a fixed cost, this represents the quantity of units
8491
+ * applied.
8492
+ */
8493
+ fixed_price_quantity?: number | null;
8494
+ /**
8495
+ * The property used to group this price on an invoice
8496
+ */
8497
+ invoice_grouping_key?: string | null;
8498
+ /**
8499
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
8500
+ * If unspecified, a single invoice is produced per billing cycle.
8501
+ */
8502
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
8503
+ /**
8504
+ * The ID of the license type to associate with this price.
8505
+ */
8506
+ license_type_id?: string | null;
8507
+ /**
8508
+ * User-specified key/value pairs for the resource. Individual keys can be removed
8509
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
8510
+ * by setting `metadata` to `null`.
8511
+ */
8512
+ metadata?: {
8513
+ [key: string]: string | null;
8514
+ } | null;
8515
+ /**
8516
+ * A transient ID that can be used to reference this price when adding adjustments
8517
+ * in the same API call.
8518
+ */
8519
+ reference_id?: string | null;
8520
+ }
8521
+ namespace NewSubscriptionBulkWithFiltersPrice {
8522
+ /**
8523
+ * Configuration for bulk_with_filters pricing
8524
+ */
8525
+ interface BulkWithFiltersConfig {
8526
+ /**
8527
+ * Property filters to apply (all must match)
8528
+ */
8529
+ filters: Array<BulkWithFiltersConfig.Filter>;
8530
+ /**
8531
+ * Bulk tiers for rating based on total usage volume
8532
+ */
8533
+ tiers: Array<BulkWithFiltersConfig.Tier>;
8534
+ }
8535
+ namespace BulkWithFiltersConfig {
8536
+ /**
8537
+ * Configuration for a single property filter
8538
+ */
8539
+ interface Filter {
8540
+ /**
8541
+ * Event property key to filter on
8542
+ */
8543
+ property_key: string;
8544
+ /**
8545
+ * Event property value to match
8546
+ */
8547
+ property_value: string;
8548
+ }
8549
+ /**
8550
+ * Configuration for a single bulk pricing tier
8551
+ */
8552
+ interface Tier {
8553
+ /**
8554
+ * Amount per unit
8555
+ */
8556
+ unit_amount: string;
8557
+ /**
8558
+ * The lower bound for this tier
8559
+ */
8560
+ tier_lower_bound?: string | null;
8561
+ }
8562
+ }
8563
+ }
8564
+ interface NewSubscriptionMatrixWithThresholdDiscountsPrice {
8565
+ /**
8566
+ * The cadence to bill for this price on.
8567
+ */
8568
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
8569
+ /**
8570
+ * The id of the item the price will be associated with.
8571
+ */
8572
+ item_id: string;
8573
+ /**
8574
+ * Configuration for matrix_with_threshold_discounts pricing
8575
+ */
8576
+ matrix_with_threshold_discounts_config: NewSubscriptionMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig;
8577
+ /**
8578
+ * The pricing model type
8579
+ */
8580
+ model_type: 'matrix_with_threshold_discounts';
6729
8581
  /**
6730
8582
  * The name of the price.
6731
8583
  */
@@ -6798,54 +8650,293 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
6798
8650
  */
6799
8651
  reference_id?: string | null;
6800
8652
  }
6801
- namespace NewSubscriptionBulkWithFiltersPrice {
8653
+ namespace NewSubscriptionMatrixWithThresholdDiscountsPrice {
6802
8654
  /**
6803
- * Configuration for bulk_with_filters pricing
8655
+ * Configuration for matrix_with_threshold_discounts pricing
6804
8656
  */
6805
- interface BulkWithFiltersConfig {
8657
+ interface MatrixWithThresholdDiscountsConfig {
6806
8658
  /**
6807
- * Property filters to apply (all must match)
8659
+ * Unit price used for usage that does not match any defined matrix cell.
6808
8660
  */
6809
- filters: Array<BulkWithFiltersConfig.Filter>;
8661
+ default_unit_amount: string;
6810
8662
  /**
6811
- * Bulk tiers for rating based on total usage volume
8663
+ * First matrix dimension key.
6812
8664
  */
6813
- tiers: Array<BulkWithFiltersConfig.Tier>;
6814
- }
6815
- namespace BulkWithFiltersConfig {
8665
+ first_dimension: string;
6816
8666
  /**
6817
- * Configuration for a single property filter
8667
+ * Per-cell unit prices.
6818
8668
  */
6819
- interface Filter {
8669
+ matrix_values: Array<MatrixWithThresholdDiscountsConfig.MatrixValue>;
8670
+ /**
8671
+ * Optional second matrix dimension key.
8672
+ */
8673
+ second_dimension?: string | null;
8674
+ threshold_discount_groups?: Array<MatrixWithThresholdDiscountsConfig.ThresholdDiscountGroup>;
8675
+ }
8676
+ namespace MatrixWithThresholdDiscountsConfig {
8677
+ interface MatrixValue {
8678
+ first_dimension_value: string;
8679
+ unit_amount: string;
8680
+ second_dimension_value?: string | null;
8681
+ }
8682
+ interface ThresholdDiscountGroup {
6820
8683
  /**
6821
- * Event property key to filter on
8684
+ * Discount rate applied to spend above the threshold.
6822
8685
  */
6823
- property_key: string;
8686
+ above_threshold_discount_percentage: string;
6824
8687
  /**
6825
- * Event property value to match
8688
+ * Discount rate applied to spend at or below the threshold. Set to 0 for no
8689
+ * baseline discount.
6826
8690
  */
6827
- property_value: string;
8691
+ below_threshold_discount_percentage: string;
8692
+ /**
8693
+ * Semicolon-separated list of matrix cell coordinates targeted by this group. Each
8694
+ * coordinate is `first,second` when the matrix has two dimensions, or just `first`
8695
+ * for a single-dimension matrix. Example: `blue,circle;green,triangle`.
8696
+ */
8697
+ cell_coordinates: string;
8698
+ threshold_amount: string;
8699
+ description?: string | null;
6828
8700
  }
8701
+ }
8702
+ }
8703
+ interface NewSubscriptionTieredWithProrationPrice {
8704
+ /**
8705
+ * The cadence to bill for this price on.
8706
+ */
8707
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
8708
+ /**
8709
+ * The id of the item the price will be associated with.
8710
+ */
8711
+ item_id: string;
8712
+ /**
8713
+ * The pricing model type
8714
+ */
8715
+ model_type: 'tiered_with_proration';
8716
+ /**
8717
+ * The name of the price.
8718
+ */
8719
+ name: string;
8720
+ /**
8721
+ * Configuration for tiered_with_proration pricing
8722
+ */
8723
+ tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig;
8724
+ /**
8725
+ * The id of the billable metric for the price. Only needed if the price is
8726
+ * usage-based.
8727
+ */
8728
+ billable_metric_id?: string | null;
8729
+ /**
8730
+ * If the Price represents a fixed cost, the price will be billed in-advance if
8731
+ * this is true, and in-arrears if this is false.
8732
+ */
8733
+ billed_in_advance?: boolean | null;
8734
+ /**
8735
+ * For custom cadence: specifies the duration of the billing period in days or
8736
+ * months.
8737
+ */
8738
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
8739
+ /**
8740
+ * The per unit conversion rate of the price currency to the invoicing currency.
8741
+ */
8742
+ conversion_rate?: number | null;
8743
+ /**
8744
+ * The configuration for the rate of the price currency to the invoicing currency.
8745
+ */
8746
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
8747
+ /**
8748
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
8749
+ * price is billed.
8750
+ */
8751
+ currency?: string | null;
8752
+ /**
8753
+ * For dimensional price: specifies a price group and dimension values
8754
+ */
8755
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
8756
+ /**
8757
+ * An alias for the price.
8758
+ */
8759
+ external_price_id?: string | null;
8760
+ /**
8761
+ * If the Price represents a fixed cost, this represents the quantity of units
8762
+ * applied.
8763
+ */
8764
+ fixed_price_quantity?: number | null;
8765
+ /**
8766
+ * The property used to group this price on an invoice
8767
+ */
8768
+ invoice_grouping_key?: string | null;
8769
+ /**
8770
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
8771
+ * If unspecified, a single invoice is produced per billing cycle.
8772
+ */
8773
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
8774
+ /**
8775
+ * The ID of the license type to associate with this price.
8776
+ */
8777
+ license_type_id?: string | null;
8778
+ /**
8779
+ * User-specified key/value pairs for the resource. Individual keys can be removed
8780
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
8781
+ * by setting `metadata` to `null`.
8782
+ */
8783
+ metadata?: {
8784
+ [key: string]: string | null;
8785
+ } | null;
8786
+ /**
8787
+ * A transient ID that can be used to reference this price when adding adjustments
8788
+ * in the same API call.
8789
+ */
8790
+ reference_id?: string | null;
8791
+ }
8792
+ namespace NewSubscriptionTieredWithProrationPrice {
8793
+ /**
8794
+ * Configuration for tiered_with_proration pricing
8795
+ */
8796
+ interface TieredWithProrationConfig {
6829
8797
  /**
6830
- * Configuration for a single bulk pricing tier
8798
+ * Tiers for rating based on total usage quantities into the specified tier with
8799
+ * proration
8800
+ */
8801
+ tiers: Array<TieredWithProrationConfig.Tier>;
8802
+ }
8803
+ namespace TieredWithProrationConfig {
8804
+ /**
8805
+ * Configuration for a single tiered with proration tier
6831
8806
  */
6832
8807
  interface Tier {
6833
8808
  /**
6834
- * Amount per unit
8809
+ * Inclusive tier starting value
6835
8810
  */
6836
- unit_amount: string;
8811
+ tier_lower_bound: string;
6837
8812
  /**
6838
- * The lower bound for this tier
8813
+ * Amount per unit
6839
8814
  */
6840
- tier_lower_bound?: string | null;
8815
+ unit_amount: string;
6841
8816
  }
6842
8817
  }
6843
8818
  }
6844
- interface NewSubscriptionTieredWithProrationPrice {
8819
+ interface NewSubscriptionGroupedWithMinMaxThresholdsPrice {
8820
+ /**
8821
+ * The cadence to bill for this price on.
8822
+ */
8823
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
8824
+ /**
8825
+ * Configuration for grouped_with_min_max_thresholds pricing
8826
+ */
8827
+ grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
8828
+ /**
8829
+ * The id of the item the price will be associated with.
8830
+ */
8831
+ item_id: string;
8832
+ /**
8833
+ * The pricing model type
8834
+ */
8835
+ model_type: 'grouped_with_min_max_thresholds';
8836
+ /**
8837
+ * The name of the price.
8838
+ */
8839
+ name: string;
8840
+ /**
8841
+ * The id of the billable metric for the price. Only needed if the price is
8842
+ * usage-based.
8843
+ */
8844
+ billable_metric_id?: string | null;
8845
+ /**
8846
+ * If the Price represents a fixed cost, the price will be billed in-advance if
8847
+ * this is true, and in-arrears if this is false.
8848
+ */
8849
+ billed_in_advance?: boolean | null;
8850
+ /**
8851
+ * For custom cadence: specifies the duration of the billing period in days or
8852
+ * months.
8853
+ */
8854
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
8855
+ /**
8856
+ * The per unit conversion rate of the price currency to the invoicing currency.
8857
+ */
8858
+ conversion_rate?: number | null;
8859
+ /**
8860
+ * The configuration for the rate of the price currency to the invoicing currency.
8861
+ */
8862
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
8863
+ /**
8864
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
8865
+ * price is billed.
8866
+ */
8867
+ currency?: string | null;
8868
+ /**
8869
+ * For dimensional price: specifies a price group and dimension values
8870
+ */
8871
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
8872
+ /**
8873
+ * An alias for the price.
8874
+ */
8875
+ external_price_id?: string | null;
8876
+ /**
8877
+ * If the Price represents a fixed cost, this represents the quantity of units
8878
+ * applied.
8879
+ */
8880
+ fixed_price_quantity?: number | null;
8881
+ /**
8882
+ * The property used to group this price on an invoice
8883
+ */
8884
+ invoice_grouping_key?: string | null;
8885
+ /**
8886
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
8887
+ * If unspecified, a single invoice is produced per billing cycle.
8888
+ */
8889
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
8890
+ /**
8891
+ * The ID of the license type to associate with this price.
8892
+ */
8893
+ license_type_id?: string | null;
8894
+ /**
8895
+ * User-specified key/value pairs for the resource. Individual keys can be removed
8896
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
8897
+ * by setting `metadata` to `null`.
8898
+ */
8899
+ metadata?: {
8900
+ [key: string]: string | null;
8901
+ } | null;
8902
+ /**
8903
+ * A transient ID that can be used to reference this price when adding adjustments
8904
+ * in the same API call.
8905
+ */
8906
+ reference_id?: string | null;
8907
+ }
8908
+ namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice {
8909
+ /**
8910
+ * Configuration for grouped_with_min_max_thresholds pricing
8911
+ */
8912
+ interface GroupedWithMinMaxThresholdsConfig {
8913
+ /**
8914
+ * The event property used to group before applying thresholds
8915
+ */
8916
+ grouping_key: string;
8917
+ /**
8918
+ * The maximum amount to charge each group
8919
+ */
8920
+ maximum_charge: string;
8921
+ /**
8922
+ * The minimum amount to charge each group, regardless of usage
8923
+ */
8924
+ minimum_charge: string;
8925
+ /**
8926
+ * The base price charged per group
8927
+ */
8928
+ per_unit_rate: string;
8929
+ }
8930
+ }
8931
+ interface NewSubscriptionCumulativeGroupedAllocationPrice {
6845
8932
  /**
6846
8933
  * The cadence to bill for this price on.
6847
8934
  */
6848
8935
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
8936
+ /**
8937
+ * Configuration for cumulative_grouped_allocation pricing
8938
+ */
8939
+ cumulative_grouped_allocation_config: NewSubscriptionCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig;
6849
8940
  /**
6850
8941
  * The id of the item the price will be associated with.
6851
8942
  */
@@ -6853,15 +8944,11 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
6853
8944
  /**
6854
8945
  * The pricing model type
6855
8946
  */
6856
- model_type: 'tiered_with_proration';
8947
+ model_type: 'cumulative_grouped_allocation';
6857
8948
  /**
6858
8949
  * The name of the price.
6859
8950
  */
6860
8951
  name: string;
6861
- /**
6862
- * Configuration for tiered_with_proration pricing
6863
- */
6864
- tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig;
6865
8952
  /**
6866
8953
  * The id of the billable metric for the price. Only needed if the price is
6867
8954
  * usage-based.
@@ -6930,42 +9017,38 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
6930
9017
  */
6931
9018
  reference_id?: string | null;
6932
9019
  }
6933
- namespace NewSubscriptionTieredWithProrationPrice {
9020
+ namespace NewSubscriptionCumulativeGroupedAllocationPrice {
6934
9021
  /**
6935
- * Configuration for tiered_with_proration pricing
9022
+ * Configuration for cumulative_grouped_allocation pricing
6936
9023
  */
6937
- interface TieredWithProrationConfig {
9024
+ interface CumulativeGroupedAllocationConfig {
6938
9025
  /**
6939
- * Tiers for rating based on total usage quantities into the specified tier with
6940
- * proration
9026
+ * The overall allocation across all groups
6941
9027
  */
6942
- tiers: Array<TieredWithProrationConfig.Tier>;
6943
- }
6944
- namespace TieredWithProrationConfig {
9028
+ cumulative_allocation: string;
6945
9029
  /**
6946
- * Configuration for a single tiered with proration tier
9030
+ * The allocation per individual group
6947
9031
  */
6948
- interface Tier {
6949
- /**
6950
- * Inclusive tier starting value
6951
- */
6952
- tier_lower_bound: string;
6953
- /**
6954
- * Amount per unit
6955
- */
6956
- unit_amount: string;
6957
- }
9032
+ group_allocation: string;
9033
+ /**
9034
+ * The event property used to group usage before applying allocations
9035
+ */
9036
+ grouping_key: string;
9037
+ /**
9038
+ * The amount to charge for each unit outside of the allocation
9039
+ */
9040
+ unit_amount: string;
6958
9041
  }
6959
9042
  }
6960
- interface NewSubscriptionGroupedWithMinMaxThresholdsPrice {
9043
+ interface NewSubscriptionDailyCreditAllowancePrice {
6961
9044
  /**
6962
9045
  * The cadence to bill for this price on.
6963
9046
  */
6964
9047
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6965
9048
  /**
6966
- * Configuration for grouped_with_min_max_thresholds pricing
9049
+ * Configuration for daily_credit_allowance pricing
6967
9050
  */
6968
- grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
9051
+ daily_credit_allowance_config: NewSubscriptionDailyCreditAllowancePrice.DailyCreditAllowanceConfig;
6969
9052
  /**
6970
9053
  * The id of the item the price will be associated with.
6971
9054
  */
@@ -6973,7 +9056,7 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
6973
9056
  /**
6974
9057
  * The pricing model type
6975
9058
  */
6976
- model_type: 'grouped_with_min_max_thresholds';
9059
+ model_type: 'daily_credit_allowance';
6977
9060
  /**
6978
9061
  * The name of the price.
6979
9062
  */
@@ -7046,46 +9129,69 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
7046
9129
  */
7047
9130
  reference_id?: string | null;
7048
9131
  }
7049
- namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice {
9132
+ namespace NewSubscriptionDailyCreditAllowancePrice {
7050
9133
  /**
7051
- * Configuration for grouped_with_min_max_thresholds pricing
9134
+ * Configuration for daily_credit_allowance pricing
7052
9135
  */
7053
- interface GroupedWithMinMaxThresholdsConfig {
9136
+ interface DailyCreditAllowanceConfig {
7054
9137
  /**
7055
- * The event property used to group before applying thresholds
9138
+ * Credits granted per day. Lose-it-or-use-it; does not roll over.
7056
9139
  */
7057
- grouping_key: string;
9140
+ daily_allowance: string;
7058
9141
  /**
7059
- * The maximum amount to charge each group
9142
+ * Default per-unit credit rate for any usage not bucketed into a specified
9143
+ * matrix_value
7060
9144
  */
7061
- maximum_charge: string;
9145
+ default_unit_amount: string;
7062
9146
  /**
7063
- * The minimum amount to charge each group, regardless of usage
9147
+ * One or two event property values to evaluate matrix groups by
7064
9148
  */
7065
- minimum_charge: string;
9149
+ dimensions: Array<string | null>;
7066
9150
  /**
7067
- * The base price charged per group
9151
+ * Event property whose value identifies the day bucket the event belongs to (e.g.
9152
+ * 'event_day' set to an ISO date string in the customer's timezone). The allowance
9153
+ * resets per distinct value of this property.
7068
9154
  */
7069
- per_unit_rate: string;
9155
+ event_day_property: string;
9156
+ /**
9157
+ * Per-dimension credit rates
9158
+ */
9159
+ matrix_values: Array<DailyCreditAllowanceConfig.MatrixValue>;
9160
+ }
9161
+ namespace DailyCreditAllowanceConfig {
9162
+ /**
9163
+ * Per-dimension credit price for the daily credit allowance model.
9164
+ */
9165
+ interface MatrixValue {
9166
+ /**
9167
+ * One or two matrix keys to filter usage to this value by. For example, ["model"]
9168
+ * could be used to apply a different credit rate to each AI model.
9169
+ */
9170
+ dimension_values: Array<string | null>;
9171
+ /**
9172
+ * Credits charged per unit of usage matching the specified dimension_values
9173
+ */
9174
+ unit_amount: string;
9175
+ }
7070
9176
  }
7071
9177
  }
7072
- interface NewSubscriptionCumulativeGroupedAllocationPrice {
9178
+ interface NewSubscriptionMeteredAllowancePrice {
7073
9179
  /**
7074
9180
  * The cadence to bill for this price on.
7075
9181
  */
7076
9182
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
7077
- /**
7078
- * Configuration for cumulative_grouped_allocation pricing
7079
- */
7080
- cumulative_grouped_allocation_config: NewSubscriptionCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig;
7081
9183
  /**
7082
9184
  * The id of the item the price will be associated with.
7083
9185
  */
7084
9186
  item_id: string;
9187
+ /**
9188
+ * Configuration for metered_allowance pricing
9189
+ */
9190
+ metered_allowance_config: NewSubscriptionMeteredAllowancePrice.MeteredAllowanceConfig;
7085
9191
  /**
7086
9192
  * The pricing model type
7087
9193
  */
7088
- model_type: 'cumulative_grouped_allocation';
9194
+ model_type: 'metered_allowance';
7089
9195
  /**
7090
9196
  * The name of the price.
7091
9197
  */
@@ -7158,27 +9264,40 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
7158
9264
  */
7159
9265
  reference_id?: string | null;
7160
9266
  }
7161
- namespace NewSubscriptionCumulativeGroupedAllocationPrice {
9267
+ namespace NewSubscriptionMeteredAllowancePrice {
7162
9268
  /**
7163
- * Configuration for cumulative_grouped_allocation pricing
9269
+ * Configuration for metered_allowance pricing
7164
9270
  */
7165
- interface CumulativeGroupedAllocationConfig {
9271
+ interface MeteredAllowanceConfig {
7166
9272
  /**
7167
- * The overall allocation across all groups
9273
+ * The grouping_key value whose summed quantity represents the allowance for this
9274
+ * period (e.g. 'storage_snapshot' emitting 3 × avg storage). Capped at consumption
9275
+ * — credit can never exceed actual usage.
7168
9276
  */
7169
- cumulative_allocation: string;
9277
+ allowance_grouping_value: string;
7170
9278
  /**
7171
- * The allocation per individual group
9279
+ * The grouping_key value whose summed quantity represents consumption (e.g.
9280
+ * 'download'). Charged at unit_amount.
7172
9281
  */
7173
- group_allocation: string;
9282
+ consumption_grouping_value: string;
7174
9283
  /**
7175
- * The event property used to group usage before applying allocations
9284
+ * Event property used to partition the metric into consumption and allowance
9285
+ * quantities (e.g. 'event_name'). The metric is queried with this key and the two
9286
+ * values below select which partition is which.
7176
9287
  */
7177
9288
  grouping_key: string;
7178
9289
  /**
7179
- * The amount to charge for each unit outside of the allocation
9290
+ * Per-unit price applied to gross consumption and to the allowance credit.
7180
9291
  */
7181
9292
  unit_amount: string;
9293
+ /**
9294
+ * Sub-line label for the credit row (e.g. 'Up to 3x free egress').
9295
+ */
9296
+ allowance_display_name?: string;
9297
+ /**
9298
+ * Sub-line label for the gross consumption row (e.g. 'bytes gotten').
9299
+ */
9300
+ consumption_display_name?: string;
7182
9301
  }
7183
9302
  }
7184
9303
  interface NewSubscriptionPercentCompositePrice {
@@ -7276,9 +9395,23 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
7276
9395
  */
7277
9396
  interface PercentConfig {
7278
9397
  /**
7279
- * What percent of the component subtotals to charge
9398
+ * Fraction of the component subtotals to charge (0 < percent <= 1).
7280
9399
  */
7281
9400
  percent: number;
9401
+ /**
9402
+ * Maximum amount to charge. If unset, the fee has no upper bound.
9403
+ */
9404
+ maximum_amount?: string | null;
9405
+ /**
9406
+ * Minimum amount to charge. If unset, the fee is bounded below by 0.
9407
+ */
9408
+ minimum_amount?: string | null;
9409
+ /**
9410
+ * If true, the minimum_amount is prorated based on the service period. The
9411
+ * maximum_amount is an absolute cap (never prorated), and the percent applied to
9412
+ * upstream subtotals is never prorated either.
9413
+ */
9414
+ prorated?: boolean;
7282
9415
  }
7283
9416
  }
7284
9417
  interface NewSubscriptionEventOutputPrice {
@@ -7413,12 +9546,77 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
7413
9546
  /**
7414
9547
  * The definition of a new adjustment to create and add to the subscription.
7415
9548
  */
7416
- adjustment: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum;
9549
+ adjustment: Shared.NewPercentageDiscount | Shared.NewUsageDiscount | Shared.NewAmountDiscount | Shared.NewMinimum | Shared.NewMaximum | ReplaceAdjustment.NewTieredPercentageDiscount;
7417
9550
  /**
7418
9551
  * The id of the adjustment on the plan to replace in the subscription.
7419
9552
  */
7420
9553
  replaces_adjustment_id: string;
7421
9554
  }
9555
+ namespace ReplaceAdjustment {
9556
+ interface NewTieredPercentageDiscount {
9557
+ adjustment_type: 'tiered_percentage_discount';
9558
+ tiers: Array<NewTieredPercentageDiscount.Tier>;
9559
+ /**
9560
+ * If set, the adjustment will apply to every price on the subscription.
9561
+ */
9562
+ applies_to_all?: true | null;
9563
+ /**
9564
+ * The set of item IDs to which this adjustment applies.
9565
+ */
9566
+ applies_to_item_ids?: Array<string> | null;
9567
+ /**
9568
+ * The set of price IDs to which this adjustment applies.
9569
+ */
9570
+ applies_to_price_ids?: Array<string> | null;
9571
+ /**
9572
+ * If set, only prices in the specified currency will have the adjustment applied.
9573
+ */
9574
+ currency?: string | null;
9575
+ /**
9576
+ * A list of filters that determine which prices this adjustment will apply to.
9577
+ */
9578
+ filters?: Array<NewTieredPercentageDiscount.Filter> | null;
9579
+ /**
9580
+ * When false, this adjustment will be applied to a single price. Otherwise, it
9581
+ * will be applied at the invoice level, possibly to multiple prices.
9582
+ */
9583
+ is_invoice_level?: boolean;
9584
+ /**
9585
+ * If set, only prices of the specified type will have the adjustment applied.
9586
+ */
9587
+ price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null;
9588
+ }
9589
+ namespace NewTieredPercentageDiscount {
9590
+ interface Tier {
9591
+ /**
9592
+ * Exclusive lower bound of cumulative spend for this tier.
9593
+ */
9594
+ lower_bound: number;
9595
+ /**
9596
+ * The percentage (0-1) discounted from spend in this tier.
9597
+ */
9598
+ percentage: number;
9599
+ /**
9600
+ * Inclusive upper bound of cumulative spend; null for the final open-ended tier.
9601
+ */
9602
+ upper_bound?: number | null;
9603
+ }
9604
+ interface Filter {
9605
+ /**
9606
+ * The property of the price to filter on.
9607
+ */
9608
+ field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
9609
+ /**
9610
+ * Should prices that match the filter be included or excluded.
9611
+ */
9612
+ operator: 'includes' | 'excludes';
9613
+ /**
9614
+ * The IDs or values that match this filter.
9615
+ */
9616
+ values: Array<string>;
9617
+ }
9618
+ }
9619
+ }
7422
9620
  interface ReplacePrice {
7423
9621
  /**
7424
9622
  * The id of the price on the plan to replace in the subscription.
@@ -7461,7 +9659,7 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
7461
9659
  /**
7462
9660
  * New subscription price request body params.
7463
9661
  */
7464
- price?: SubscriptionsAPI.NewSubscriptionUnitPrice | SubscriptionsAPI.NewSubscriptionTieredPrice | SubscriptionsAPI.NewSubscriptionBulkPrice | ReplacePrice.NewSubscriptionBulkWithFiltersPrice | SubscriptionsAPI.NewSubscriptionPackagePrice | SubscriptionsAPI.NewSubscriptionMatrixPrice | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice | SubscriptionsAPI.NewSubscriptionTieredPackagePrice | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice | ReplacePrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | ReplacePrice.NewSubscriptionCumulativeGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice | ReplacePrice.NewSubscriptionPercentCompositePrice | ReplacePrice.NewSubscriptionEventOutputPrice | null;
9662
+ price?: SubscriptionsAPI.NewSubscriptionUnitPrice | SubscriptionsAPI.NewSubscriptionTieredPrice | SubscriptionsAPI.NewSubscriptionBulkPrice | ReplacePrice.NewSubscriptionBulkWithFiltersPrice | SubscriptionsAPI.NewSubscriptionPackagePrice | SubscriptionsAPI.NewSubscriptionMatrixPrice | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice | SubscriptionsAPI.NewSubscriptionTieredPackagePrice | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice | ReplacePrice.NewSubscriptionMatrixWithThresholdDiscountsPrice | ReplacePrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | ReplacePrice.NewSubscriptionCumulativeGroupedAllocationPrice | ReplacePrice.NewSubscriptionDailyCreditAllowancePrice | ReplacePrice.NewSubscriptionMeteredAllowancePrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice | ReplacePrice.NewSubscriptionPercentCompositePrice | ReplacePrice.NewSubscriptionEventOutputPrice | null;
7465
9663
  /**
7466
9664
  * The id of the price to add to the subscription.
7467
9665
  */
@@ -7484,7 +9682,139 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
7484
9682
  /**
7485
9683
  * The pricing model type
7486
9684
  */
7487
- model_type: 'bulk_with_filters';
9685
+ model_type: 'bulk_with_filters';
9686
+ /**
9687
+ * The name of the price.
9688
+ */
9689
+ name: string;
9690
+ /**
9691
+ * The id of the billable metric for the price. Only needed if the price is
9692
+ * usage-based.
9693
+ */
9694
+ billable_metric_id?: string | null;
9695
+ /**
9696
+ * If the Price represents a fixed cost, the price will be billed in-advance if
9697
+ * this is true, and in-arrears if this is false.
9698
+ */
9699
+ billed_in_advance?: boolean | null;
9700
+ /**
9701
+ * For custom cadence: specifies the duration of the billing period in days or
9702
+ * months.
9703
+ */
9704
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
9705
+ /**
9706
+ * The per unit conversion rate of the price currency to the invoicing currency.
9707
+ */
9708
+ conversion_rate?: number | null;
9709
+ /**
9710
+ * The configuration for the rate of the price currency to the invoicing currency.
9711
+ */
9712
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
9713
+ /**
9714
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
9715
+ * price is billed.
9716
+ */
9717
+ currency?: string | null;
9718
+ /**
9719
+ * For dimensional price: specifies a price group and dimension values
9720
+ */
9721
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
9722
+ /**
9723
+ * An alias for the price.
9724
+ */
9725
+ external_price_id?: string | null;
9726
+ /**
9727
+ * If the Price represents a fixed cost, this represents the quantity of units
9728
+ * applied.
9729
+ */
9730
+ fixed_price_quantity?: number | null;
9731
+ /**
9732
+ * The property used to group this price on an invoice
9733
+ */
9734
+ invoice_grouping_key?: string | null;
9735
+ /**
9736
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
9737
+ * If unspecified, a single invoice is produced per billing cycle.
9738
+ */
9739
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
9740
+ /**
9741
+ * The ID of the license type to associate with this price.
9742
+ */
9743
+ license_type_id?: string | null;
9744
+ /**
9745
+ * User-specified key/value pairs for the resource. Individual keys can be removed
9746
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
9747
+ * by setting `metadata` to `null`.
9748
+ */
9749
+ metadata?: {
9750
+ [key: string]: string | null;
9751
+ } | null;
9752
+ /**
9753
+ * A transient ID that can be used to reference this price when adding adjustments
9754
+ * in the same API call.
9755
+ */
9756
+ reference_id?: string | null;
9757
+ }
9758
+ namespace NewSubscriptionBulkWithFiltersPrice {
9759
+ /**
9760
+ * Configuration for bulk_with_filters pricing
9761
+ */
9762
+ interface BulkWithFiltersConfig {
9763
+ /**
9764
+ * Property filters to apply (all must match)
9765
+ */
9766
+ filters: Array<BulkWithFiltersConfig.Filter>;
9767
+ /**
9768
+ * Bulk tiers for rating based on total usage volume
9769
+ */
9770
+ tiers: Array<BulkWithFiltersConfig.Tier>;
9771
+ }
9772
+ namespace BulkWithFiltersConfig {
9773
+ /**
9774
+ * Configuration for a single property filter
9775
+ */
9776
+ interface Filter {
9777
+ /**
9778
+ * Event property key to filter on
9779
+ */
9780
+ property_key: string;
9781
+ /**
9782
+ * Event property value to match
9783
+ */
9784
+ property_value: string;
9785
+ }
9786
+ /**
9787
+ * Configuration for a single bulk pricing tier
9788
+ */
9789
+ interface Tier {
9790
+ /**
9791
+ * Amount per unit
9792
+ */
9793
+ unit_amount: string;
9794
+ /**
9795
+ * The lower bound for this tier
9796
+ */
9797
+ tier_lower_bound?: string | null;
9798
+ }
9799
+ }
9800
+ }
9801
+ interface NewSubscriptionMatrixWithThresholdDiscountsPrice {
9802
+ /**
9803
+ * The cadence to bill for this price on.
9804
+ */
9805
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
9806
+ /**
9807
+ * The id of the item the price will be associated with.
9808
+ */
9809
+ item_id: string;
9810
+ /**
9811
+ * Configuration for matrix_with_threshold_discounts pricing
9812
+ */
9813
+ matrix_with_threshold_discounts_config: NewSubscriptionMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig;
9814
+ /**
9815
+ * The pricing model type
9816
+ */
9817
+ model_type: 'matrix_with_threshold_discounts';
7488
9818
  /**
7489
9819
  * The name of the price.
7490
9820
  */
@@ -7557,46 +9887,53 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
7557
9887
  */
7558
9888
  reference_id?: string | null;
7559
9889
  }
7560
- namespace NewSubscriptionBulkWithFiltersPrice {
9890
+ namespace NewSubscriptionMatrixWithThresholdDiscountsPrice {
7561
9891
  /**
7562
- * Configuration for bulk_with_filters pricing
9892
+ * Configuration for matrix_with_threshold_discounts pricing
7563
9893
  */
7564
- interface BulkWithFiltersConfig {
9894
+ interface MatrixWithThresholdDiscountsConfig {
7565
9895
  /**
7566
- * Property filters to apply (all must match)
9896
+ * Unit price used for usage that does not match any defined matrix cell.
7567
9897
  */
7568
- filters: Array<BulkWithFiltersConfig.Filter>;
9898
+ default_unit_amount: string;
7569
9899
  /**
7570
- * Bulk tiers for rating based on total usage volume
9900
+ * First matrix dimension key.
7571
9901
  */
7572
- tiers: Array<BulkWithFiltersConfig.Tier>;
7573
- }
7574
- namespace BulkWithFiltersConfig {
9902
+ first_dimension: string;
7575
9903
  /**
7576
- * Configuration for a single property filter
9904
+ * Per-cell unit prices.
7577
9905
  */
7578
- interface Filter {
7579
- /**
7580
- * Event property key to filter on
7581
- */
7582
- property_key: string;
7583
- /**
7584
- * Event property value to match
7585
- */
7586
- property_value: string;
7587
- }
9906
+ matrix_values: Array<MatrixWithThresholdDiscountsConfig.MatrixValue>;
7588
9907
  /**
7589
- * Configuration for a single bulk pricing tier
9908
+ * Optional second matrix dimension key.
7590
9909
  */
7591
- interface Tier {
9910
+ second_dimension?: string | null;
9911
+ threshold_discount_groups?: Array<MatrixWithThresholdDiscountsConfig.ThresholdDiscountGroup>;
9912
+ }
9913
+ namespace MatrixWithThresholdDiscountsConfig {
9914
+ interface MatrixValue {
9915
+ first_dimension_value: string;
9916
+ unit_amount: string;
9917
+ second_dimension_value?: string | null;
9918
+ }
9919
+ interface ThresholdDiscountGroup {
7592
9920
  /**
7593
- * Amount per unit
9921
+ * Discount rate applied to spend above the threshold.
7594
9922
  */
7595
- unit_amount: string;
9923
+ above_threshold_discount_percentage: string;
7596
9924
  /**
7597
- * The lower bound for this tier
9925
+ * Discount rate applied to spend at or below the threshold. Set to 0 for no
9926
+ * baseline discount.
7598
9927
  */
7599
- tier_lower_bound?: string | null;
9928
+ below_threshold_discount_percentage: string;
9929
+ /**
9930
+ * Semicolon-separated list of matrix cell coordinates targeted by this group. Each
9931
+ * coordinate is `first,second` when the matrix has two dimensions, or just `first`
9932
+ * for a single-dimension matrix. Example: `blue,circle;green,triangle`.
9933
+ */
9934
+ cell_coordinates: string;
9935
+ threshold_amount: string;
9936
+ description?: string | null;
7600
9937
  }
7601
9938
  }
7602
9939
  }
@@ -7940,6 +10277,266 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
7940
10277
  unit_amount: string;
7941
10278
  }
7942
10279
  }
10280
+ interface NewSubscriptionDailyCreditAllowancePrice {
10281
+ /**
10282
+ * The cadence to bill for this price on.
10283
+ */
10284
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
10285
+ /**
10286
+ * Configuration for daily_credit_allowance pricing
10287
+ */
10288
+ daily_credit_allowance_config: NewSubscriptionDailyCreditAllowancePrice.DailyCreditAllowanceConfig;
10289
+ /**
10290
+ * The id of the item the price will be associated with.
10291
+ */
10292
+ item_id: string;
10293
+ /**
10294
+ * The pricing model type
10295
+ */
10296
+ model_type: 'daily_credit_allowance';
10297
+ /**
10298
+ * The name of the price.
10299
+ */
10300
+ name: string;
10301
+ /**
10302
+ * The id of the billable metric for the price. Only needed if the price is
10303
+ * usage-based.
10304
+ */
10305
+ billable_metric_id?: string | null;
10306
+ /**
10307
+ * If the Price represents a fixed cost, the price will be billed in-advance if
10308
+ * this is true, and in-arrears if this is false.
10309
+ */
10310
+ billed_in_advance?: boolean | null;
10311
+ /**
10312
+ * For custom cadence: specifies the duration of the billing period in days or
10313
+ * months.
10314
+ */
10315
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
10316
+ /**
10317
+ * The per unit conversion rate of the price currency to the invoicing currency.
10318
+ */
10319
+ conversion_rate?: number | null;
10320
+ /**
10321
+ * The configuration for the rate of the price currency to the invoicing currency.
10322
+ */
10323
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
10324
+ /**
10325
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
10326
+ * price is billed.
10327
+ */
10328
+ currency?: string | null;
10329
+ /**
10330
+ * For dimensional price: specifies a price group and dimension values
10331
+ */
10332
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
10333
+ /**
10334
+ * An alias for the price.
10335
+ */
10336
+ external_price_id?: string | null;
10337
+ /**
10338
+ * If the Price represents a fixed cost, this represents the quantity of units
10339
+ * applied.
10340
+ */
10341
+ fixed_price_quantity?: number | null;
10342
+ /**
10343
+ * The property used to group this price on an invoice
10344
+ */
10345
+ invoice_grouping_key?: string | null;
10346
+ /**
10347
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
10348
+ * If unspecified, a single invoice is produced per billing cycle.
10349
+ */
10350
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
10351
+ /**
10352
+ * The ID of the license type to associate with this price.
10353
+ */
10354
+ license_type_id?: string | null;
10355
+ /**
10356
+ * User-specified key/value pairs for the resource. Individual keys can be removed
10357
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
10358
+ * by setting `metadata` to `null`.
10359
+ */
10360
+ metadata?: {
10361
+ [key: string]: string | null;
10362
+ } | null;
10363
+ /**
10364
+ * A transient ID that can be used to reference this price when adding adjustments
10365
+ * in the same API call.
10366
+ */
10367
+ reference_id?: string | null;
10368
+ }
10369
+ namespace NewSubscriptionDailyCreditAllowancePrice {
10370
+ /**
10371
+ * Configuration for daily_credit_allowance pricing
10372
+ */
10373
+ interface DailyCreditAllowanceConfig {
10374
+ /**
10375
+ * Credits granted per day. Lose-it-or-use-it; does not roll over.
10376
+ */
10377
+ daily_allowance: string;
10378
+ /**
10379
+ * Default per-unit credit rate for any usage not bucketed into a specified
10380
+ * matrix_value
10381
+ */
10382
+ default_unit_amount: string;
10383
+ /**
10384
+ * One or two event property values to evaluate matrix groups by
10385
+ */
10386
+ dimensions: Array<string | null>;
10387
+ /**
10388
+ * Event property whose value identifies the day bucket the event belongs to (e.g.
10389
+ * 'event_day' set to an ISO date string in the customer's timezone). The allowance
10390
+ * resets per distinct value of this property.
10391
+ */
10392
+ event_day_property: string;
10393
+ /**
10394
+ * Per-dimension credit rates
10395
+ */
10396
+ matrix_values: Array<DailyCreditAllowanceConfig.MatrixValue>;
10397
+ }
10398
+ namespace DailyCreditAllowanceConfig {
10399
+ /**
10400
+ * Per-dimension credit price for the daily credit allowance model.
10401
+ */
10402
+ interface MatrixValue {
10403
+ /**
10404
+ * One or two matrix keys to filter usage to this value by. For example, ["model"]
10405
+ * could be used to apply a different credit rate to each AI model.
10406
+ */
10407
+ dimension_values: Array<string | null>;
10408
+ /**
10409
+ * Credits charged per unit of usage matching the specified dimension_values
10410
+ */
10411
+ unit_amount: string;
10412
+ }
10413
+ }
10414
+ }
10415
+ interface NewSubscriptionMeteredAllowancePrice {
10416
+ /**
10417
+ * The cadence to bill for this price on.
10418
+ */
10419
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
10420
+ /**
10421
+ * The id of the item the price will be associated with.
10422
+ */
10423
+ item_id: string;
10424
+ /**
10425
+ * Configuration for metered_allowance pricing
10426
+ */
10427
+ metered_allowance_config: NewSubscriptionMeteredAllowancePrice.MeteredAllowanceConfig;
10428
+ /**
10429
+ * The pricing model type
10430
+ */
10431
+ model_type: 'metered_allowance';
10432
+ /**
10433
+ * The name of the price.
10434
+ */
10435
+ name: string;
10436
+ /**
10437
+ * The id of the billable metric for the price. Only needed if the price is
10438
+ * usage-based.
10439
+ */
10440
+ billable_metric_id?: string | null;
10441
+ /**
10442
+ * If the Price represents a fixed cost, the price will be billed in-advance if
10443
+ * this is true, and in-arrears if this is false.
10444
+ */
10445
+ billed_in_advance?: boolean | null;
10446
+ /**
10447
+ * For custom cadence: specifies the duration of the billing period in days or
10448
+ * months.
10449
+ */
10450
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
10451
+ /**
10452
+ * The per unit conversion rate of the price currency to the invoicing currency.
10453
+ */
10454
+ conversion_rate?: number | null;
10455
+ /**
10456
+ * The configuration for the rate of the price currency to the invoicing currency.
10457
+ */
10458
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
10459
+ /**
10460
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
10461
+ * price is billed.
10462
+ */
10463
+ currency?: string | null;
10464
+ /**
10465
+ * For dimensional price: specifies a price group and dimension values
10466
+ */
10467
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
10468
+ /**
10469
+ * An alias for the price.
10470
+ */
10471
+ external_price_id?: string | null;
10472
+ /**
10473
+ * If the Price represents a fixed cost, this represents the quantity of units
10474
+ * applied.
10475
+ */
10476
+ fixed_price_quantity?: number | null;
10477
+ /**
10478
+ * The property used to group this price on an invoice
10479
+ */
10480
+ invoice_grouping_key?: string | null;
10481
+ /**
10482
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
10483
+ * If unspecified, a single invoice is produced per billing cycle.
10484
+ */
10485
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
10486
+ /**
10487
+ * The ID of the license type to associate with this price.
10488
+ */
10489
+ license_type_id?: string | null;
10490
+ /**
10491
+ * User-specified key/value pairs for the resource. Individual keys can be removed
10492
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
10493
+ * by setting `metadata` to `null`.
10494
+ */
10495
+ metadata?: {
10496
+ [key: string]: string | null;
10497
+ } | null;
10498
+ /**
10499
+ * A transient ID that can be used to reference this price when adding adjustments
10500
+ * in the same API call.
10501
+ */
10502
+ reference_id?: string | null;
10503
+ }
10504
+ namespace NewSubscriptionMeteredAllowancePrice {
10505
+ /**
10506
+ * Configuration for metered_allowance pricing
10507
+ */
10508
+ interface MeteredAllowanceConfig {
10509
+ /**
10510
+ * The grouping_key value whose summed quantity represents the allowance for this
10511
+ * period (e.g. 'storage_snapshot' emitting 3 × avg storage). Capped at consumption
10512
+ * — credit can never exceed actual usage.
10513
+ */
10514
+ allowance_grouping_value: string;
10515
+ /**
10516
+ * The grouping_key value whose summed quantity represents consumption (e.g.
10517
+ * 'download'). Charged at unit_amount.
10518
+ */
10519
+ consumption_grouping_value: string;
10520
+ /**
10521
+ * Event property used to partition the metric into consumption and allowance
10522
+ * quantities (e.g. 'event_name'). The metric is queried with this key and the two
10523
+ * values below select which partition is which.
10524
+ */
10525
+ grouping_key: string;
10526
+ /**
10527
+ * Per-unit price applied to gross consumption and to the allowance credit.
10528
+ */
10529
+ unit_amount: string;
10530
+ /**
10531
+ * Sub-line label for the credit row (e.g. 'Up to 3x free egress').
10532
+ */
10533
+ allowance_display_name?: string;
10534
+ /**
10535
+ * Sub-line label for the gross consumption row (e.g. 'bytes gotten').
10536
+ */
10537
+ consumption_display_name?: string;
10538
+ }
10539
+ }
7943
10540
  interface NewSubscriptionPercentCompositePrice {
7944
10541
  /**
7945
10542
  * The cadence to bill for this price on.
@@ -8035,9 +10632,23 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
8035
10632
  */
8036
10633
  interface PercentConfig {
8037
10634
  /**
8038
- * What percent of the component subtotals to charge
10635
+ * Fraction of the component subtotals to charge (0 < percent <= 1).
8039
10636
  */
8040
10637
  percent: number;
10638
+ /**
10639
+ * Maximum amount to charge. If unset, the fee has no upper bound.
10640
+ */
10641
+ maximum_amount?: string | null;
10642
+ /**
10643
+ * Minimum amount to charge. If unset, the fee is bounded below by 0.
10644
+ */
10645
+ minimum_amount?: string | null;
10646
+ /**
10647
+ * If true, the minimum_amount is prorated based on the service period. The
10648
+ * maximum_amount is an absolute cap (never prorated), and the percent applied to
10649
+ * upstream subtotals is never prorated either.
10650
+ */
10651
+ prorated?: boolean;
8041
10652
  }
8042
10653
  }
8043
10654
  interface NewSubscriptionEventOutputPrice {