orb-billing 5.6.0 → 5.8.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 (60) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/core.js +3 -3
  3. package/core.js.map +1 -1
  4. package/core.mjs +3 -3
  5. package/core.mjs.map +1 -1
  6. package/index.d.mts +2 -4
  7. package/index.d.ts +2 -4
  8. package/index.d.ts.map +1 -1
  9. package/index.js.map +1 -1
  10. package/index.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/beta/beta.d.ts +288 -10
  13. package/resources/beta/beta.d.ts.map +1 -1
  14. package/resources/beta/beta.js.map +1 -1
  15. package/resources/beta/beta.mjs.map +1 -1
  16. package/resources/beta/external-plan-id.d.ts +288 -10
  17. package/resources/beta/external-plan-id.d.ts.map +1 -1
  18. package/resources/customers/customers.d.ts +27 -6
  19. package/resources/customers/customers.d.ts.map +1 -1
  20. package/resources/customers/customers.js.map +1 -1
  21. package/resources/customers/customers.mjs.map +1 -1
  22. package/resources/index.d.ts +1 -1
  23. package/resources/index.d.ts.map +1 -1
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs.map +1 -1
  26. package/resources/invoices.d.ts +3 -0
  27. package/resources/invoices.d.ts.map +1 -1
  28. package/resources/invoices.js.map +1 -1
  29. package/resources/invoices.mjs.map +1 -1
  30. package/resources/plans/plans.d.ts +144 -5
  31. package/resources/plans/plans.d.ts.map +1 -1
  32. package/resources/plans/plans.js.map +1 -1
  33. package/resources/plans/plans.mjs.map +1 -1
  34. package/resources/prices/prices.d.ts +926 -123
  35. package/resources/prices/prices.d.ts.map +1 -1
  36. package/resources/prices/prices.js.map +1 -1
  37. package/resources/prices/prices.mjs.map +1 -1
  38. package/resources/shared.d.ts +2474 -338
  39. package/resources/shared.d.ts.map +1 -1
  40. package/resources/shared.js.map +1 -1
  41. package/resources/shared.mjs.map +1 -1
  42. package/resources/subscriptions.d.ts +1369 -174
  43. package/resources/subscriptions.d.ts.map +1 -1
  44. package/resources/subscriptions.js.map +1 -1
  45. package/resources/subscriptions.mjs.map +1 -1
  46. package/src/core.ts +3 -3
  47. package/src/index.ts +0 -4
  48. package/src/resources/beta/beta.ts +348 -20
  49. package/src/resources/beta/external-plan-id.ts +348 -20
  50. package/src/resources/customers/customers.ts +48 -6
  51. package/src/resources/index.ts +0 -1
  52. package/src/resources/invoices.ts +3 -0
  53. package/src/resources/plans/plans.ts +174 -10
  54. package/src/resources/prices/prices.ts +1060 -113
  55. package/src/resources/shared.ts +2792 -288
  56. package/src/resources/subscriptions.ts +1609 -202
  57. package/src/version.ts +1 -1
  58. package/version.d.ts +1 -1
  59. package/version.js +1 -1
  60. package/version.mjs +1 -1
@@ -181,53 +181,190 @@ export namespace BetaCreatePlanVersionParams {
181
181
  plan_phase_order?: number | null;
182
182
 
183
183
  /**
184
- * The price to add to the plan
184
+ * New plan price request body params.
185
185
  */
186
186
  price?:
187
187
  | Shared.NewPlanUnitPrice
188
- | Shared.NewPlanPackagePrice
189
- | Shared.NewPlanMatrixPrice
190
188
  | Shared.NewPlanTieredPrice
191
189
  | Shared.NewPlanBulkPrice
190
+ | Shared.NewPlanPackagePrice
191
+ | Shared.NewPlanMatrixPrice
192
192
  | Shared.NewPlanThresholdTotalAmountPrice
193
193
  | Shared.NewPlanTieredPackagePrice
194
194
  | Shared.NewPlanTieredWithMinimumPrice
195
- | Shared.NewPlanUnitWithPercentPrice
195
+ | Shared.NewPlanGroupedTieredPrice
196
+ | Shared.NewPlanTieredPackageWithMinimumPrice
196
197
  | Shared.NewPlanPackageWithAllocationPrice
197
- | Shared.NewPlanTierWithProrationPrice
198
+ | Shared.NewPlanUnitWithPercentPrice
199
+ | Shared.NewPlanMatrixWithAllocationPrice
200
+ | AddPrice.NewPlanTieredWithProrationPrice
198
201
  | Shared.NewPlanUnitWithProrationPrice
199
202
  | Shared.NewPlanGroupedAllocationPrice
203
+ | Shared.NewPlanBulkWithProrationPrice
200
204
  | Shared.NewPlanGroupedWithProratedMinimumPrice
201
205
  | Shared.NewPlanGroupedWithMeteredMinimumPrice
202
206
  | AddPrice.NewPlanGroupedWithMinMaxThresholdsPrice
203
207
  | Shared.NewPlanMatrixWithDisplayNamePrice
204
- | Shared.NewPlanBulkWithProrationPrice
205
208
  | Shared.NewPlanGroupedTieredPackagePrice
206
209
  | Shared.NewPlanMaxGroupTieredPackagePrice
207
210
  | Shared.NewPlanScalableMatrixWithUnitPricingPrice
208
211
  | Shared.NewPlanScalableMatrixWithTieredPricingPrice
209
212
  | Shared.NewPlanCumulativeGroupedBulkPrice
210
- | Shared.NewPlanTieredPackageWithMinimumPrice
211
- | Shared.NewPlanMatrixWithAllocationPrice
212
- | Shared.NewPlanGroupedTieredPrice
213
213
  | Shared.NewPlanMinimumCompositePrice
214
214
  | null;
215
215
  }
