orb-billing 4.33.0 → 4.47.2

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 (255) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/LICENSE +1 -1
  3. package/README.md +10 -1
  4. package/core.d.ts +4 -5
  5. package/core.d.ts.map +1 -1
  6. package/core.js +16 -11
  7. package/core.js.map +1 -1
  8. package/core.mjs +16 -11
  9. package/core.mjs.map +1 -1
  10. package/error.d.ts +30 -36
  11. package/error.d.ts.map +1 -1
  12. package/error.js +24 -43
  13. package/error.js.map +1 -1
  14. package/error.mjs +24 -43
  15. package/error.mjs.map +1 -1
  16. package/index.d.mts +43 -109
  17. package/index.d.ts +43 -109
  18. package/index.d.ts.map +1 -1
  19. package/index.js +71 -33
  20. package/index.js.map +1 -1
  21. package/index.mjs +43 -32
  22. package/index.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/resources/alerts.d.ts +58 -19
  25. package/resources/alerts.d.ts.map +1 -1
  26. package/resources/alerts.js +19 -37
  27. package/resources/alerts.js.map +1 -1
  28. package/resources/alerts.mjs +19 -14
  29. package/resources/alerts.mjs.map +1 -1
  30. package/resources/coupons/coupons.d.ts +3 -7
  31. package/resources/coupons/coupons.d.ts.map +1 -1
  32. package/resources/coupons/coupons.js +3 -5
  33. package/resources/coupons/coupons.js.map +1 -1
  34. package/resources/coupons/coupons.mjs +3 -5
  35. package/resources/coupons/coupons.mjs.map +1 -1
  36. package/resources/coupons/index.d.ts +2 -2
  37. package/resources/coupons/index.d.ts.map +1 -1
  38. package/resources/coupons/index.js.map +1 -1
  39. package/resources/coupons/index.mjs.map +1 -1
  40. package/resources/coupons/subscriptions.d.ts +1 -2
  41. package/resources/coupons/subscriptions.d.ts.map +1 -1
  42. package/resources/coupons/subscriptions.js +0 -2
  43. package/resources/coupons/subscriptions.js.map +1 -1
  44. package/resources/coupons/subscriptions.mjs +0 -2
  45. package/resources/coupons/subscriptions.mjs.map +1 -1
  46. package/resources/credit-notes.d.ts +29 -4
  47. package/resources/credit-notes.d.ts.map +1 -1
  48. package/resources/credit-notes.js +8 -27
  49. package/resources/credit-notes.js.map +1 -1
  50. package/resources/credit-notes.mjs +8 -4
  51. package/resources/credit-notes.mjs.map +1 -1
  52. package/resources/customers/balance-transactions.d.ts +1 -6
  53. package/resources/customers/balance-transactions.d.ts.map +1 -1
  54. package/resources/customers/balance-transactions.js +1 -27
  55. package/resources/customers/balance-transactions.js.map +1 -1
  56. package/resources/customers/balance-transactions.mjs +1 -4
  57. package/resources/customers/balance-transactions.mjs.map +1 -1
  58. package/resources/customers/costs.d.ts +1 -5
  59. package/resources/customers/costs.d.ts.map +1 -1
  60. package/resources/customers/costs.js +0 -2
  61. package/resources/customers/costs.js.map +1 -1
  62. package/resources/customers/costs.mjs +0 -2
  63. package/resources/customers/costs.mjs.map +1 -1
  64. package/resources/customers/credits/credits.d.ts +15 -31
  65. package/resources/customers/credits/credits.d.ts.map +1 -1
  66. package/resources/customers/credits/credits.js +10 -11
  67. package/resources/customers/credits/credits.js.map +1 -1
  68. package/resources/customers/credits/credits.mjs +10 -11
  69. package/resources/customers/credits/credits.mjs.map +1 -1
  70. package/resources/customers/credits/index.d.ts +3 -3
  71. package/resources/customers/credits/index.d.ts.map +1 -1
  72. package/resources/customers/credits/index.js.map +1 -1
  73. package/resources/customers/credits/index.mjs.map +1 -1
  74. package/resources/customers/credits/ledger.d.ts +15 -23
  75. package/resources/customers/credits/ledger.d.ts.map +1 -1
  76. package/resources/customers/credits/ledger.js +12 -36
  77. package/resources/customers/credits/ledger.js.map +1 -1
  78. package/resources/customers/credits/ledger.mjs +12 -13
  79. package/resources/customers/credits/ledger.mjs.map +1 -1
  80. package/resources/customers/credits/top-ups.d.ts +1 -11
  81. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  82. package/resources/customers/credits/top-ups.js +2 -28
  83. package/resources/customers/credits/top-ups.js.map +1 -1
  84. package/resources/customers/credits/top-ups.mjs +2 -5
  85. package/resources/customers/credits/top-ups.mjs.map +1 -1
  86. package/resources/customers/customers.d.ts +7 -25
  87. package/resources/customers/customers.d.ts.map +1 -1
  88. package/resources/customers/customers.js +10 -10
  89. package/resources/customers/customers.js.map +1 -1
  90. package/resources/customers/customers.mjs +10 -10
  91. package/resources/customers/customers.mjs.map +1 -1
  92. package/resources/customers/index.d.ts +4 -4
  93. package/resources/customers/index.d.ts.map +1 -1
  94. package/resources/customers/index.js.map +1 -1
  95. package/resources/customers/index.mjs.map +1 -1
  96. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +90 -0
  97. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -0
  98. package/resources/dimensional-price-groups/dimensional-price-groups.js +73 -0
  99. package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -0
  100. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +45 -0
  101. package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -0
  102. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +10 -0
  103. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -0
  104. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +15 -0
  105. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -0
  106. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +11 -0
  107. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -0
  108. package/resources/dimensional-price-groups/index.d.ts +3 -0
  109. package/resources/dimensional-price-groups/index.d.ts.map +1 -0
  110. package/resources/dimensional-price-groups/index.js +9 -0
  111. package/resources/dimensional-price-groups/index.js.map +1 -0
  112. package/resources/dimensional-price-groups/index.mjs +4 -0
  113. package/resources/dimensional-price-groups/index.mjs.map +1 -0
  114. package/resources/events/backfills.d.ts +5 -11
  115. package/resources/events/backfills.d.ts.map +1 -1
  116. package/resources/events/backfills.js +5 -29
  117. package/resources/events/backfills.js.map +1 -1
  118. package/resources/events/backfills.mjs +5 -6
  119. package/resources/events/backfills.mjs.map +1 -1
  120. package/resources/events/events.d.ts +7 -22
  121. package/resources/events/events.d.ts.map +1 -1
  122. package/resources/events/events.js +7 -7
  123. package/resources/events/events.js.map +1 -1
  124. package/resources/events/events.mjs +7 -7
  125. package/resources/events/events.mjs.map +1 -1
  126. package/resources/events/index.d.ts +3 -3
  127. package/resources/events/index.d.ts.map +1 -1
  128. package/resources/events/index.js.map +1 -1
  129. package/resources/events/index.mjs.map +1 -1
  130. package/resources/events/volume.d.ts +1 -3
  131. package/resources/events/volume.d.ts.map +1 -1
  132. package/resources/events/volume.js +0 -2
  133. package/resources/events/volume.js.map +1 -1
  134. package/resources/events/volume.mjs +0 -2
  135. package/resources/events/volume.mjs.map +1 -1
  136. package/resources/index.d.ts +14 -13
  137. package/resources/index.d.ts.map +1 -1
  138. package/resources/index.js +10 -7
  139. package/resources/index.js.map +1 -1
  140. package/resources/index.mjs +8 -7
  141. package/resources/index.mjs.map +1 -1
  142. package/resources/invoice-line-items.d.ts +1 -3
  143. package/resources/invoice-line-items.d.ts.map +1 -1
  144. package/resources/invoice-line-items.js +0 -2
  145. package/resources/invoice-line-items.js.map +1 -1
  146. package/resources/invoice-line-items.mjs +0 -2
  147. package/resources/invoice-line-items.mjs.map +1 -1
  148. package/resources/invoices.d.ts +78 -13
  149. package/resources/invoices.d.ts.map +1 -1
  150. package/resources/invoices.js +8 -27
  151. package/resources/invoices.js.map +1 -1
  152. package/resources/invoices.mjs +8 -4
  153. package/resources/invoices.mjs.map +1 -1
  154. package/resources/items.d.ts +1 -6
  155. package/resources/items.d.ts.map +1 -1
  156. package/resources/items.js +1 -27
  157. package/resources/items.js.map +1 -1
  158. package/resources/items.mjs +1 -4
  159. package/resources/items.mjs.map +1 -1
  160. package/resources/metrics.d.ts +1 -6
  161. package/resources/metrics.d.ts.map +1 -1
  162. package/resources/metrics.js +1 -27
  163. package/resources/metrics.js.map +1 -1
  164. package/resources/metrics.mjs +1 -4
  165. package/resources/metrics.mjs.map +1 -1
  166. package/resources/plans/external-plan-id.d.ts +1 -2
  167. package/resources/plans/external-plan-id.d.ts.map +1 -1
  168. package/resources/plans/external-plan-id.js +0 -2
  169. package/resources/plans/external-plan-id.js.map +1 -1
  170. package/resources/plans/external-plan-id.mjs +0 -2
  171. package/resources/plans/external-plan-id.mjs.map +1 -1
  172. package/resources/plans/index.d.ts +2 -2
  173. package/resources/plans/index.d.ts.map +1 -1
  174. package/resources/plans/index.js.map +1 -1
  175. package/resources/plans/index.mjs +1 -1
  176. package/resources/plans/index.mjs.map +1 -1
  177. package/resources/plans/plans.d.ts +331 -9
  178. package/resources/plans/plans.d.ts.map +1 -1
  179. package/resources/plans/plans.js +3 -5
  180. package/resources/plans/plans.js.map +1 -1
  181. package/resources/plans/plans.mjs +3 -5
  182. package/resources/plans/plans.mjs.map +1 -1
  183. package/resources/prices/external-price-id.d.ts +1 -2
  184. package/resources/prices/external-price-id.d.ts.map +1 -1
  185. package/resources/prices/external-price-id.js +0 -2
  186. package/resources/prices/external-price-id.js.map +1 -1
  187. package/resources/prices/external-price-id.mjs +0 -2
  188. package/resources/prices/external-price-id.mjs.map +1 -1
  189. package/resources/prices/index.d.ts +2 -2
  190. package/resources/prices/index.d.ts.map +1 -1
  191. package/resources/prices/index.js +3 -3
  192. package/resources/prices/index.js.map +1 -1
  193. package/resources/prices/index.mjs +1 -1
  194. package/resources/prices/index.mjs.map +1 -1
  195. package/resources/prices/prices.d.ts +339 -13
  196. package/resources/prices/prices.d.ts.map +1 -1
  197. package/resources/prices/prices.js +3 -5
  198. package/resources/prices/prices.js.map +1 -1
  199. package/resources/prices/prices.mjs +3 -5
  200. package/resources/prices/prices.mjs.map +1 -1
  201. package/resources/shared.d.ts +14 -16
  202. package/resources/shared.d.ts.map +1 -1
  203. package/resources/subscriptions.d.ts +7629 -191
  204. package/resources/subscriptions.d.ts.map +1 -1
  205. package/resources/subscriptions.js +2 -29
  206. package/resources/subscriptions.js.map +1 -1
  207. package/resources/subscriptions.mjs +2 -6
  208. package/resources/subscriptions.mjs.map +1 -1
  209. package/resources/top-level.d.ts +1 -2
  210. package/resources/top-level.d.ts.map +1 -1
  211. package/resources/top-level.js +0 -2
  212. package/resources/top-level.js.map +1 -1
  213. package/resources/top-level.mjs +0 -2
  214. package/resources/top-level.mjs.map +1 -1
  215. package/src/core.ts +23 -19
  216. package/src/error.ts +82 -125
  217. package/src/index.ts +334 -130
  218. package/src/resources/alerts.ts +117 -24
  219. package/src/resources/coupons/coupons.ts +13 -8
  220. package/src/resources/coupons/index.ts +2 -2
  221. package/src/resources/coupons/subscriptions.ts +2 -3
  222. package/src/resources/credit-notes.ts +45 -5
  223. package/src/resources/customers/balance-transactions.ts +10 -7
  224. package/src/resources/customers/costs.ts +7 -6
  225. package/src/resources/customers/credits/credits.ts +82 -32
  226. package/src/resources/customers/credits/index.ts +20 -20
  227. package/src/resources/customers/credits/ledger.ts +32 -26
  228. package/src/resources/customers/credits/top-ups.ts +16 -12
  229. package/src/resources/customers/customers.ts +68 -26
  230. package/src/resources/customers/index.ts +17 -17
  231. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +146 -0
  232. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +20 -0
  233. package/src/resources/dimensional-price-groups/index.ts +10 -0
  234. package/src/resources/events/backfills.ts +17 -12
  235. package/src/resources/events/events.ts +42 -23
  236. package/src/resources/events/index.ts +15 -15
  237. package/src/resources/events/volume.ts +2 -4
  238. package/src/resources/index.ts +113 -67
  239. package/src/resources/invoice-line-items.ts +5 -4
  240. package/src/resources/invoices.ts +108 -14
  241. package/src/resources/items.ts +10 -7
  242. package/src/resources/metrics.ts +10 -7
  243. package/src/resources/plans/external-plan-id.ts +2 -3
  244. package/src/resources/plans/index.ts +9 -2
  245. package/src/resources/plans/plans.ts +424 -9
  246. package/src/resources/prices/external-price-id.ts +2 -3
  247. package/src/resources/prices/index.ts +8 -8
  248. package/src/resources/prices/prices.ts +471 -15
  249. package/src/resources/shared.ts +18 -20
  250. package/src/resources/subscriptions.ts +9231 -400
  251. package/src/resources/top-level.ts +2 -3
  252. package/src/version.ts +1 -1
  253. package/version.d.ts +1 -1
  254. package/version.js +1 -1
  255. package/version.mjs +1 -1
