orb-billing 5.15.0 → 5.17.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 (46) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +1 -1
  3. package/resources/beta/beta.d.ts +396 -2
  4. package/resources/beta/beta.d.ts.map +1 -1
  5. package/resources/beta/beta.js.map +1 -1
  6. package/resources/beta/beta.mjs.map +1 -1
  7. package/resources/beta/external-plan-id.d.ts +396 -2
  8. package/resources/beta/external-plan-id.d.ts.map +1 -1
  9. package/resources/invoice-line-items.d.ts +27 -5
  10. package/resources/invoice-line-items.d.ts.map +1 -1
  11. package/resources/invoice-line-items.js +11 -0
  12. package/resources/invoice-line-items.js.map +1 -1
  13. package/resources/invoice-line-items.mjs +11 -0
  14. package/resources/invoice-line-items.mjs.map +1 -1
  15. package/resources/items.d.ts +37 -0
  16. package/resources/items.d.ts.map +1 -1
  17. package/resources/items.js.map +1 -1
  18. package/resources/items.mjs.map +1 -1
  19. package/resources/plans/plans.d.ts +198 -1
  20. package/resources/plans/plans.d.ts.map +1 -1
  21. package/resources/plans/plans.js.map +1 -1
  22. package/resources/plans/plans.mjs.map +1 -1
  23. package/resources/prices/prices.d.ts +558 -3
  24. package/resources/prices/prices.d.ts.map +1 -1
  25. package/resources/prices/prices.js.map +1 -1
  26. package/resources/prices/prices.mjs.map +1 -1
  27. package/resources/shared.d.ts +280 -1
  28. package/resources/shared.d.ts.map +1 -1
  29. package/resources/shared.js.map +1 -1
  30. package/resources/shared.mjs.map +1 -1
  31. package/resources/subscriptions.d.ts +1104 -131
  32. package/resources/subscriptions.d.ts.map +1 -1
  33. package/resources/subscriptions.js.map +1 -1
  34. package/resources/subscriptions.mjs.map +1 -1
  35. package/src/resources/beta/beta.ts +468 -0
  36. package/src/resources/beta/external-plan-id.ts +468 -0
  37. package/src/resources/invoice-line-items.ts +29 -6
  38. package/src/resources/items.ts +38 -0
  39. package/src/resources/plans/plans.ts +234 -0
  40. package/src/resources/prices/prices.ts +688 -28
  41. package/src/resources/shared.ts +337 -1
  42. package/src/resources/subscriptions.ts +1250 -94
  43. package/src/version.ts +1 -1
  44. package/version.d.ts +1 -1
  45. package/version.js +1 -1
  46. package/version.mjs +1 -1
@@ -208,6 +208,8 @@ export namespace BetaCreatePlanVersionParams {
208
208
  | Shared.NewPlanScalableMatrixWithTieredPricingPrice
209
209
  | Shared.NewPlanCumulativeGroupedBulkPrice
210
210
  | Shared.NewPlanMinimumCompositePrice
211
+ | AddPrice.NewPlanPercentCompositePrice
212
+ | AddPrice.NewPlanEventOutputPrice
211
213
  | null;
212
214
  }
213
215
 
@@ -470,6 +472,238 @@ export namespace BetaCreatePlanVersionParams {
470
472
  per_unit_rate: string;
471
473
  }
472
474
  }