216
216
 
217
217
  export namespace AddPrice {
218
+ export interface NewPlanTieredWithProrationPrice {
219
+ /**
220
+ * The cadence to bill for this price on.
221
+ */
222
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
223
+
224
+ /**
225
+ * The id of the item the price will be associated with.
226
+ */
227
+ item_id: string;
228
+
229
+ /**
230
+ * The pricing model type
231
+ */
232
+ model_type: 'tiered_with_proration';
233
+
234
+ /**
235
+ * The name of the price.
236
+ */
237
+ name: string;
238
+
239
+ /**
240
+ * Configuration for tiered_with_proration pricing
241
+ */
242
+ tiered_with_proration_config: NewPlanTieredWithProrationPrice.TieredWithProrationConfig;
243
+
244
+ /**
245
+ * The id of the billable metric for the price. Only needed if the price is
246
+ * usage-based.
247
+ */
248
+ billable_metric_id?: string | null;
249
+
250
+ /**
251
+ * If the Price represents a fixed cost, the price will be billed in-advance if
252
+ * this is true, and in-arrears if this is false.
253
+ */
254
+ billed_in_advance?: boolean | null;
255
+
256
+ /**
257
+ * For custom cadence: specifies the duration of the billing period in days or
258
+ * months.
259
+ */
260
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
261
+
262
+ /**
263
+ * The per unit conversion rate of the price currency to the invoicing currency.
264
+ */
265
+ conversion_rate?: number | null;
266
+
267
+ /**
268
+ * The configuration for the rate of the price currency to the invoicing currency.
269
+ */
270
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
271
+
272
+ /**
273
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
274
+ * price is billed.
275
+ */
276
+ currency?: string | null;
277
+
278
+ /**
279
+ * For dimensional price: specifies a price group and dimension values
280
+ */
281
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
282
+
283
+ /**
284
+ * An alias for the price.
285
+ */
286
+ external_price_id?: string | null;
287
+
288
+ /**
289
+ * If the Price represents a fixed cost, this represents the quantity of units
290
+ * applied.
291
+ */
292
+ fixed_price_quantity?: number | null;
293
+
294
+ /**
295
+ * The property used to group this price on an invoice
296
+ */
297
+ invoice_grouping_key?: string | null;
298
+
299
+ /**
300
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
301
+ * If unspecified, a single invoice is produced per billing cycle.
302
+ */
303
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
304
+
305
+ /**
306
+ * User-specified key/value pairs for the resource. Individual keys can be removed
307
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
308
+ * by setting `metadata` to `null`.
309
+ */
310
+ metadata?: { [key: string]: string | null } | null;
311
+
312
+ /**
313
+ * A transient ID that can be used to reference this price when adding adjustments
314
+ * in the same API call.
315
+ */
316
+ reference_id?: string | null;
317
+ }
318
+
319
+ export namespace NewPlanTieredWithProrationPrice {
320
+ /**
321
+ * Configuration for tiered_with_proration pricing
322
+ */
323
+ export interface TieredWithProrationConfig {
324
+ /**
325
+ * Tiers for rating based on total usage quantities into the specified tier with
326
+ * proration
327
+ */
328
+ tiers: Array<TieredWithProrationConfig.Tier>;
329
+ }
330
+
331
+ export namespace TieredWithProrationConfig {
332
+ /**
333
+ * Configuration for a single tiered with proration tier
334
+ */
335
+ export interface Tier {
336
+ /**
337
+ * Inclusive tier starting value
338
+ */
339
+ tier_lower_bound: string;
340
+
341
+ /**
342
+ * Amount per unit
343
+ */
344
+ unit_amount: string;
345
+ }
346
+ }
347
+ }
348
+
218
349
  export interface NewPlanGroupedWithMinMaxThresholdsPrice {
219
350
  /**
220
351
  * The cadence to bill for this price on.
221
352
  */
222
353
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
223
354
 
224
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
355
+ /**
356
+ * Configuration for grouped_with_min_max_thresholds pricing
357
+ */
358
+ grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
225
359
 
226
360
  /**
227
361
  * The id of the item the price will be associated with.
228
362
  */
229
363
  item_id: string;
230
364
 
365
+ /**
366
+ * The pricing model type
367
+ */
231
368
  model_type: 'grouped_with_min_max_thresholds';
232
369
 
233
370
  /**
@@ -309,6 +446,33 @@ export namespace BetaCreatePlanVersionParams {
309
446
  */
310
447
  reference_id?: string | null;
311
448
  }
449
+
450
+ export namespace NewPlanGroupedWithMinMaxThresholdsPrice {
451
+ /**
452
+ * Configuration for grouped_with_min_max_thresholds pricing
453
+ */
454
+ export interface GroupedWithMinMaxThresholdsConfig {
455
+ /**
456
+ * The event property used to group before applying thresholds
457
+ */
458
+ grouping_key: string;
459
+
460
+ /**
461
+ * The maximum amount to charge each group
462
+ */
463
+ maximum_charge: string;
464
+
465
+ /**
466
+ * The minimum amount to charge each group, regardless of usage
467
+ */
468
+ minimum_charge: string;
469
+
470
+ /**
471
+ * The base price charged per group
472
+ */
473
+ per_unit_rate: string;
474
+ }
475
+ }
312
476
  }