@@ -3,9 +3,9 @@
3
3
  import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
- import * as PlansAPI from './plans';
7
6
  import * as Shared from '../shared';
8
7
  import * as ExternalPlanIDAPI from './external-plan-id';
8
+ import { ExternalPlanID, ExternalPlanIDUpdateParams } from './external-plan-id';
9
9
  import * as PricesAPI from '../prices/prices';
10
10
  import { Page, type PageParams } from '../../pagination';
11
11
 
@@ -83,6 +83,18 @@ export class PlansPage extends Page<Plan> {}
83
83
  export interface Plan {
84
84
  id: string;
85
85
 
86
+ /**
87
+ * Adjustments for this plan. If the plan has phases, this includes adjustments
88
+ * across all phases of the plan.
89
+ */
90
+ adjustments: Array<
91
+ | Plan.AmountDiscountAdjustment
92
+ | Plan.PercentageDiscountAdjustment
93
+ | Plan.UsageDiscountAdjustment
94
+ | Plan.MinimumAdjustment
95
+ | Plan.MaximumAdjustment
96
+ >;
97
+
86
98
  base_plan: Plan.BasePlan | null;
87
99
 
88
100
  /**
@@ -167,6 +179,176 @@ export interface Plan {
167
179
  }
168
180
 
169
181
  export namespace Plan {
182
+ export interface AmountDiscountAdjustment {
183
+ id: string;
184
+
185
+ adjustment_type: 'amount_discount';
186
+
187
+ /**
188
+ * The amount by which to discount the prices this adjustment applies to in a given
189
+ * billing period.
190
+ */
191
+ amount_discount: string;
192
+
193
+ /**
194
+ * The price IDs that this adjustment applies to.
195
+ */
196
+ applies_to_price_ids: Array<string>;
197
+
198
+ /**
199
+ * True for adjustments that apply to an entire invocice, false for adjustments
200
+ * that apply to only one price.
201
+ */
202
+ is_invoice_level: boolean;
203
+
204
+ /**
205
+ * The plan phase in which this adjustment is active.
206
+ */
207
+ plan_phase_order: number | null;
208
+
209
+ /**
210
+ * The reason for the adjustment.
211
+ */
212
+ reason: string | null;
213
+ }
214
+
215
+ export interface PercentageDiscountAdjustment {
216
+ id: string;
217
+
218
+ adjustment_type: 'percentage_discount';
219
+
220
+ /**
221
+ * The price IDs that this adjustment applies to.
222
+ */
223
+ applies_to_price_ids: Array<string>;
224
+
225
+ /**
226
+ * True for adjustments that apply to an entire invocice, false for adjustments
227
+ * that apply to only one price.
228
+ */
229
+ is_invoice_level: boolean;
230
+
231
+ /**
232
+ * The percentage (as a value between 0 and 1) by which to discount the price
233
+ * intervals this adjustment applies to in a given billing period.
234
+ */
235
+ percentage_discount: number;
236
+
237
+ /**
238
+ * The plan phase in which this adjustment is active.
239
+ */
240
+ plan_phase_order: number | null;
241
+
242
+ /**
243
+ * The reason for the adjustment.
244
+ */
245
+ reason: string | null;
246
+ }
247
+
248
+ export interface UsageDiscountAdjustment {
249
+ id: string;
250
+
251
+ adjustment_type: 'usage_discount';
252
+
253
+ /**
254
+ * The price IDs that this adjustment applies to.
255
+ */
256
+ applies_to_price_ids: Array<string>;
257
+
258
+ /**
259
+ * True for adjustments that apply to an entire invocice, false for adjustments
260
+ * that apply to only one price.
261
+ */
262
+ is_invoice_level: boolean;
263
+
264
+ /**
265
+ * The plan phase in which this adjustment is active.
266
+ */
267
+ plan_phase_order: number | null;
268
+
269
+ /**
270
+ * The reason for the adjustment.
271
+ */
272
+ reason: string | null;
273
+
274
+ /**
275
+ * The number of usage units by which to discount the price this adjustment applies
276
+ * to in a given billing period.
277
+ */
278
+ usage_discount: number;
279
+ }
280
+
281
+ export interface MinimumAdjustment {
282
+ id: string;
283
+
284
+ adjustment_type: 'minimum';
285
+
286
+ /**
287
+ * The price IDs that this adjustment applies to.
288
+ */
289
+ applies_to_price_ids: Array<string>;
290
+
291
+ /**
292
+ * True for adjustments that apply to an entire invocice, false for adjustments
293
+ * that apply to only one price.
294
+ */
295
+ is_invoice_level: boolean;
296
+
297
+ /**
298
+ * The item ID that revenue from this minimum will be attributed to.
299
+ */
300
+ item_id: string;
301
+
302
+ /**
303
+ * The minimum amount to charge in a given billing period for the prices this
304
+ * adjustment applies to.
305
+ */
306
+ minimum_amount: string;
307
+
308
+ /**
309
+ * The plan phase in which this adjustment is active.
310
+ */
311
+ plan_phase_order: number | null;
312
+
313
+ /**
314
+ * The reason for the adjustment.
315
+ */
316
+ reason: string | null;
317
+ }
318
+
319
+ export interface MaximumAdjustment {
320
+ id: string;
321
+
322
+ adjustment_type: 'maximum';
323
+
324
+ /**
325
+ * The price IDs that this adjustment applies to.
326
+ */
327
+ applies_to_price_ids: Array<string>;
328
+
329
+ /**
330
+ * True for adjustments that apply to an entire invocice, false for adjustments
331
+ * that apply to only one price.
332
+ */
333
+ is_invoice_level: boolean;
334
+
335
+ /**
336
+ * The maximum amount to charge in a given billing period for the prices this
337
+ * adjustment applies to.
338
+ */
339
+ maximum_amount: string;
340
+
341
+ /**
342
+ * The plan phase in which this adjustment is active.
343
+ */
344
+ plan_phase_order: number | null;
345
+
346
+ /**
347
+ * The reason for the adjustment.
348
+ */
349
+ reason: string | null;
350
+ }
351
+
170
352
  export interface BasePlan {
171
353
  id: string | null;
172
354
 
@@ -312,7 +494,9 @@ export interface PlanCreateParams {
312
494
  | PlanCreateParams.NewPlanGroupedAllocationPrice
313
495
  | PlanCreateParams.NewPlanGroupedWithProratedMinimumPrice
314
496
  | PlanCreateParams.NewPlanGroupedWithMeteredMinimumPrice
497
+ | PlanCreateParams.NewPlanMatrixWithDisplayNamePrice
315
498
  | PlanCreateParams.NewPlanBulkWithProrationPrice
499
+ | PlanCreateParams.NewPlanGroupedTieredPackagePrice
316
500
  >;
317
501
 
318
502
  /**
@@ -2549,6 +2733,119 @@ export namespace PlanCreateParams {
2549
2733
  }
2550
2734
  }
2551
2735
 
2736
+ export interface NewPlanMatrixWithDisplayNamePrice {
2737
+ /**
2738
+ * The cadence to bill for this price on.
2739
+ */
2740
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
2741
+
2742
+ /**
2743
+ * The id of the item the plan will be associated with.
2744
+ */
2745
+ item_id: string;
2746
+
2747
+ matrix_with_display_name_config: Record<string, unknown>;
2748
+
2749
+ model_type: 'matrix_with_display_name';
2750
+
2751
+ /**
2752
+ * The name of the price.
2753
+ */
2754
+ name: string;
2755
+
2756
+ /**
2757
+ * The id of the billable metric for the price. Only needed if the price is
2758
+ * usage-based.
2759
+ */
2760
+ billable_metric_id?: string | null;
2761
+
2762
+ /**
2763
+ * If the Price represents a fixed cost, the price will be billed in-advance if
2764
+ * this is true, and in-arrears if this is false.
2765
+ */
2766
+ billed_in_advance?: boolean | null;
2767
+
2768
+ /**
2769
+ * For custom cadence: specifies the duration of the billing period in days or
2770
+ * months.
2771
+ */
2772
+ billing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.BillingCycleConfiguration | null;
2773
+
2774
+ /**
2775
+ * The per unit conversion rate of the price currency to the invoicing currency.
2776
+ */
2777
+ conversion_rate?: number | null;
2778
+
2779
+ /**
2780
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
2781
+ * price is billed.
2782
+ */
2783
+ currency?: string | null;
2784
+
2785
+ /**
2786
+ * An alias for the price.
2787
+ */
2788
+ external_price_id?: string | null;
2789
+
2790
+ /**
2791
+ * If the Price represents a fixed cost, this represents the quantity of units
2792
+ * applied.
2793
+ */
2794
+ fixed_price_quantity?: number | null;
2795
+
2796
+ /**
2797
+ * The property used to group this price on an invoice
2798
+ */
2799
+ invoice_grouping_key?: string | null;
2800
+
2801
+ /**
2802
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
2803
+ * If unspecified, a single invoice is produced per billing cycle.
2804
+ */
2805
+ invoicing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null;
2806
+
2807
+ /**
2808
+ * User-specified key/value pairs for the resource. Individual keys can be removed
2809
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
2810
+ * by setting `metadata` to `null`.
2811
+ */
2812
+ metadata?: Record<string, string | null> | null;
2813
+ }
2814
+
2815
+ export namespace NewPlanMatrixWithDisplayNamePrice {
2816
+ /**
2817
+ * For custom cadence: specifies the duration of the billing period in days or
2818
+ * months.
2819
+ */
2820
+ export interface BillingCycleConfiguration {
2821
+ /**
2822
+ * The duration of the billing period.
2823
+ */
2824
+ duration: number;
2825
+
2826
+ /**
2827
+ * The unit of billing period duration.
2828
+ */
2829
+ duration_unit: 'day' | 'month';
2830
+ }
2831
+
2832
+ /**
2833
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
2834
+ * If unspecified, a single invoice is produced per billing cycle.
2835
+ */
2836
+ export interface InvoicingCycleConfiguration {
2837
+ /**
2838
+ * The duration of the billing period.
2839
+ */
2840
+ duration: number;
2841
+
2842
+ /**
2843
+ * The unit of billing period duration.
2844
+ */
2845
+ duration_unit: 'day' | 'month';
2846
+ }
2847
+ }
2848
+
2552
2849
  export interface NewPlanBulkWithProrationPrice {
2553
2850
  bulk_with_proration_config: Record<string, unknown>;
2554
2851
 
@@ -2661,6 +2958,119 @@ export namespace PlanCreateParams {
2661
2958
  duration_unit: 'day' | 'month';
2662
2959
  }
2663
2960
  }
2961
+
2962
+ export interface NewPlanGroupedTieredPackagePrice {
2963
+ /**
2964
+ * The cadence to bill for this price on.
2965
+ */
2966
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
2967
+
2968
+ grouped_tiered_package_config: Record<string, unknown>;
2969
+
2970
+ /**
2971
+ * The id of the item the plan will be associated with.
2972
+ */
2973
+ item_id: string;
2974
+
2975
+ model_type: 'grouped_tiered_package';
2976
+
2977
+ /**
2978
+ * The name of the price.
2979
+ */
2980
+ name: string;
2981
+
2982
+ /**
2983
+ * The id of the billable metric for the price. Only needed if the price is
2984
+ * usage-based.
2985
+ */
2986
+ billable_metric_id?: string | null;
2987
+
2988
+ /**
2989
+ * If the Price represents a fixed cost, the price will be billed in-advance if
2990
+ * this is true, and in-arrears if this is false.
2991
+ */
2992
+ billed_in_advance?: boolean | null;
2993
+
2994
+ /**
2995
+ * For custom cadence: specifies the duration of the billing period in days or
2996
+ * months.
2997
+ */
2998
+ billing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.BillingCycleConfiguration | null;
2999
+
3000
+ /**
3001
+ * The per unit conversion rate of the price currency to the invoicing currency.
3002
+ */
3003
+ conversion_rate?: number | null;
3004
+
3005
+ /**
3006
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
3007
+ * price is billed.
3008
+ */
3009
+ currency?: string | null;
3010
+
3011
+ /**
3012
+ * An alias for the price.
3013
+ */
3014
+ external_price_id?: string | null;
3015
+
3016
+ /**
3017
+ * If the Price represents a fixed cost, this represents the quantity of units
3018
+ * applied.
3019
+ */
3020
+ fixed_price_quantity?: number | null;
3021
+
3022
+ /**
3023
+ * The property used to group this price on an invoice
3024
+ */
3025
+ invoice_grouping_key?: string | null;
3026
+
3027
+ /**
3028
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
3029
+ * If unspecified, a single invoice is produced per billing cycle.
3030
+ */
3031
+ invoicing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.InvoicingCycleConfiguration | null;
3032
+
3033
+ /**
3034
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3035
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3036
+ * by setting `metadata` to `null`.
3037
+ */
3038
+ metadata?: Record<string, string | null> | null;
3039
+ }
3040
+
3041
+ export namespace NewPlanGroupedTieredPackagePrice {
3042
+ /**
3043
+ * For custom cadence: specifies the duration of the billing period in days or
3044
+ * months.
3045
+ */
3046
+ export interface BillingCycleConfiguration {
3047
+ /**
3048
+ * The duration of the billing period.
3049
+ */
3050
+ duration: number;
3051
+
3052
+ /**
3053
+ * The unit of billing period duration.
3054
+ */
3055
+ duration_unit: 'day' | 'month';
3056
+ }
3057
+
3058
+ /**
3059
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
3060
+ * If unspecified, a single invoice is produced per billing cycle.
3061
+ */
3062
+ export interface InvoicingCycleConfiguration {
3063
+ /**
3064
+ * The duration of the billing period.
3065
+ */
3066
+ duration: number;
3067
+
3068
+ /**
3069
+ * The unit of billing period duration.
3070
+ */
3071
+ duration_unit: 'day' | 'month';
3072
+ }
3073
+ }
2664
3074
  }