475
+
476
+ export interface NewPlanPercentCompositePrice {
477
+ /**
478
+ * The cadence to bill for this price on.
479
+ */
480
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
481
+
482
+ /**
483
+ * The id of the item the price will be associated with.
484
+ */
485
+ item_id: string;
486
+
487
+ /**
488
+ * The pricing model type
489
+ */
490
+ model_type: 'percent';
491
+
492
+ /**
493
+ * The name of the price.
494
+ */
495
+ name: string;
496
+
497
+ /**
498
+ * Configuration for percent pricing
499
+ */
500
+ percent_config: NewPlanPercentCompositePrice.PercentConfig;
501
+
502
+ /**
503
+ * The id of the billable metric for the price. Only needed if the price is
504
+ * usage-based.
505
+ */
506
+ billable_metric_id?: string | null;
507
+
508
+ /**
509
+ * If the Price represents a fixed cost, the price will be billed in-advance if
510
+ * this is true, and in-arrears if this is false.
511
+ */
512
+ billed_in_advance?: boolean | null;
513
+
514
+ /**
515
+ * For custom cadence: specifies the duration of the billing period in days or
516
+ * months.
517
+ */
518
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
519
+
520
+ /**
521
+ * The per unit conversion rate of the price currency to the invoicing currency.
522
+ */
523
+ conversion_rate?: number | null;
524
+
525
+ /**
526
+ * The configuration for the rate of the price currency to the invoicing currency.
527
+ */
528
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
529
+
530
+ /**
531
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
532
+ * price is billed.
533
+ */
534
+ currency?: string | null;
535
+
536
+ /**
537
+ * For dimensional price: specifies a price group and dimension values
538
+ */
539
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
540
+
541
+ /**
542
+ * An alias for the price.
543
+ */
544
+ external_price_id?: string | null;
545
+
546
+ /**
547
+ * If the Price represents a fixed cost, this represents the quantity of units
548
+ * applied.
549
+ */
550
+ fixed_price_quantity?: number | null;
551
+
552
+ /**
553
+ * The property used to group this price on an invoice
554
+ */
555
+ invoice_grouping_key?: string | null;
556
+
557
+ /**
558
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
559
+ * If unspecified, a single invoice is produced per billing cycle.
560
+ */
561
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
562
+
563
+ /**
564
+ * User-specified key/value pairs for the resource. Individual keys can be removed
565
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
566
+ * by setting `metadata` to `null`.
567
+ */
568
+ metadata?: { [key: string]: string | null } | null;
569
+
570
+ /**
571
+ * A transient ID that can be used to reference this price when adding adjustments
572
+ * in the same API call.
573
+ */
574
+ reference_id?: string | null;
575
+ }
576
+
577
+ export namespace NewPlanPercentCompositePrice {
578
+ /**
579
+ * Configuration for percent pricing
580
+ */
581
+ export interface PercentConfig {
582
+ /**
583
+ * What percent of the component subtotals to charge
584
+ */
585
+ percent: number;
586
+ }
587
+ }
588
+
589
+ export interface NewPlanEventOutputPrice {
590
+ /**
591
+ * The cadence to bill for this price on.
592
+ */
593
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
594
+
595
+ /**
596
+ * Configuration for event_output pricing
597
+ */
598
+ event_output_config: NewPlanEventOutputPrice.EventOutputConfig;
599
+
600
+ /**
601
+ * The id of the item the price will be associated with.
602
+ */
603
+ item_id: string;
604
+
605
+ /**
606
+ * The pricing model type
607
+ */
608
+ model_type: 'event_output';
609
+
610
+ /**
611
+ * The name of the price.
612
+ */
613
+ name: string;
614
+
615
+ /**
616
+ * The id of the billable metric for the price. Only needed if the price is
617
+ * usage-based.
618
+ */
619
+ billable_metric_id?: string | null;
620
+
621
+ /**
622
+ * If the Price represents a fixed cost, the price will be billed in-advance if
623
+ * this is true, and in-arrears if this is false.
624
+ */
625
+ billed_in_advance?: boolean | null;
626
+
627
+ /**
628
+ * For custom cadence: specifies the duration of the billing period in days or
629
+ * months.
630
+ */
631
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
632
+
633
+ /**
634
+ * The per unit conversion rate of the price currency to the invoicing currency.
635
+ */
636
+ conversion_rate?: number | null;
637
+
638
+ /**
639
+ * The configuration for the rate of the price currency to the invoicing currency.
640
+ */
641
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
642
+
643
+ /**
644
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
645
+ * price is billed.
646
+ */
647
+ currency?: string | null;
648
+
649
+ /**
650
+ * For dimensional price: specifies a price group and dimension values
651
+ */
652
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
653
+
654
+ /**
655
+ * An alias for the price.
656
+ */
657
+ external_price_id?: string | null;
658
+
659
+ /**
660
+ * If the Price represents a fixed cost, this represents the quantity of units
661
+ * applied.
662
+ */
663
+ fixed_price_quantity?: number | null;
664
+
665
+ /**
666
+ * The property used to group this price on an invoice
667
+ */
668
+ invoice_grouping_key?: string | null;
669
+
670
+ /**
671
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
672
+ * If unspecified, a single invoice is produced per billing cycle.
673
+ */
674
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
675
+
676
+ /**
677
+ * User-specified key/value pairs for the resource. Individual keys can be removed
678
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
679
+ * by setting `metadata` to `null`.
680
+ */
681
+ metadata?: { [key: string]: string | null } | null;
682
+
683
+ /**
684
+ * A transient ID that can be used to reference this price when adding adjustments
685
+ * in the same API call.
686
+ */
687
+ reference_id?: string | null;
688
+ }
689
+
690
+ export namespace NewPlanEventOutputPrice {
691
+ /**
692
+ * Configuration for event_output pricing
693
+ */
694
+ export interface EventOutputConfig {
695
+ /**
696
+ * The key in the event data to extract the unit rate from.
697
+ */
698
+ unit_rating_key: string;
699
+
700
+ /**
701
+ * An optional key in the event data to group by (e.g., event ID). All events will
702
+ * also be grouped by their unit rate.
703
+ */
704
+ grouping_key?: string | null;
705
+ }
706
+ }
473
707
  }
