orb-billing 1.22.0 → 1.24.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 (107) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/core.d.ts.map +1 -1
  3. package/core.js +8 -10
  4. package/core.js.map +1 -1
  5. package/core.mjs +8 -10
  6. package/core.mjs.map +1 -1
  7. package/index.d.mts +2 -2
  8. package/index.d.ts +2 -2
  9. package/index.d.ts.map +1 -1
  10. package/index.js +4 -0
  11. package/index.js.map +1 -1
  12. package/index.mjs +4 -0
  13. package/index.mjs.map +1 -1
  14. package/package.json +3 -1
  15. package/resources/coupons/coupons.d.ts +60 -2
  16. package/resources/coupons/coupons.d.ts.map +1 -1
  17. package/resources/coupons/coupons.js.map +1 -1
  18. package/resources/coupons/coupons.mjs.map +1 -1
  19. package/resources/credit-notes.d.ts +57 -5
  20. package/resources/credit-notes.d.ts.map +1 -1
  21. package/resources/credit-notes.js.map +1 -1
  22. package/resources/credit-notes.mjs.map +1 -1
  23. package/resources/customers/balance-transactions.d.ts +2 -2
  24. package/resources/customers/balance-transactions.d.ts.map +1 -1
  25. package/resources/customers/balance-transactions.js.map +1 -1
  26. package/resources/customers/balance-transactions.mjs.map +1 -1
  27. package/resources/customers/customers.d.ts +696 -8
  28. package/resources/customers/customers.d.ts.map +1 -1
  29. package/resources/customers/customers.js.map +1 -1
  30. package/resources/customers/customers.mjs.map +1 -1
  31. package/resources/customers/usage.d.ts +74 -58
  32. package/resources/customers/usage.d.ts.map +1 -1
  33. package/resources/customers/usage.js +14 -14
  34. package/resources/customers/usage.js.map +1 -1
  35. package/resources/customers/usage.mjs +14 -14
  36. package/resources/customers/usage.mjs.map +1 -1
  37. package/resources/events/events.d.ts +40 -40
  38. package/resources/events/events.js +40 -40
  39. package/resources/events/events.mjs +40 -40
  40. package/resources/index.d.ts +4 -3
  41. package/resources/index.d.ts.map +1 -1
  42. package/resources/index.js +19 -4
  43. package/resources/index.js.map +1 -1
  44. package/resources/index.mjs +2 -1
  45. package/resources/index.mjs.map +1 -1
  46. package/resources/invoice-line-items.d.ts +2 -2
  47. package/resources/invoice-line-items.d.ts.map +1 -1
  48. package/resources/invoices.d.ts +358 -71
  49. package/resources/invoices.d.ts.map +1 -1
  50. package/resources/invoices.js.map +1 -1
  51. package/resources/invoices.mjs.map +1 -1
  52. package/resources/plans/plans.d.ts +648 -4
  53. package/resources/plans/plans.d.ts.map +1 -1
  54. package/resources/plans/plans.js.map +1 -1
  55. package/resources/plans/plans.mjs.map +1 -1
  56. package/resources/prices/index.d.ts +1 -1
  57. package/resources/prices/index.d.ts.map +1 -1
  58. package/resources/prices/index.js +3 -3
  59. package/resources/prices/index.js.map +1 -1
  60. package/resources/prices/index.mjs +1 -1
  61. package/resources/prices/index.mjs.map +1 -1
  62. package/resources/prices/prices.d.ts +56 -83
  63. package/resources/prices/prices.d.ts.map +1 -1
  64. package/resources/prices/prices.js.map +1 -1
  65. package/resources/prices/prices.mjs.map +1 -1
  66. package/resources/shared.d.ts +62 -0
  67. package/resources/shared.d.ts.map +1 -0
  68. package/resources/shared.js +4 -0
  69. package/resources/shared.js.map +1 -0
  70. package/resources/shared.mjs +3 -0
  71. package/resources/shared.mjs.map +1 -0
  72. package/resources/subscriptions.d.ts +1084 -241
  73. package/resources/subscriptions.d.ts.map +1 -1
  74. package/resources/subscriptions.js.map +1 -1
  75. package/resources/subscriptions.mjs.map +1 -1
  76. package/src/_shims/index.d.ts +1 -1
  77. package/src/_shims/index.mjs +1 -1
  78. package/src/core.ts +8 -12
  79. package/src/index.ts +8 -3
  80. package/src/resources/coupons/coupons.ts +82 -8
  81. package/src/resources/coupons/subscriptions.ts +7 -7
  82. package/src/resources/credit-notes.ts +86 -10
  83. package/src/resources/customers/balance-transactions.ts +23 -7
  84. package/src/resources/customers/costs.ts +5 -5
  85. package/src/resources/customers/credits/credits.ts +6 -6
  86. package/src/resources/customers/credits/ledger.ts +5 -5
  87. package/src/resources/customers/customers.ts +1153 -21
  88. package/src/resources/customers/usage.ts +83 -65
  89. package/src/resources/events/backfills.ts +5 -5
  90. package/src/resources/events/events.ts +45 -45
  91. package/src/resources/index.ts +3 -3
  92. package/src/resources/invoice-line-items.ts +6 -6
  93. package/src/resources/invoices.ts +604 -97
  94. package/src/resources/items.ts +5 -5
  95. package/src/resources/metrics.ts +5 -5
  96. package/src/resources/plans/external-plan-id.ts +5 -5
  97. package/src/resources/plans/plans.ts +817 -11
  98. package/src/resources/prices/external-price-id.ts +3 -3
  99. package/src/resources/prices/index.ts +1 -1
  100. package/src/resources/prices/prices.ts +73 -106
  101. package/src/resources/shared.ts +84 -0
  102. package/src/resources/subscriptions.ts +1299 -287
  103. package/src/resources/top-level.ts +3 -3
  104. package/src/version.ts +1 -1
  105. package/version.d.ts +1 -1
  106. package/version.js +1 -1
  107. package/version.mjs +1 -1
