orb-billing 1.23.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 (89) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/index.d.mts +2 -2
  3. package/index.d.ts +2 -2
  4. package/index.d.ts.map +1 -1
  5. package/index.js +4 -0
  6. package/index.js.map +1 -1
  7. package/index.mjs +4 -0
  8. package/index.mjs.map +1 -1
  9. package/package.json +3 -1
  10. package/resources/coupons/coupons.d.ts +60 -2
  11. package/resources/coupons/coupons.d.ts.map +1 -1
  12. package/resources/coupons/coupons.js.map +1 -1
  13. package/resources/coupons/coupons.mjs.map +1 -1
  14. package/resources/credit-notes.d.ts +57 -5
  15. package/resources/credit-notes.d.ts.map +1 -1
  16. package/resources/credit-notes.js.map +1 -1
  17. package/resources/credit-notes.mjs.map +1 -1
  18. package/resources/customers/balance-transactions.d.ts +2 -2
  19. package/resources/customers/balance-transactions.d.ts.map +1 -1
  20. package/resources/customers/balance-transactions.js.map +1 -1
  21. package/resources/customers/balance-transactions.mjs.map +1 -1
  22. package/resources/customers/customers.d.ts +696 -8
  23. package/resources/customers/customers.d.ts.map +1 -1
  24. package/resources/customers/customers.js.map +1 -1
  25. package/resources/customers/customers.mjs.map +1 -1
  26. package/resources/customers/usage.d.ts +74 -58
  27. package/resources/customers/usage.d.ts.map +1 -1
  28. package/resources/customers/usage.js +14 -14
  29. package/resources/customers/usage.js.map +1 -1
  30. package/resources/customers/usage.mjs +14 -14
  31. package/resources/customers/usage.mjs.map +1 -1
  32. package/resources/events/events.d.ts +40 -40
  33. package/resources/events/events.js +40 -40
  34. package/resources/events/events.mjs +40 -40
  35. package/resources/index.d.ts +4 -3
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js +19 -4
  38. package/resources/index.js.map +1 -1
  39. package/resources/index.mjs +2 -1
  40. package/resources/index.mjs.map +1 -1
  41. package/resources/invoice-line-items.d.ts +2 -2
  42. package/resources/invoice-line-items.d.ts.map +1 -1
  43. package/resources/invoices.d.ts +358 -71
  44. package/resources/invoices.d.ts.map +1 -1
  45. package/resources/invoices.js.map +1 -1
  46. package/resources/invoices.mjs.map +1 -1
  47. package/resources/plans/plans.d.ts +648 -4
  48. package/resources/plans/plans.d.ts.map +1 -1
  49. package/resources/plans/plans.js.map +1 -1
  50. package/resources/plans/plans.mjs.map +1 -1
  51. package/resources/prices/index.d.ts +1 -1
  52. package/resources/prices/index.d.ts.map +1 -1
  53. package/resources/prices/index.js +3 -3
  54. package/resources/prices/index.js.map +1 -1
  55. package/resources/prices/index.mjs +1 -1
  56. package/resources/prices/index.mjs.map +1 -1
  57. package/resources/prices/prices.d.ts +56 -83
  58. package/resources/prices/prices.d.ts.map +1 -1
  59. package/resources/prices/prices.js.map +1 -1
  60. package/resources/prices/prices.mjs.map +1 -1
  61. package/resources/shared.d.ts +62 -0
  62. package/resources/shared.d.ts.map +1 -0
  63. package/resources/shared.js +4 -0
  64. package/resources/shared.js.map +1 -0
  65. package/resources/shared.mjs +3 -0
  66. package/resources/shared.mjs.map +1 -0
  67. package/resources/subscriptions.d.ts +1084 -241
  68. package/resources/subscriptions.d.ts.map +1 -1
  69. package/resources/subscriptions.js.map +1 -1
  70. package/resources/subscriptions.mjs.map +1 -1
  71. package/src/index.ts +7 -2
  72. package/src/resources/coupons/coupons.ts +76 -2
  73. package/src/resources/credit-notes.ts +81 -5
  74. package/src/resources/customers/balance-transactions.ts +18 -2
  75. package/src/resources/customers/customers.ts +1144 -12
  76. package/src/resources/customers/usage.ts +80 -62
  77. package/src/resources/events/events.ts +40 -40
  78. package/src/resources/index.ts +3 -3
  79. package/src/resources/invoice-line-items.ts +2 -2
  80. package/src/resources/invoices.ts +598 -91
  81. package/src/resources/plans/plans.ts +810 -4
  82. package/src/resources/prices/index.ts +1 -1
  83. package/src/resources/prices/prices.ts +67 -100
  84. package/src/resources/shared.ts +84 -0
  85. package/src/resources/subscriptions.ts +1291 -279
  86. package/src/version.ts +1 -1
  87. package/version.d.ts +1 -1
  88. package/version.js +1 -1
  89. package/version.mjs +1 -1