474
708
 
475
709
  export interface RemoveAdjustment {
@@ -565,6 +799,8 @@ export namespace BetaCreatePlanVersionParams {
565
799
  | Shared.NewPlanScalableMatrixWithTieredPricingPrice
566
800
  | Shared.NewPlanCumulativeGroupedBulkPrice
567
801
  | Shared.NewPlanMinimumCompositePrice
802
+ | ReplacePrice.NewPlanPercentCompositePrice
803
+ | ReplacePrice.NewPlanEventOutputPrice
568
804
  | null;
569
805
  }
570
806
 
@@ -827,6 +1063,238 @@ export namespace BetaCreatePlanVersionParams {
827
1063
  per_unit_rate: string;
828
1064
  }
829
1065
  }
1066
+
1067
+ export interface NewPlanPercentCompositePrice {
1068
+ /**
1069
+ * The cadence to bill for this price on.
1070
+ */
1071
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1072
+
1073
+ /**
1074
+ * The id of the item the price will be associated with.
1075
+ */
1076
+ item_id: string;
1077
+
1078
+ /**
1079
+ * The pricing model type
1080
+ */
1081
+ model_type: 'percent';
1082
+
1083
+ /**
1084
+ * The name of the price.
1085
+ */
1086
+ name: string;
1087
+
1088
+ /**
1089
+ * Configuration for percent pricing
1090
+ */
1091
+ percent_config: NewPlanPercentCompositePrice.PercentConfig;
1092
+
1093
+ /**
1094
+ * The id of the billable metric for the price. Only needed if the price is
1095
+ * usage-based.
1096
+ */
1097
+ billable_metric_id?: string | null;
1098
+
1099
+ /**
1100
+ * If the Price represents a fixed cost, the price will be billed in-advance if
1101
+ * this is true, and in-arrears if this is false.
1102
+ */
1103
+ billed_in_advance?: boolean | null;
1104
+
1105
+ /**
1106
+ * For custom cadence: specifies the duration of the billing period in days or
1107
+ * months.
1108
+ */
1109
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
1110
+
1111
+ /**
1112
+ * The per unit conversion rate of the price currency to the invoicing currency.
1113
+ */
1114
+ conversion_rate?: number | null;
1115
+
1116
+ /**
1117
+ * The configuration for the rate of the price currency to the invoicing currency.
1118
+ */
1119
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
1120
+
1121
+ /**
1122
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
1123
+ * price is billed.
1124
+ */
1125
+ currency?: string | null;
1126
+
1127
+ /**
1128
+ * For dimensional price: specifies a price group and dimension values
1129
+ */
1130
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
1131
+
1132
+ /**
1133
+ * An alias for the price.
1134
+ */
1135
+ external_price_id?: string | null;
1136
+
1137
+ /**
1138
+ * If the Price represents a fixed cost, this represents the quantity of units
1139
+ * applied.
1140
+ */
1141
+ fixed_price_quantity?: number | null;
1142
+
1143
+ /**
1144
+ * The property used to group this price on an invoice
1145
+ */
1146
+ invoice_grouping_key?: string | null;
1147
+
1148
+ /**
1149
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
1150
+ * If unspecified, a single invoice is produced per billing cycle.
1151
+ */
1152
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
1153
+
1154
+ /**
1155
+ * User-specified key/value pairs for the resource. Individual keys can be removed
1156
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
1157
+ * by setting `metadata` to `null`.
1158
+ */
1159
+ metadata?: { [key: string]: string | null } | null;
1160
+
1161
+ /**
1162
+ * A transient ID that can be used to reference this price when adding adjustments
1163
+ * in the same API call.
1164
+ */
1165
+ reference_id?: string | null;
1166
+ }
1167
+
1168
+ export namespace NewPlanPercentCompositePrice {
1169
+ /**
1170
+ * Configuration for percent pricing
1171
+ */
1172
+ export interface PercentConfig {
1173
+ /**
1174
+ * What percent of the component subtotals to charge
1175
+ */
1176
+ percent: number;
1177
+ }
1178
+ }
1179
+
1180
+ export interface NewPlanEventOutputPrice {
1181
+ /**
1182
+ * The cadence to bill for this price on.
1183
+ */
1184
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1185
+
1186
+ /**
1187
+ * Configuration for event_output pricing
1188
+ */
1189
+ event_output_config: NewPlanEventOutputPrice.EventOutputConfig;
1190
+
1191
+ /**
1192
+ * The id of the item the price will be associated with.
1193
+ */
1194
+ item_id: string;
1195
+
1196
+ /**
1197
+ * The pricing model type
1198
+ */
1199
+ model_type: 'event_output';
1200
+
1201
+ /**
1202
+ * The name of the price.
1203
+ */
1204
+ name: string;
1205
+
1206
+ /**
1207
+ * The id of the billable metric for the price. Only needed if the price is
1208
+ * usage-based.
1209
+ */
1210
+ billable_metric_id?: string | null;
1211
+
1212
+ /**
1213
+ * If the Price represents a fixed cost, the price will be billed in-advance if
1214
+ * this is true, and in-arrears if this is false.
1215
+ */
1216
+ billed_in_advance?: boolean | null;
1217
+
1218
+ /**
1219
+ * For custom cadence: specifies the duration of the billing period in days or
1220
+ * months.
1221
+ */
1222
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
1223
+
1224
+ /**
1225
+ * The per unit conversion rate of the price currency to the invoicing currency.
1226
+ */
1227
+ conversion_rate?: number | null;
1228
+
1229
+ /**
1230
+ * The configuration for the rate of the price currency to the invoicing currency.
1231
+ */
1232
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
1233
+
1234
+ /**
1235
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
1236
+ * price is billed.
1237
+ */
1238
+ currency?: string | null;
1239
+
1240
+ /**
1241
+ * For dimensional price: specifies a price group and dimension values
1242
+ */
1243
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
1244
+
1245
+ /**
1246
+ * An alias for the price.
1247
+ */
1248
+ external_price_id?: string | null;
1249
+
1250
+ /**
1251
+ * If the Price represents a fixed cost, this represents the quantity of units
1252
+ * applied.
1253
+ */
1254
+ fixed_price_quantity?: number | null;
1255
+
1256
+ /**
1257
+ * The property used to group this price on an invoice
1258
+ */
1259
+ invoice_grouping_key?: string | null;
1260
+
1261
+ /**
1262
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
1263
+ * If unspecified, a single invoice is produced per billing cycle.
1264
+ */
1265
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
1266
+
1267
+ /**
1268
+ * User-specified key/value pairs for the resource. Individual keys can be removed
1269
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
1270
+ * by setting `metadata` to `null`.
1271
+ */
1272
+ metadata?: { [key: string]: string | null } | null;
1273
+
1274
+ /**
1275
+ * A transient ID that can be used to reference this price when adding adjustments
1276
+ * in the same API call.
1277
+ */
1278
+ reference_id?: string | null;
1279
+ }
1280
+
1281
+ export namespace NewPlanEventOutputPrice {
1282
+ /**
1283
+ * Configuration for event_output pricing
1284
+ */
1285
+ export interface EventOutputConfig {
1286
+ /**
1287
+ * The key in the event data to extract the unit rate from.
1288
+ */
1289
+ unit_rating_key: string;
1290
+
1291
+ /**
1292
+ * An optional key in the event data to group by (e.g., event ID). All events will
1293
+ * also be grouped by their unit rate.
1294
+ */
1295
+ grouping_key?: string | null;
1296
+ }
1297
+ }
830
1298
  }
831
1299
  }
832
1300