@@ -1,13 +1,13 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../../ling/core";
4
- import { APIResource } from "../../ling/resource";
5
- import { isRequestOptions } from "../../ling/core";
6
- import * as PlansAPI from "../../ling/resources/plans/plans";
7
- import * as InvoicesAPI from "../../ling/resources/invoices";
8
- import * as ExternalPlanIDAPI from "../../ling/resources/plans/external-plan-id";
9
- import * as PricesAPI from "../../ling/resources/prices/prices";
10
- import { Page, type PageParams } from "../../ling/pagination";
3
+ import * as Core from "../../core";
4
+ import { APIResource } from "../../resource";
5
+ import { isRequestOptions } from "../../core";
6
+ import * as PlansAPI from "./plans";
7
+ import * as Shared from "../shared";
8
+ import * as ExternalPlanIDAPI from "./external-plan-id";
9
+ import * as PricesAPI from "../prices/prices";
10
+ import { Page, type PageParams } from "../../pagination";
11
11
 
12
12
  export class Plans extends APIResource {
13
13
  externalPlanId: ExternalPlanIDAPI.ExternalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this.client);
@@ -116,7 +116,7 @@ export interface Plan {
116
116
 
117
117
  description: string;
118
118
 
119
- discount: InvoicesAPI.InvoiceDiscount | null;
119
+ discount: Shared.Discount | null;
120
120
 
121
121
  /**
122
122
  * An optional user-defined ID for this plan resource, used throughout the system
@@ -212,7 +212,7 @@ export namespace Plan {
212
212
 
213
213
  description: string | null;
214
214
 
215
- discount: InvoicesAPI.InvoiceDiscount | null;
215
+ discount: Shared.Discount | null;
216
216
 
217
217
  /**
218
218
  * How many terms of length `duration_unit` this phase is active for. If null, this
@@ -294,7 +294,20 @@ export interface PlanCreateParams {
294
294
  * Prices for this plan. If the plan has phases, this includes prices across all
295
295
  * phases of the plan.
296
296
  */
297
- prices: Array<unknown>;
297
+ prices: Array<
298
+ | PlanCreateParams.NewPlanUnitPrice
299
+ | PlanCreateParams.NewPlanPackagePrice
300
+ | PlanCreateParams.NewPlanMatrixPrice
301
+ | PlanCreateParams.NewPlanTieredPrice
302
+ | PlanCreateParams.NewPlanTieredBpsPrice
303
+ | PlanCreateParams.NewPlanBpsPrice
304
+ | PlanCreateParams.NewPlanBulkBpsPrice
305
+ | PlanCreateParams.NewPlanBulkPrice
306
+ | PlanCreateParams.NewPlanThresholdTotalAmountPrice
307
+ | PlanCreateParams.NewPlanTieredPackagePrice
308
+ | PlanCreateParams.NewPlanTieredWithMinimumPrice
309
+ | PlanCreateParams.NewPlanPackageWithAllocationPrice
310
+ >;
298
311
 
299
312
  /**
300
313
  * Free-form text which is available on the invoice PDF and the Orb invoice portal.
@@ -313,6 +326,799 @@ export interface PlanCreateParams {
313
326
  net_terms?: number | null;
314
327
  }
315
328
 
329
+ export namespace PlanCreateParams {
330
+ export interface NewPlanUnitPrice {
331
+ /**
332
+ * The cadence to bill for this price on.
333
+ */
334
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
335
+
336
+ /**
337
+ * The id of the item the plan will be associated with.
338
+ */
339
+ item_id: string;
340
+
341
+ model_type: 'unit';
342
+
343
+ /**
344
+ * The name of the price.
345
+ */
346
+ name: string;
347
+
348
+ unit_config: NewPlanUnitPrice.UnitConfig;
349
+
350
+ /**
351
+ * The id of the billable metric for the price. Only needed if the price is
352
+ * usage-based.
353
+ */
354
+ billable_metric_id?: string | null;
355
+
356
+ /**
357
+ * If the Price represents a fixed cost, the price will be billed in-advance if
358
+ * this is true, and in-arrears if this is false.
359
+ */
360
+ billed_in_advance?: boolean | null;
361
+
362
+ /**
363
+ * An alias for the price.
364
+ */
365
+ external_price_id?: string | null;
366
+
367
+ /**
368
+ * If the Price represents a fixed cost, this represents the quantity of units
369
+ * applied.
370
+ */
371
+ fixed_price_quantity?: number | null;
372
+
373
+ /**
374
+ * The property used to group this price on an invoice
375
+ */
376
+ invoice_grouping_key?: string | null;
377
+ }
378
+
379
+ export namespace NewPlanUnitPrice {
380
+ export interface UnitConfig {
381
+ /**
382
+ * Rate per unit of usage
383
+ */
384
+ unit_amount: string;
385
+
386
+ /**
387
+ * Multiplier to scale rated quantity by
388
+ */
389
+ scaling_factor?: number | null;
390
+ }
391
+ }
392
+
393
+ export interface NewPlanPackagePrice {
394
+ /**
395
+ * The cadence to bill for this price on.
396
+ */
397
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
398
+
399
+ /**
400
+ * The id of the item the plan will be associated with.
401
+ */
402
+ item_id: string;
403
+
404
+ model_type: 'package';
405
+
406
+ /**
407
+ * The name of the price.
408
+ */
409
+ name: string;
410
+
411
+ package_config: NewPlanPackagePrice.PackageConfig;
412
+
413
+ /**
414
+ * The id of the billable metric for the price. Only needed if the price is
415
+ * usage-based.
416
+ */
417
+ billable_metric_id?: string | null;
418
+
419
+ /**
420
+ * If the Price represents a fixed cost, the price will be billed in-advance if
421
+ * this is true, and in-arrears if this is false.
422
+ */
423
+ billed_in_advance?: boolean | null;
424
+
425
+ /**
426
+ * An alias for the price.
427
+ */
428
+ external_price_id?: string | null;
429
+
430
+ /**
431
+ * If the Price represents a fixed cost, this represents the quantity of units
432
+ * applied.
433
+ */
434
+ fixed_price_quantity?: number | null;
435
+
436
+ /**
437
+ * The property used to group this price on an invoice
438
+ */
439
+ invoice_grouping_key?: string | null;
440
+ }
441
+
442
+ export namespace NewPlanPackagePrice {
443
+ export interface PackageConfig {
444
+ /**
445
+ * A currency amount to rate usage by
446
+ */
447
+ package_amount: string;
448
+
449
+ /**
450
+ * An integer amount to represent package size. For example, 1000 here would divide
451
+ * usage by 1000 before multiplying by package_amount in rating
452
+ */
453
+ package_size?: number | null;
454
+ }
455
+ }
456
+
457
+ export interface NewPlanMatrixPrice {
458
+ /**
459
+ * The cadence to bill for this price on.
460
+ */
461
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
462
+
463
+ /**
464
+ * The id of the item the plan will be associated with.
465
+ */
466
+ item_id: string;
467
+
468
+ matrix_config: NewPlanMatrixPrice.MatrixConfig;
469
+
470
+ model_type: 'matrix';
471
+
472
+ /**
473
+ * The name of the price.
474
+ */
475
+ name: string;
476
+
477
+ /**
478
+ * The id of the billable metric for the price. Only needed if the price is
479
+ * usage-based.
480
+ */
481
+ billable_metric_id?: string | null;
482
+
483
+ /**
484
+ * If the Price represents a fixed cost, the price will be billed in-advance if
485
+ * this is true, and in-arrears if this is false.
486
+ */
487
+ billed_in_advance?: boolean | null;
488
+
489
+ /**
490
+ * An alias for the price.
491
+ */
492
+ external_price_id?: string | null;
493
+
494
+ /**
495
+ * If the Price represents a fixed cost, this represents the quantity of units
496
+ * applied.
497
+ */
498
+ fixed_price_quantity?: number | null;
499
+
500
+ /**
501
+ * The property used to group this price on an invoice
502
+ */
503
+ invoice_grouping_key?: string | null;
504
+ }
505
+
506
+ export namespace NewPlanMatrixPrice {
507
+ export interface MatrixConfig {
508
+ /**
509
+ * Default per unit rate for any usage not bucketed into a specified matrix_value
510
+ */
511
+ default_unit_amount: string;
512
+
513
+ /**
514
+ * One or two event property values to evaluate matrix groups by
515
+ */
516
+ dimensions: Array<string | null>;
517
+
518
+ /**
519
+ * Matrix values for specified matrix grouping keys
520
+ */
521
+ matrix_values: Array<MatrixConfig.MatrixValue>;
522
+
523
+ /**
524
+ * Default optional multiplier to scale rated quantities that fall into the default
525
+ * bucket by
526
+ */
527
+ scaling_factor?: number | null;
528
+ }
529
+
530
+ export namespace MatrixConfig {
531
+ export interface MatrixValue {
532
+ /**
533
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
534
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
535
+ * instance tier.
536
+ */
537
+ dimension_values: Array<string | null>;
538
+
539
+ /**
540
+ * Unit price for the specified dimension_values
541
+ */
542
+ unit_amount: string;
543
+
544
+ /**
545
+ * Optional multiplier to scale rated quantities by
546
+ */
547
+ scaling_factor?: number | null;
548
+ }
549
+ }
550
+ }
551
+
552
+ export interface NewPlanTieredPrice {
553
+ /**
554
+ * The cadence to bill for this price on.
555
+ */
556
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
557
+
558
+ /**
559
+ * The id of the item the plan will be associated with.
560
+ */
561
+ item_id: string;
562
+
563
+ model_type: 'tiered';
564
+
565
+ /**
566
+ * The name of the price.
567
+ */
568
+ name: string;
569
+
570
+ tiered_config: NewPlanTieredPrice.TieredConfig;
571
+
572
+ /**
573
+ * The id of the billable metric for the price. Only needed if the price is
574
+ * usage-based.
575
+ */
576
+ billable_metric_id?: string | null;
577
+
578
+ /**
579
+ * If the Price represents a fixed cost, the price will be billed in-advance if
580
+ * this is true, and in-arrears if this is false.
581
+ */
582
+ billed_in_advance?: boolean | null;
583
+
584
+ /**
585
+ * An alias for the price.
586
+ */
587
+ external_price_id?: string | null;
588
+
589
+ /**
590
+ * If the Price represents a fixed cost, this represents the quantity of units
591
+ * applied.
592
+ */
593
+ fixed_price_quantity?: number | null;
594
+
595
+ /**
596
+ * The property used to group this price on an invoice
597
+ */
598
+ invoice_grouping_key?: string | null;
599
+ }
600
+
601
+ export namespace NewPlanTieredPrice {
602
+ export interface TieredConfig {
603
+ /**
604
+ * Tiers for rating based on total usage quantities into the specified tier
605
+ */
606
+ tiers: Array<TieredConfig.Tier>;
607
+ }
608
+
609
+ export namespace TieredConfig {
610
+ export interface Tier {
611
+ /**
612
+ * Inclusive tier starting value
613
+ */
614
+ first_unit: number;
615
+
616
+ /**
617
+ * Amount per unit
618
+ */
619
+ unit_amount: string;
620
+
621
+ /**
622
+ * Exclusive tier ending value. If null, this is treated as the last tier
623
+ */
624
+ last_unit?: number | null;
625
+ }
626
+ }
627
+ }
628
+
629
+ export interface NewPlanTieredBpsPrice {
630
+ /**
631
+ * The cadence to bill for this price on.
632
+ */
633
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
634
+
635
+ /**
636
+ * The id of the item the plan will be associated with.
637
+ */
638
+ item_id: string;
639
+
640
+ model_type: 'tiered_bps';
641
+
642
+ /**
643
+ * The name of the price.
644
+ */
645
+ name: string;
646
+
647
+ tiered_bps_config: NewPlanTieredBpsPrice.TieredBpsConfig;
648
+
649
+ /**
650
+ * The id of the billable metric for the price. Only needed if the price is
651
+ * usage-based.
652
+ */
653
+ billable_metric_id?: string | null;
654
+
655
+ /**
656
+ * If the Price represents a fixed cost, the price will be billed in-advance if
657
+ * this is true, and in-arrears if this is false.
658
+ */
659
+ billed_in_advance?: boolean | null;
660
+
661
+ /**
662
+ * An alias for the price.
663
+ */
664
+ external_price_id?: string | null;
665
+
666
+ /**
667
+ * If the Price represents a fixed cost, this represents the quantity of units
668
+ * applied.
669
+ */
670
+ fixed_price_quantity?: number | null;
671
+
672
+ /**
673
+ * The property used to group this price on an invoice
674
+ */
675
+ invoice_grouping_key?: string | null;
676
+ }
677
+
678
+ export namespace NewPlanTieredBpsPrice {
679
+ export interface TieredBpsConfig {
680
+ /**
681
+ * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
682
+ * tiers
683
+ */
684
+ tiers: Array<TieredBpsConfig.Tier>;
685
+ }
686
+
687
+ export namespace TieredBpsConfig {
688
+ export interface Tier {
689
+ /**
690
+ * Per-event basis point rate
691
+ */
692
+ bps: number;
693
+
694
+ /**
695
+ * Inclusive tier starting value
696
+ */
697
+ minimum_amount: string;
698
+
699
+ /**
700
+ * Exclusive tier ending value
701
+ */
702
+ maximum_amount?: string | null;
703
+
704
+ /**
705
+ * Per unit maximum to charge
706
+ */
707
+ per_unit_maximum?: string | null;
708
+ }
709
+ }
710
+ }
711
+
712
+ export interface NewPlanBpsPrice {
713
+ bps_config: NewPlanBpsPrice.BpsConfig;
714
+
715
+ /**
716
+ * The cadence to bill for this price on.
717
+ */
718
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
719
+
720
+ /**
721
+ * The id of the item the plan will be associated with.
722
+ */
723
+ item_id: string;
724
+
725
+ model_type: 'bps';
726
+
727
+ /**
728
+ * The name of the price.
729
+ */
730
+ name: string;
731
+
732
+ /**
733
+ * The id of the billable metric for the price. Only needed if the price is
734
+ * usage-based.
735
+ */
736
+ billable_metric_id?: string | null;
737
+
738
+ /**
739
+ * If the Price represents a fixed cost, the price will be billed in-advance if
740
+ * this is true, and in-arrears if this is false.
741
+ */
742
+ billed_in_advance?: boolean | null;
743
+
744
+ /**
745
+ * An alias for the price.
746
+ */
747
+ external_price_id?: string | null;
748
+
749
+ /**
750
+ * If the Price represents a fixed cost, this represents the quantity of units
751
+ * applied.
752
+ */
753
+ fixed_price_quantity?: number | null;
754
+
755
+ /**
756
+ * The property used to group this price on an invoice
757
+ */
758
+ invoice_grouping_key?: string | null;
759
+ }
760
+
761
+ export namespace NewPlanBpsPrice {
762
+ export interface BpsConfig {
763
+ /**
764
+ * Basis point take rate per event
765
+ */
766
+ bps: number;
767
+
768
+ /**
769
+ * Optional currency amount maximum to cap spend per event
770
+ */
771
+ per_unit_maximum?: string | null;
772
+ }
773
+ }
774
+
775
+ export interface NewPlanBulkBpsPrice {
776
+ bulk_bps_config: NewPlanBulkBpsPrice.BulkBpsConfig;
777
+
778
+ /**
779
+ * The cadence to bill for this price on.
780
+ */
781
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
782
+
783
+ /**
784
+ * The id of the item the plan will be associated with.
785
+ */
786
+ item_id: string;
787
+
788
+ model_type: 'bulk_bps';
789
+
790
+ /**
791
+ * The name of the price.
792
+ */
793
+ name: string;
794
+
795
+ /**
796
+ * The id of the billable metric for the price. Only needed if the price is
797
+ * usage-based.
798
+ */
799
+ billable_metric_id?: string | null;
800
+
801
+ /**
802
+ * If the Price represents a fixed cost, the price will be billed in-advance if
803
+ * this is true, and in-arrears if this is false.
804
+ */
805
+ billed_in_advance?: boolean | null;
806
+
807
+ /**
808
+ * An alias for the price.
809
+ */
810
+ external_price_id?: string | null;
811
+
812
+ /**
813
+ * If the Price represents a fixed cost, this represents the quantity of units
814
+ * applied.
815
+ */
816
+ fixed_price_quantity?: number | null;
817
+
818
+ /**
819
+ * The property used to group this price on an invoice
820
+ */
821
+ invoice_grouping_key?: string | null;
822
+ }
823
+
824
+ export namespace NewPlanBulkBpsPrice {
825
+ export interface BulkBpsConfig {
826
+ /**
827
+ * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
828
+ * tier based on total volume
829
+ */
830
+ tiers: Array<BulkBpsConfig.Tier>;
831
+ }
832
+
833
+ export namespace BulkBpsConfig {
834
+ export interface Tier {
835
+ /**
836
+ * Basis points to rate on
837
+ */
838
+ bps: number;
839
+
840
+ /**
841
+ * Upper bound for tier
842
+ */
843
+ maximum_amount?: string | null;
844
+
845
+ /**
846
+ * The maximum amount to charge for any one event
847
+ */
848
+ per_unit_maximum?: string | null;
849
+ }
850
+ }
851
+ }
852
+
853
+ export interface NewPlanBulkPrice {
854
+ bulk_config: NewPlanBulkPrice.BulkConfig;
855
+
856
+ /**
857
+ * The cadence to bill for this price on.
858
+ */
859
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
860
+
861
+ /**
862
+ * The id of the item the plan will be associated with.
863
+ */
864
+ item_id: string;
865
+
866
+ model_type: 'bulk';
867
+
868
+ /**
869
+ * The name of the price.
870
+ */
871
+ name: string;
872
+
873
+ /**
874
+ * The id of the billable metric for the price. Only needed if the price is
875
+ * usage-based.
876
+ */
877
+ billable_metric_id?: string | null;
878
+
879
+ /**
880
+ * If the Price represents a fixed cost, the price will be billed in-advance if
881
+ * this is true, and in-arrears if this is false.
882
+ */
883
+ billed_in_advance?: boolean | null;
884
+
885
+ /**
886
+ * An alias for the price.
887
+ */
888
+ external_price_id?: string | null;
889
+
890
+ /**
891
+ * If the Price represents a fixed cost, this represents the quantity of units
892
+ * applied.
893
+ */
894
+ fixed_price_quantity?: number | null;
895
+
896
+ /**
897
+ * The property used to group this price on an invoice
898
+ */
899
+ invoice_grouping_key?: string | null;
900
+ }
901
+
902
+ export namespace NewPlanBulkPrice {
903
+ export interface BulkConfig {
904
+ /**
905
+ * Bulk tiers for rating based on total usage volume
906
+ */
907
+ tiers: Array<BulkConfig.Tier>;
908
+ }
909
+
910
+ export namespace BulkConfig {
911
+ export interface Tier {
912
+ /**
913
+ * Amount per unit
914
+ */
915
+ unit_amount: string;
916
+
917
+ /**
918
+ * Upper bound for this tier
919
+ */
920
+ maximum_units?: number | null;
921
+ }
922
+ }
923
+ }
924
+
925
+ export interface NewPlanThresholdTotalAmountPrice {
926
+ /**
927
+ * The cadence to bill for this price on.
928
+ */
929
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
930
+
931
+ /**
932
+ * The id of the item the plan will be associated with.
933
+ */
934
+ item_id: string;
935
+
936
+ model_type: 'threshold_total_amount';
937
+
938
+ /**
939
+ * The name of the price.
940
+ */
941
+ name: string;
942
+
943
+ threshold_total_amount_config: Record<string, unknown>;
944
+
945
+ /**
946
+ * The id of the billable metric for the price. Only needed if the price is
947
+ * usage-based.
948
+ */
949
+ billable_metric_id?: string | null;
950
+
951
+ /**
952
+ * If the Price represents a fixed cost, the price will be billed in-advance if
953
+ * this is true, and in-arrears if this is false.
954
+ */
955
+ billed_in_advance?: boolean | null;
956
+
957
+ /**
958
+ * An alias for the price.
959
+ */
960
+ external_price_id?: string | null;
961
+
962
+ /**
963
+ * If the Price represents a fixed cost, this represents the quantity of units
964
+ * applied.
965
+ */
966
+ fixed_price_quantity?: number | null;
967
+
968
+ /**
969
+ * The property used to group this price on an invoice
970
+ */
971
+ invoice_grouping_key?: string | null;
972
+ }
973
+
974
+ export interface NewPlanTieredPackagePrice {
975
+ /**
976
+ * The cadence to bill for this price on.
977
+ */
978
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
979
+
980
+ /**
981
+ * The id of the item the plan will be associated with.
982
+ */
983
+ item_id: string;
984
+
985
+ model_type: 'tiered_package';
986
+
987
+ /**
988
+ * The name of the price.
989
+ */
990
+ name: string;
991
+
992
+ tiered_package_config: Record<string, unknown>;
993
+
994
+ /**
995
+ * The id of the billable metric for the price. Only needed if the price is
996
+ * usage-based.
997
+ */
998
+ billable_metric_id?: string | null;
999
+
1000
+ /**
1001
+ * If the Price represents a fixed cost, the price will be billed in-advance if
1002
+ * this is true, and in-arrears if this is false.
1003
+ */
1004
+ billed_in_advance?: boolean | null;
1005
+
1006
+ /**
1007
+ * An alias for the price.
1008
+ */
1009
+ external_price_id?: string | null;
1010
+
1011
+ /**
1012
+ * If the Price represents a fixed cost, this represents the quantity of units
1013
+ * applied.
1014
+ */
1015
+ fixed_price_quantity?: number | null;
1016
+
1017
+ /**
1018
+ * The property used to group this price on an invoice
1019
+ */
1020
+ invoice_grouping_key?: string | null;
1021
+ }
1022
+
1023
+ export interface NewPlanTieredWithMinimumPrice {
1024
+ /**
1025
+ * The cadence to bill for this price on.
1026
+ */
1027
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
1028
+
1029
+ /**
1030
+ * The id of the item the plan will be associated with.
1031
+ */
1032
+ item_id: string;
1033
+
1034
+ model_type: 'tiered_with_minimum';
1035
+
1036
+ /**
1037
+ * The name of the price.
1038
+ */
1039
+ name: string;
1040
+
1041
+ tiered_with_minimum_config: Record<string, unknown>;
1042
+
1043
+ /**
1044
+ * The id of the billable metric for the price. Only needed if the price is
1045
+ * usage-based.
1046
+ */
1047
+ billable_metric_id?: string | null;
1048
+
1049
+ /**
1050
+ * If the Price represents a fixed cost, the price will be billed in-advance if
1051
+ * this is true, and in-arrears if this is false.
1052
+ */
1053
+ billed_in_advance?: boolean | null;
1054
+
1055
+ /**
1056
+ * An alias for the price.
1057
+ */
1058
+ external_price_id?: string | null;
1059
+
1060
+ /**
1061
+ * If the Price represents a fixed cost, this represents the quantity of units
1062
+ * applied.
1063
+ */
1064
+ fixed_price_quantity?: number | null;
1065
+
1066
+ /**
1067
+ * The property used to group this price on an invoice
1068
+ */
1069
+ invoice_grouping_key?: string | null;
1070
+ }
1071
+
1072
+ export interface NewPlanPackageWithAllocationPrice {
1073
+ /**
1074
+ * The cadence to bill for this price on.
1075
+ */
1076
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
1077
+
1078
+ /**
1079
+ * The id of the item the plan will be associated with.
1080
+ */
1081
+ item_id: string;
1082
+
1083
+ model_type: 'package_with_allocation';
1084
+
1085
+ /**
1086
+ * The name of the price.
1087
+ */
1088
+ name: string;
1089
+
1090
+ package_with_allocation_config: Record<string, unknown>;
1091
+
1092
+ /**
1093
+ * The id of the billable metric for the price. Only needed if the price is
1094
+ * usage-based.
1095
+ */
1096
+ billable_metric_id?: string | null;
1097
+
1098
+ /**
1099
+ * If the Price represents a fixed cost, the price will be billed in-advance if
1100
+ * this is true, and in-arrears if this is false.
1101
+ */
1102
+ billed_in_advance?: boolean | null;
1103
+
1104
+ /**
1105
+ * An alias for the price.
1106
+ */
1107
+ external_price_id?: string | null;
1108
+
1109
+ /**
1110
+ * If the Price represents a fixed cost, this represents the quantity of units
1111
+ * applied.
1112
+ */
1113
+ fixed_price_quantity?: number | null;
1114
+
1115
+ /**
1116
+ * The property used to group this price on an invoice
1117
+ */
1118
+ invoice_grouping_key?: string | null;
1119
+ }
1120
+ }
1121
+
316
1122
  export interface PlanUpdateParams {
317
1123
  /**
318
1124
  * An optional user-defined ID for this plan resource, used throughout the system