2665
3075
 
2666
3076
  export interface PlanUpdateParams {
@@ -2694,12 +3104,17 @@ export interface PlanListParams extends PageParams {
2694
3104
  status?: 'active' | 'archived' | 'draft';
2695
3105
  }
2696
3106
 
2697
- export namespace Plans {
2698
- export import Plan = PlansAPI.Plan;
2699
- export import PlansPage = PlansAPI.PlansPage;
2700
- export import PlanCreateParams = PlansAPI.PlanCreateParams;
2701
- export import PlanUpdateParams = PlansAPI.PlanUpdateParams;
2702
- export import PlanListParams = PlansAPI.PlanListParams;
2703
- export import ExternalPlanID = ExternalPlanIDAPI.ExternalPlanID;
2704
- export import ExternalPlanIDUpdateParams = ExternalPlanIDAPI.ExternalPlanIDUpdateParams;
3107
+ Plans.PlansPage = PlansPage;
3108
+ Plans.ExternalPlanID = ExternalPlanID;
3109
+
3110
+ export declare namespace Plans {
3111
+ export {
3112
+ type Plan as Plan,
3113
+ PlansPage as PlansPage,
3114
+ type PlanCreateParams as PlanCreateParams,
3115
+ type PlanUpdateParams as PlanUpdateParams,
3116
+ type PlanListParams as PlanListParams,
3117
+ };
3118
+
3119
+ export { ExternalPlanID as ExternalPlanID, type ExternalPlanIDUpdateParams as ExternalPlanIDUpdateParams };
2705
3120
  }
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { APIResource } from '../../resource';
4
4
  import * as Core from '../../core';
5
- import * as ExternalPriceIDAPI from './external-price-id';
6
5
  import * as PricesAPI from './prices';
7
6
 
8
7
  export class ExternalPriceID extends APIResource {
@@ -38,6 +37,6 @@ export interface ExternalPriceIDUpdateParams {
38
37
  metadata?: Record<string, string | null> | null;
39
38
  }
40
39
 
41
- export namespace ExternalPriceID {
42
- export import ExternalPriceIDUpdateParams = ExternalPriceIDAPI.ExternalPriceIDUpdateParams;
40
+ export declare namespace ExternalPriceID {
41
+ export { type ExternalPriceIDUpdateParams as ExternalPriceIDUpdateParams };
43
42
  }
@@ -1,14 +1,14 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ export { ExternalPriceID, type ExternalPriceIDUpdateParams } from './external-price-id';
3
4
  export {
4
- EvaluatePriceGroup,
5
- Price,
6
- PriceEvaluateResponse,
7
- PriceCreateParams,
8
- PriceUpdateParams,
9
- PriceListParams,
10
- PriceEvaluateParams,
11
5
  PricesPage,
12
6
  Prices,
7
+ type EvaluatePriceGroup,
8
+ type Price,
9
+ type PriceEvaluateResponse,
10
+ type PriceCreateParams,
11
+ type PriceUpdateParams,
12
+ type PriceListParams,
13
+ type PriceEvaluateParams,
13
14
  } from './prices';
14
- export { ExternalPriceIDUpdateParams, ExternalPriceID } from './external-price-id';