313
477
 
314
478
  export interface RemoveAdjustment {
@@ -374,53 +538,190 @@ export namespace BetaCreatePlanVersionParams {
374
538
  plan_phase_order?: number | null;
375
539
 
376
540
  /**
377
- * The price to add to the plan
541
+ * New plan price request body params.
378
542
  */
379
543
  price?:
380
544
  | Shared.NewPlanUnitPrice
381
- | Shared.NewPlanPackagePrice
382
- | Shared.NewPlanMatrixPrice
383
545
  | Shared.NewPlanTieredPrice
384
546
  | Shared.NewPlanBulkPrice
547
+ | Shared.NewPlanPackagePrice
548
+ | Shared.NewPlanMatrixPrice
385
549
  | Shared.NewPlanThresholdTotalAmountPrice
386
550
  | Shared.NewPlanTieredPackagePrice
387
551
  | Shared.NewPlanTieredWithMinimumPrice
388
- | Shared.NewPlanUnitWithPercentPrice
552
+ | Shared.NewPlanGroupedTieredPrice
553
+ | Shared.NewPlanTieredPackageWithMinimumPrice
389
554
  | Shared.NewPlanPackageWithAllocationPrice
390
- | Shared.NewPlanTierWithProrationPrice
555
+ | Shared.NewPlanUnitWithPercentPrice
556
+ | Shared.NewPlanMatrixWithAllocationPrice
557
+ | ReplacePrice.NewPlanTieredWithProrationPrice
391
558
  | Shared.NewPlanUnitWithProrationPrice
392
559
  | Shared.NewPlanGroupedAllocationPrice
560
+ | Shared.NewPlanBulkWithProrationPrice
393
561
  | Shared.NewPlanGroupedWithProratedMinimumPrice
394
562
  | Shared.NewPlanGroupedWithMeteredMinimumPrice
395
563
  | ReplacePrice.NewPlanGroupedWithMinMaxThresholdsPrice
396
564
  | Shared.NewPlanMatrixWithDisplayNamePrice
397
- | Shared.NewPlanBulkWithProrationPrice
398
565
  | Shared.NewPlanGroupedTieredPackagePrice
399
566
  | Shared.NewPlanMaxGroupTieredPackagePrice
400
567
  | Shared.NewPlanScalableMatrixWithUnitPricingPrice
401
568
  | Shared.NewPlanScalableMatrixWithTieredPricingPrice
402
569
  | Shared.NewPlanCumulativeGroupedBulkPrice
403
- | Shared.NewPlanTieredPackageWithMinimumPrice
404
- | Shared.NewPlanMatrixWithAllocationPrice
405
- | Shared.NewPlanGroupedTieredPrice
406
570
  | Shared.NewPlanMinimumCompositePrice
407
571
  | null;
408
572
  }
409
573
 
410
574
  export namespace ReplacePrice {
575
+ export interface NewPlanTieredWithProrationPrice {
576
+ /**
577
+ * The cadence to bill for this price on.
578
+ */
579
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
580
+
581
+ /**
582
+ * The id of the item the price will be associated with.
583
+ */
584
+ item_id: string;
585
+
586
+ /**
587
+ * The pricing model type
588
+ */
589
+ model_type: 'tiered_with_proration';
590
+
591
+ /**
592
+ * The name of the price.
593
+ */
594
+ name: string;
595
+
596
+ /**
597
+ * Configuration for tiered_with_proration pricing
598
+ */
599
+ tiered_with_proration_config: NewPlanTieredWithProrationPrice.TieredWithProrationConfig;
600
+
601
+ /**
602
+ * The id of the billable metric for the price. Only needed if the price is
603
+ * usage-based.
604
+ */
605
+ billable_metric_id?: string | null;
606
+
607
+ /**
608
+ * If the Price represents a fixed cost, the price will be billed in-advance if
609
+ * this is true, and in-arrears if this is false.
610
+ */
611
+ billed_in_advance?: boolean | null;
612
+
613
+ /**
614
+ * For custom cadence: specifies the duration of the billing period in days or
615
+ * months.
616
+ */
617
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
618
+
619
+ /**
620
+ * The per unit conversion rate of the price currency to the invoicing currency.
621
+ */
622
+ conversion_rate?: number | null;
623
+
624
+ /**
625
+ * The configuration for the rate of the price currency to the invoicing currency.
626
+ */
627
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
628
+
629
+ /**
630
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
631
+ * price is billed.
632
+ */
633
+ currency?: string | null;
634
+
635
+ /**
636
+ * For dimensional price: specifies a price group and dimension values
637
+ */
638
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
639
+
640
+ /**
641
+ * An alias for the price.
642
+ */
643
+ external_price_id?: string | null;
644
+
645
+ /**
646
+ * If the Price represents a fixed cost, this represents the quantity of units
647
+ * applied.
648
+ */
649
+ fixed_price_quantity?: number | null;
650
+
651
+ /**
652
+ * The property used to group this price on an invoice
653
+ */
654
+ invoice_grouping_key?: string | null;
655
+
656
+ /**
657
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
658
+ * If unspecified, a single invoice is produced per billing cycle.
659
+ */
660
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
661
+
662
+ /**
663
+ * User-specified key/value pairs for the resource. Individual keys can be removed
664
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
665
+ * by setting `metadata` to `null`.
666
+ */
667
+ metadata?: { [key: string]: string | null } | null;
668
+
669
+ /**
670
+ * A transient ID that can be used to reference this price when adding adjustments
671
+ * in the same API call.
672
+ */
673
+ reference_id?: string | null;
674
+ }
675
+
676
+ export namespace NewPlanTieredWithProrationPrice {
677
+ /**
678
+ * Configuration for tiered_with_proration pricing
679
+ */
680
+ export interface TieredWithProrationConfig {
681
+ /**
682
+ * Tiers for rating based on total usage quantities into the specified tier with
683
+ * proration
684
+ */
685
+ tiers: Array<TieredWithProrationConfig.Tier>;
686
+ }
687
+
688
+ export namespace TieredWithProrationConfig {
689
+ /**
690
+ * Configuration for a single tiered with proration tier
691
+ */
692
+ export interface Tier {
693
+ /**
694
+ * Inclusive tier starting value
695
+ */
696
+ tier_lower_bound: string;
697
+
698
+ /**
699
+ * Amount per unit
700
+ */
701
+ unit_amount: string;
702
+ }
703
+ }
704
+ }
705
+
411
706
  export interface NewPlanGroupedWithMinMaxThresholdsPrice {
412
707
  /**
413
708
  * The cadence to bill for this price on.
414
709
  */
415
710
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
416
711
 
417
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
712
+ /**
713
+ * Configuration for grouped_with_min_max_thresholds pricing
714
+ */
715
+ grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
418
716
 
419
717
  /**
420
718
  * The id of the item the price will be associated with.
421
719
  */
422
720
  item_id: string;
423
721
 
722
+ /**
723
+ * The pricing model type
724
+ */
424
725
  model_type: 'grouped_with_min_max_thresholds';
425
726
 
426
727
  /**
@@ -502,6 +803,33 @@ export namespace BetaCreatePlanVersionParams {
502
803
  */
503
804
  reference_id?: string | null;
504
805
  }
806
+
807
+ export namespace NewPlanGroupedWithMinMaxThresholdsPrice {
808
+ /**
809
+ * Configuration for grouped_with_min_max_thresholds pricing
810
+ */
811
+ export interface GroupedWithMinMaxThresholdsConfig {
812
+ /**
813
+ * The event property used to group before applying thresholds
814
+ */
815
+ grouping_key: string;
816
+
817
+ /**
818
+ * The maximum amount to charge each group
819
+ */
820
+ maximum_charge: string;
821
+
822
+ /**
823
+ * The minimum amount to charge each group, regardless of usage
824
+ */
825
+ minimum_charge: string;
826
+
827
+ /**
828
+ * The base price charged per group
829
+ */
830
+ per_unit_rate: string;
831
+ }
832
+ }
505
833
  }
506
834
  }
507
835