@@ -1,7 +1,7 @@
1
1
  import * as Core from 'orb-billing/core';
2
2
  import { APIResource } from 'orb-billing/resource';
3
3
  import * as PlansAPI from 'orb-billing/resources/plans/plans';
4
- import * as InvoicesAPI from 'orb-billing/resources/invoices';
4
+ import * as Shared from 'orb-billing/resources/shared';
5
5
  import * as ExternalPlanIDAPI from 'orb-billing/resources/plans/external-plan-id';
6
6
  import * as PricesAPI from 'orb-billing/resources/prices/prices';
7
7
  import { Page, type PageParams } from 'orb-billing/pagination';
@@ -77,7 +77,7 @@ export interface Plan {
77
77
  */
78
78
  default_invoice_memo: string | null;
79
79
  description: string;
80
- discount: InvoicesAPI.InvoiceDiscount | null;
80
+ discount: Shared.Discount | null;
81
81
  /**
82
82
  * An optional user-defined ID for this plan resource, used throughout the system
83
83
  * as an alias for this Plan. Use this field to identify a plan by an existing
@@ -149,7 +149,7 @@ export declare namespace Plan {
149
149
  interface PlanPhase {
150
150
  id: string;
151
151
  description: string | null;
152
- discount: InvoicesAPI.InvoiceDiscount | null;
152
+ discount: Shared.Discount | null;
153
153
  /**
154
154
  * How many terms of length `duration_unit` this phase is active for. If null, this
155
155
  * phase is evergreen and active indefinitely
@@ -211,7 +211,7 @@ export interface PlanCreateParams {
211
211
  * Prices for this plan. If the plan has phases, this includes prices across all
212
212
  * phases of the plan.
213
213
  */
214
- prices: Array<unknown>;
214
+ prices: Array<PlanCreateParams.NewPlanUnitPrice | PlanCreateParams.NewPlanPackagePrice | PlanCreateParams.NewPlanMatrixPrice | PlanCreateParams.NewPlanTieredPrice | PlanCreateParams.NewPlanTieredBpsPrice | PlanCreateParams.NewPlanBpsPrice | PlanCreateParams.NewPlanBulkBpsPrice | PlanCreateParams.NewPlanBulkPrice | PlanCreateParams.NewPlanThresholdTotalAmountPrice | PlanCreateParams.NewPlanTieredPackagePrice | PlanCreateParams.NewPlanTieredWithMinimumPrice | PlanCreateParams.NewPlanPackageWithAllocationPrice>;
215
215
  /**
216
216
  * Free-form text which is available on the invoice PDF and the Orb invoice portal.
217
217
  */
@@ -225,6 +225,650 @@ export interface PlanCreateParams {
225
225
  */
226
226
  net_terms?: number | null;
227
227
  }
228
+ export declare namespace PlanCreateParams {
229
+ interface NewPlanUnitPrice {
230
+ /**
231
+ * The cadence to bill for this price on.
232
+ */
233
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
234
+ /**
235
+ * The id of the item the plan will be associated with.
236
+ */
237
+ item_id: string;
238
+ model_type: 'unit';
239
+ /**
240
+ * The name of the price.
241
+ */
242
+ name: string;
243
+ unit_config: NewPlanUnitPrice.UnitConfig;
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
+ * If the Price represents a fixed cost, the price will be billed in-advance if
251
+ * this is true, and in-arrears if this is false.
252
+ */
253
+ billed_in_advance?: boolean | null;
254
+ /**
255
+ * An alias for the price.
256
+ */
257
+ external_price_id?: string | null;
258
+ /**
259
+ * If the Price represents a fixed cost, this represents the quantity of units
260
+ * applied.
261
+ */
262
+ fixed_price_quantity?: number | null;
263
+ /**
264
+ * The property used to group this price on an invoice
265
+ */
266
+ invoice_grouping_key?: string | null;
267
+ }
268
+ namespace NewPlanUnitPrice {
269
+ interface UnitConfig {
270
+ /**
271
+ * Rate per unit of usage
272
+ */
273
+ unit_amount: string;
274
+ /**
275
+ * Multiplier to scale rated quantity by
276
+ */
277
+ scaling_factor?: number | null;
278
+ }
279
+ }
280
+ interface NewPlanPackagePrice {
281
+ /**
282
+ * The cadence to bill for this price on.
283
+ */
284
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
285
+ /**
286
+ * The id of the item the plan will be associated with.
287
+ */
288
+ item_id: string;
289
+ model_type: 'package';
290
+ /**
291
+ * The name of the price.
292
+ */
293
+ name: string;
294
+ package_config: NewPlanPackagePrice.PackageConfig;
295
+ /**
296
+ * The id of the billable metric for the price. Only needed if the price is
297
+ * usage-based.
298
+ */
299
+ billable_metric_id?: string | null;
300
+ /**
301
+ * If the Price represents a fixed cost, the price will be billed in-advance if
302
+ * this is true, and in-arrears if this is false.
303
+ */
304
+ billed_in_advance?: boolean | null;
305
+ /**
306
+ * An alias for the price.
307
+ */
308
+ external_price_id?: string | null;
309
+ /**
310
+ * If the Price represents a fixed cost, this represents the quantity of units
311
+ * applied.
312
+ */
313
+ fixed_price_quantity?: number | null;
314
+ /**
315
+ * The property used to group this price on an invoice
316
+ */
317
+ invoice_grouping_key?: string | null;
318
+ }
319
+ namespace NewPlanPackagePrice {
320
+ interface PackageConfig {
321
+ /**
322
+ * A currency amount to rate usage by
323
+ */
324
+ package_amount: string;
325
+ /**
326
+ * An integer amount to represent package size. For example, 1000 here would divide
327
+ * usage by 1000 before multiplying by package_amount in rating
328
+ */
329
+ package_size?: number | null;
330
+ }
331
+ }
332
+ interface NewPlanMatrixPrice {
333
+ /**
334
+ * The cadence to bill for this price on.
335
+ */
336
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
337
+ /**
338
+ * The id of the item the plan will be associated with.
339
+ */
340
+ item_id: string;
341
+ matrix_config: NewPlanMatrixPrice.MatrixConfig;
342
+ model_type: 'matrix';
343
+ /**
344
+ * The name of the price.
345
+ */
346
+ name: string;
347
+ /**
348
+ * The id of the billable metric for the price. Only needed if the price is
349
+ * usage-based.
350
+ */
351
+ billable_metric_id?: string | null;
352
+ /**
353
+ * If the Price represents a fixed cost, the price will be billed in-advance if
354
+ * this is true, and in-arrears if this is false.
355
+ */
356
+ billed_in_advance?: boolean | null;
357
+ /**
358
+ * An alias for the price.
359
+ */
360
+ external_price_id?: string | null;
361
+ /**
362
+ * If the Price represents a fixed cost, this represents the quantity of units
363
+ * applied.
364
+ */
365
+ fixed_price_quantity?: number | null;
366
+ /**
367
+ * The property used to group this price on an invoice
368
+ */
369
+ invoice_grouping_key?: string | null;
370
+ }
371
+ namespace NewPlanMatrixPrice {
372
+ interface MatrixConfig {
373
+ /**
374
+ * Default per unit rate for any usage not bucketed into a specified matrix_value
375
+ */
376
+ default_unit_amount: string;
377
+ /**
378
+ * One or two event property values to evaluate matrix groups by
379
+ */
380
+ dimensions: Array<string | null>;
381
+ /**
382
+ * Matrix values for specified matrix grouping keys
383
+ */
384
+ matrix_values: Array<MatrixConfig.MatrixValue>;
385
+ /**
386
+ * Default optional multiplier to scale rated quantities that fall into the default
387
+ * bucket by
388
+ */
389
+ scaling_factor?: number | null;
390
+ }
391
+ namespace MatrixConfig {
392
+ interface MatrixValue {
393
+ /**
394
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
395
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
396
+ * instance tier.
397
+ */
398
+ dimension_values: Array<string | null>;
399
+ /**
400
+ * Unit price for the specified dimension_values
401
+ */
402
+ unit_amount: string;
403
+ /**
404
+ * Optional multiplier to scale rated quantities by
405
+ */
406
+ scaling_factor?: number | null;
407
+ }
408
+ }
409
+ }
410
+ interface NewPlanTieredPrice {
411
+ /**
412
+ * The cadence to bill for this price on.
413
+ */
414
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
415
+ /**
416
+ * The id of the item the plan will be associated with.
417
+ */
418
+ item_id: string;
419
+ model_type: 'tiered';
420
+ /**
421
+ * The name of the price.
422
+ */
423
+ name: string;
424
+ tiered_config: NewPlanTieredPrice.TieredConfig;
425
+ /**
426
+ * The id of the billable metric for the price. Only needed if the price is
427
+ * usage-based.
428
+ */
429
+ billable_metric_id?: string | null;
430
+ /**
431
+ * If the Price represents a fixed cost, the price will be billed in-advance if
432
+ * this is true, and in-arrears if this is false.
433
+ */
434
+ billed_in_advance?: boolean | null;
435
+ /**
436
+ * An alias for the price.
437
+ */
438
+ external_price_id?: string | null;
439
+ /**
440
+ * If the Price represents a fixed cost, this represents the quantity of units
441
+ * applied.
442
+ */
443
+ fixed_price_quantity?: number | null;
444
+ /**
445
+ * The property used to group this price on an invoice
446
+ */
447
+ invoice_grouping_key?: string | null;
448
+ }
449
+ namespace NewPlanTieredPrice {
450
+ interface TieredConfig {
451
+ /**
452
+ * Tiers for rating based on total usage quantities into the specified tier
453
+ */
454
+ tiers: Array<TieredConfig.Tier>;
455
+ }
456
+ namespace TieredConfig {
457
+ interface Tier {
458
+ /**
459
+ * Inclusive tier starting value
460
+ */
461
+ first_unit: number;
462
+ /**
463
+ * Amount per unit
464
+ */
465
+ unit_amount: string;
466
+ /**
467
+ * Exclusive tier ending value. If null, this is treated as the last tier
468
+ */
469
+ last_unit?: number | null;
470
+ }
471
+ }
472
+ }
473
+ interface NewPlanTieredBpsPrice {
474
+ /**
475
+ * The cadence to bill for this price on.
476
+ */
477
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
478
+ /**
479
+ * The id of the item the plan will be associated with.
480
+ */
481
+ item_id: string;
482
+ model_type: 'tiered_bps';
483
+ /**
484
+ * The name of the price.
485
+ */
486
+ name: string;
487
+ tiered_bps_config: NewPlanTieredBpsPrice.TieredBpsConfig;
488
+ /**
489
+ * The id of the billable metric for the price. Only needed if the price is
490
+ * usage-based.
491
+ */
492
+ billable_metric_id?: string | null;
493
+ /**
494
+ * If the Price represents a fixed cost, the price will be billed in-advance if
495
+ * this is true, and in-arrears if this is false.
496
+ */
497
+ billed_in_advance?: boolean | null;
498
+ /**
499
+ * An alias for the price.
500
+ */
501
+ external_price_id?: string | null;
502
+ /**
503
+ * If the Price represents a fixed cost, this represents the quantity of units
504
+ * applied.
505
+ */
506
+ fixed_price_quantity?: number | null;
507
+ /**
508
+ * The property used to group this price on an invoice
509
+ */
510
+ invoice_grouping_key?: string | null;
511
+ }
512
+ namespace NewPlanTieredBpsPrice {
513
+ interface TieredBpsConfig {
514
+ /**
515
+ * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
516
+ * tiers
517
+ */
518
+ tiers: Array<TieredBpsConfig.Tier>;
519
+ }
520
+ namespace TieredBpsConfig {
521
+ interface Tier {
522
+ /**
523
+ * Per-event basis point rate
524
+ */
525
+ bps: number;
526
+ /**
527
+ * Inclusive tier starting value
528
+ */
529
+ minimum_amount: string;
530
+ /**
531
+ * Exclusive tier ending value
532
+ */
533
+ maximum_amount?: string | null;
534
+ /**
535
+ * Per unit maximum to charge
536
+ */
537
+ per_unit_maximum?: string | null;
538
+ }
539
+ }
540
+ }
541
+ interface NewPlanBpsPrice {
542
+ bps_config: NewPlanBpsPrice.BpsConfig;
543
+ /**
544
+ * The cadence to bill for this price on.
545
+ */
546
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
547
+ /**
548
+ * The id of the item the plan will be associated with.
549
+ */
550
+ item_id: string;
551
+ model_type: 'bps';
552
+ /**
553
+ * The name of the price.
554
+ */
555
+ name: string;
556
+ /**
557
+ * The id of the billable metric for the price. Only needed if the price is
558
+ * usage-based.
559
+ */
560
+ billable_metric_id?: string | null;
561
+ /**
562
+ * If the Price represents a fixed cost, the price will be billed in-advance if
563
+ * this is true, and in-arrears if this is false.
564
+ */
565
+ billed_in_advance?: boolean | null;
566
+ /**
567
+ * An alias for the price.
568
+ */
569
+ external_price_id?: string | null;
570
+ /**
571
+ * If the Price represents a fixed cost, this represents the quantity of units
572
+ * applied.
573
+ */
574
+ fixed_price_quantity?: number | null;
575
+ /**
576
+ * The property used to group this price on an invoice
577
+ */
578
+ invoice_grouping_key?: string | null;
579
+ }
580
+ namespace NewPlanBpsPrice {
581
+ interface BpsConfig {
582
+ /**
583
+ * Basis point take rate per event
584
+ */
585
+ bps: number;
586
+ /**
587
+ * Optional currency amount maximum to cap spend per event
588
+ */
589
+ per_unit_maximum?: string | null;
590
+ }
591
+ }
592
+ interface NewPlanBulkBpsPrice {
593
+ bulk_bps_config: NewPlanBulkBpsPrice.BulkBpsConfig;
594
+ /**
595
+ * The cadence to bill for this price on.
596
+ */
597
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
598
+ /**
599
+ * The id of the item the plan will be associated with.
600
+ */
601
+ item_id: string;
602
+ model_type: 'bulk_bps';
603
+ /**
604
+ * The name of the price.
605
+ */
606
+ name: string;
607
+ /**
608
+ * The id of the billable metric for the price. Only needed if the price is
609
+ * usage-based.
610
+ */
611
+ billable_metric_id?: string | null;
612
+ /**
613
+ * If the Price represents a fixed cost, the price will be billed in-advance if
614
+ * this is true, and in-arrears if this is false.
615
+ */
616
+ billed_in_advance?: boolean | null;
617
+ /**
618
+ * An alias for the price.
619
+ */
620
+ external_price_id?: string | null;
621
+ /**
622
+ * If the Price represents a fixed cost, this represents the quantity of units
623
+ * applied.
624
+ */
625
+ fixed_price_quantity?: number | null;
626
+ /**
627
+ * The property used to group this price on an invoice
628
+ */
629
+ invoice_grouping_key?: string | null;
630
+ }
631
+ namespace NewPlanBulkBpsPrice {
632
+ interface BulkBpsConfig {
633
+ /**
634
+ * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
635
+ * tier based on total volume
636
+ */
637
+ tiers: Array<BulkBpsConfig.Tier>;
638
+ }
639
+ namespace BulkBpsConfig {
640
+ interface Tier {
641
+ /**
642
+ * Basis points to rate on
643
+ */
644
+ bps: number;
645
+ /**
646
+ * Upper bound for tier
647
+ */
648
+ maximum_amount?: string | null;
649
+ /**
650
+ * The maximum amount to charge for any one event
651
+ */
652
+ per_unit_maximum?: string | null;
653
+ }
654
+ }
655
+ }
656
+ interface NewPlanBulkPrice {
657
+ bulk_config: NewPlanBulkPrice.BulkConfig;
658
+ /**
659
+ * The cadence to bill for this price on.
660
+ */
661
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
662
+ /**
663
+ * The id of the item the plan will be associated with.
664
+ */
665
+ item_id: string;
666
+ model_type: 'bulk';
667
+ /**
668
+ * The name of the price.
669
+ */
670
+ name: string;
671
+ /**
672
+ * The id of the billable metric for the price. Only needed if the price is
673
+ * usage-based.
674
+ */
675
+ billable_metric_id?: string | null;
676
+ /**
677
+ * If the Price represents a fixed cost, the price will be billed in-advance if
678
+ * this is true, and in-arrears if this is false.
679
+ */
680
+ billed_in_advance?: boolean | null;
681
+ /**
682
+ * An alias for the price.
683
+ */
684
+ external_price_id?: string | null;
685
+ /**
686
+ * If the Price represents a fixed cost, this represents the quantity of units
687
+ * applied.
688
+ */
689
+ fixed_price_quantity?: number | null;
690
+ /**
691
+ * The property used to group this price on an invoice
692
+ */
693
+ invoice_grouping_key?: string | null;
694
+ }
695
+ namespace NewPlanBulkPrice {
696
+ interface BulkConfig {
697
+ /**
698
+ * Bulk tiers for rating based on total usage volume
699
+ */
700
+ tiers: Array<BulkConfig.Tier>;
701
+ }
702
+ namespace BulkConfig {
703
+ interface Tier {
704
+ /**
705
+ * Amount per unit
706
+ */
707
+ unit_amount: string;
708
+ /**
709
+ * Upper bound for this tier
710
+ */
711
+ maximum_units?: number | null;
712
+ }
713
+ }
714
+ }
715
+ interface NewPlanThresholdTotalAmountPrice {
716
+ /**
717
+ * The cadence to bill for this price on.
718
+ */
719
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
720
+ /**
721
+ * The id of the item the plan will be associated with.
722
+ */
723
+ item_id: string;
724
+ model_type: 'threshold_total_amount';
725
+ /**
726
+ * The name of the price.
727
+ */
728
+ name: string;
729
+ threshold_total_amount_config: Record<string, unknown>;
730
+ /**
731
+ * The id of the billable metric for the price. Only needed if the price is
732
+ * usage-based.
733
+ */
734
+ billable_metric_id?: string | null;
735
+ /**
736
+ * If the Price represents a fixed cost, the price will be billed in-advance if
737
+ * this is true, and in-arrears if this is false.
738
+ */
739
+ billed_in_advance?: boolean | null;
740
+ /**
741
+ * An alias for the price.
742
+ */
743
+ external_price_id?: string | null;
744
+ /**
745
+ * If the Price represents a fixed cost, this represents the quantity of units
746
+ * applied.
747
+ */
748
+ fixed_price_quantity?: number | null;
749
+ /**
750
+ * The property used to group this price on an invoice
751
+ */
752
+ invoice_grouping_key?: string | null;
753
+ }
754
+ interface NewPlanTieredPackagePrice {
755
+ /**
756
+ * The cadence to bill for this price on.
757
+ */
758
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
759
+ /**
760
+ * The id of the item the plan will be associated with.
761
+ */
762
+ item_id: string;
763
+ model_type: 'tiered_package';
764
+ /**
765
+ * The name of the price.
766
+ */
767
+ name: string;
768
+ tiered_package_config: Record<string, unknown>;
769
+ /**
770
+ * The id of the billable metric for the price. Only needed if the price is
771
+ * usage-based.
772
+ */
773
+ billable_metric_id?: string | null;
774
+ /**
775
+ * If the Price represents a fixed cost, the price will be billed in-advance if
776
+ * this is true, and in-arrears if this is false.
777
+ */
778
+ billed_in_advance?: boolean | null;
779
+ /**
780
+ * An alias for the price.
781
+ */
782
+ external_price_id?: string | null;
783
+ /**
784
+ * If the Price represents a fixed cost, this represents the quantity of units
785
+ * applied.
786
+ */
787
+ fixed_price_quantity?: number | null;
788
+ /**
789
+ * The property used to group this price on an invoice
790
+ */
791
+ invoice_grouping_key?: string | null;
792
+ }
793
+ interface NewPlanTieredWithMinimumPrice {
794
+ /**
795
+ * The cadence to bill for this price on.
796
+ */
797
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
798
+ /**
799
+ * The id of the item the plan will be associated with.
800
+ */
801
+ item_id: string;
802
+ model_type: 'tiered_with_minimum';
803
+ /**
804
+ * The name of the price.
805
+ */
806
+ name: string;
807
+ tiered_with_minimum_config: Record<string, unknown>;
808
+ /**
809
+ * The id of the billable metric for the price. Only needed if the price is
810
+ * usage-based.
811
+ */
812
+ billable_metric_id?: string | null;
813
+ /**
814
+ * If the Price represents a fixed cost, the price will be billed in-advance if
815
+ * this is true, and in-arrears if this is false.
816
+ */
817
+ billed_in_advance?: boolean | null;
818
+ /**
819
+ * An alias for the price.
820
+ */
821
+ external_price_id?: string | null;
822
+ /**
823
+ * If the Price represents a fixed cost, this represents the quantity of units
824
+ * applied.
825
+ */
826
+ fixed_price_quantity?: number | null;
827
+ /**
828
+ * The property used to group this price on an invoice
829
+ */
830
+ invoice_grouping_key?: string | null;
831
+ }
832
+ interface NewPlanPackageWithAllocationPrice {
833
+ /**
834
+ * The cadence to bill for this price on.
835
+ */
836
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
837
+ /**
838
+ * The id of the item the plan will be associated with.
839
+ */
840
+ item_id: string;
841
+ model_type: 'package_with_allocation';
842
+ /**
843
+ * The name of the price.
844
+ */
845
+ name: string;
846
+ package_with_allocation_config: Record<string, unknown>;
847
+ /**
848
+ * The id of the billable metric for the price. Only needed if the price is
849
+ * usage-based.
850
+ */
851
+ billable_metric_id?: string | null;
852
+ /**
853
+ * If the Price represents a fixed cost, the price will be billed in-advance if
854
+ * this is true, and in-arrears if this is false.
855
+ */
856
+ billed_in_advance?: boolean | null;
857
+ /**
858
+ * An alias for the price.
859
+ */
860
+ external_price_id?: string | null;
861
+ /**
862
+ * If the Price represents a fixed cost, this represents the quantity of units
863
+ * applied.
864
+ */
865
+ fixed_price_quantity?: number | null;
866
+ /**
867
+ * The property used to group this price on an invoice
868
+ */
869
+ invoice_grouping_key?: string | null;
870
+ }
871
+ }
228
872
  export interface PlanUpdateParams {
229
873
  /**
230
874
  * An optional user-defined ID for this plan resource, used throughout the system