orb-billing 2.1.2 → 2.3.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 (93) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +29 -0
  3. package/index.d.mts +16 -5
  4. package/index.d.ts +16 -5
  5. package/index.d.ts.map +1 -1
  6. package/index.js +7 -6
  7. package/index.js.map +1 -1
  8. package/index.mjs +7 -6
  9. package/index.mjs.map +1 -1
  10. package/package.json +2 -3
  11. package/resources/coupons/coupons.d.ts +3 -22
  12. package/resources/coupons/coupons.d.ts.map +1 -1
  13. package/resources/coupons/coupons.js.map +1 -1
  14. package/resources/coupons/coupons.mjs.map +1 -1
  15. package/resources/customers/costs.d.ts +4 -4
  16. package/resources/customers/costs.d.ts.map +1 -1
  17. package/resources/customers/costs.js.map +1 -1
  18. package/resources/customers/costs.mjs.map +1 -1
  19. package/resources/customers/credits/credits.d.ts +6 -4
  20. package/resources/customers/credits/credits.d.ts.map +1 -1
  21. package/resources/customers/credits/credits.js.map +1 -1
  22. package/resources/customers/credits/credits.mjs.map +1 -1
  23. package/resources/customers/credits/ledger.d.ts +20 -10
  24. package/resources/customers/credits/ledger.d.ts.map +1 -1
  25. package/resources/customers/credits/ledger.js.map +1 -1
  26. package/resources/customers/credits/ledger.mjs.map +1 -1
  27. package/resources/customers/credits/top-ups.d.ts +38 -8
  28. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  29. package/resources/customers/credits/top-ups.js.map +1 -1
  30. package/resources/customers/credits/top-ups.mjs.map +1 -1
  31. package/resources/customers/usage.d.ts +2 -2
  32. package/resources/customers/usage.d.ts.map +1 -1
  33. package/resources/customers/usage.js.map +1 -1
  34. package/resources/customers/usage.mjs.map +1 -1
  35. package/resources/index.d.ts +3 -3
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js +6 -6
  38. package/resources/index.js.map +1 -1
  39. package/resources/index.mjs +2 -2
  40. package/resources/index.mjs.map +1 -1
  41. package/resources/invoices.d.ts +2 -0
  42. package/resources/invoices.d.ts.map +1 -1
  43. package/resources/invoices.js.map +1 -1
  44. package/resources/invoices.mjs.map +1 -1
  45. package/resources/plans/plans.d.ts +65 -0
  46. package/resources/plans/plans.d.ts.map +1 -1
  47. package/resources/plans/plans.js.map +1 -1
  48. package/resources/plans/plans.mjs.map +1 -1
  49. package/resources/prices/index.d.ts +1 -1
  50. package/resources/prices/index.d.ts.map +1 -1
  51. package/resources/prices/index.js +3 -3
  52. package/resources/prices/index.js.map +1 -1
  53. package/resources/prices/index.mjs +1 -1
  54. package/resources/prices/index.mjs.map +1 -1
  55. package/resources/prices/prices.d.ts +301 -2
  56. package/resources/prices/prices.d.ts.map +1 -1
  57. package/resources/prices/prices.js +26 -0
  58. package/resources/prices/prices.js.map +1 -1
  59. package/resources/prices/prices.mjs +26 -0
  60. package/resources/prices/prices.mjs.map +1 -1
  61. package/resources/shared.d.ts +5 -0
  62. package/resources/shared.d.ts.map +1 -1
  63. package/resources/subscriptions.d.ts +91 -17
  64. package/resources/subscriptions.d.ts.map +1 -1
  65. package/resources/subscriptions.js +6 -0
  66. package/resources/subscriptions.js.map +1 -1
  67. package/resources/subscriptions.mjs +6 -0
  68. package/resources/subscriptions.mjs.map +1 -1
  69. package/resources/webhooks.d.ts +24 -0
  70. package/resources/webhooks.d.ts.map +1 -0
  71. package/resources/webhooks.js +110 -0
  72. package/resources/webhooks.js.map +1 -0
  73. package/resources/webhooks.mjs +106 -0
  74. package/resources/webhooks.mjs.map +1 -0
  75. package/src/index.ts +20 -7
  76. package/src/resources/coupons/coupons.ts +3 -26
  77. package/src/resources/customers/costs.ts +6 -6
  78. package/src/resources/customers/credits/credits.ts +10 -6
  79. package/src/resources/customers/credits/ledger.ts +24 -12
  80. package/src/resources/customers/credits/top-ups.ts +46 -10
  81. package/src/resources/customers/usage.ts +2 -2
  82. package/src/resources/index.ts +12 -2
  83. package/src/resources/invoices.ts +4 -0
  84. package/src/resources/plans/plans.ts +78 -0
  85. package/src/resources/prices/index.ts +10 -1
  86. package/src/resources/prices/prices.ts +428 -0
  87. package/src/resources/shared.ts +8 -0
  88. package/src/resources/subscriptions.ts +122 -20
  89. package/src/resources/webhooks.ts +142 -0
  90. package/src/version.ts +1 -1
  91. package/version.d.ts +1 -1
  92. package/version.js +1 -1
  93. package/version.mjs +1 -1
@@ -25,6 +25,30 @@ export declare class Prices extends APIResource {
25
25
  */
26
26
  list(query?: PriceListParams, options?: Core.RequestOptions): Core.PagePromise<PricesPage, Price>;
27
27
  list(options?: Core.RequestOptions): Core.PagePromise<PricesPage, Price>;
28
+ /**
29
+ * This endpoint is used to evaluate the output of a price for a given customer and
30
+ * time range. It enables filtering and grouping the output using
31
+ * [computed properties](../guides/extensibility/advanced-metrics#computed-properties),
32
+ * supporting the following workflows:
33
+ *
34
+ * 1. Showing detailed usage and costs to the end customer.
35
+ * 2. Auditing subtotals on invoice line items.
36
+ *
37
+ * For these workflows, the expressiveness of computed properties in both the
38
+ * filters and grouping is critical. For example, if you'd like to show your
39
+ * customer their usage grouped by hour and another property, you can do so with
40
+ * the following `grouping_keys`:
41
+ * `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd
42
+ * like to examine a customer's usage for a specific property value, you can do so
43
+ * with the following `filter`:
44
+ * `my_property = 'foo' AND my_other_property = 'bar'`.
45
+ *
46
+ * By default, the start of the time range must be no more than 100 days ago and
47
+ * the length of the results must be no greater than 1000. Note that this is a POST
48
+ * endpoint rather than a GET endpoint because it employs a JSON body rather than
49
+ * query parameters.
50
+ */
51
+ evaluate(priceId: string, body: PriceEvaluateParams, options?: Core.RequestOptions): Core.APIPromise<PriceEvaluateResponse>;
28
52
  /**
29
53
  * This endpoint returns a price given an identifier.
30
54
  */
@@ -32,6 +56,20 @@ export declare class Prices extends APIResource {
32
56
  }
33
57
  export declare class PricesPage extends Page<Price> {
34
58
  }
59
+ export interface EvaluatePriceGroup {
60
+ /**
61
+ * The price's output for the group
62
+ */
63
+ amount: string;
64
+ /**
65
+ * The values for the group in the order specified by `grouping_keys`
66
+ */
67
+ grouping_values: Array<string | number | boolean>;
68
+ /**
69
+ * The price's usage quantity for the group
70
+ */
71
+ quantity: number;
72
+ }
35
73
  /**
36
74
  * The Price resource represents a price that can be billed on a subscription,
37
75
  * resulting in a charge on an invoice in the form of an invoice line item. Prices
@@ -265,13 +303,14 @@ export declare class PricesPage extends Page<Price> {
265
303
  * }
266
304
  * ```
267
305
  */
268
- export type Price = Price.UnitPrice | Price.PackagePrice | Price.MatrixPrice | Price.TieredPrice | Price.TieredBpsPrice | Price.BpsPrice | Price.BulkBpsPrice | Price.BulkPrice | Price.ThresholdTotalAmountPrice | Price.TieredPackagePrice | Price.TieredWithMinimumPrice | Price.PackageWithAllocationPrice | Price.UnitWithPercentPrice | Price.MatrixWithAllocationPrice;
306
+ export type Price = Price.UnitPrice | Price.PackagePrice | Price.MatrixPrice | Price.TieredPrice | Price.TieredBpsPrice | Price.BpsPrice | Price.BulkBpsPrice | Price.BulkPrice | Price.ThresholdTotalAmountPrice | Price.TieredPackagePrice | Price.GroupedTieredPrice | Price.TieredWithMinimumPrice | Price.TieredPackageWithMinimumPrice | Price.PackageWithAllocationPrice | Price.UnitWithPercentPrice | Price.MatrixWithAllocationPrice;
269
307
  export declare namespace Price {
270
308
  interface UnitPrice {
271
309
  id: string;
272
310
  billable_metric: UnitPrice.BillableMetric | null;
273
311
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
274
312
  created_at: string;
313
+ credit_allocation: UnitPrice.CreditAllocation | null;
275
314
  currency: string;
276
315
  discount: Shared.Discount | null;
277
316
  external_price_id: string | null;
@@ -291,6 +330,10 @@ export declare namespace Price {
291
330
  interface BillableMetric {
292
331
  id: string;
293
332
  }
333
+ interface CreditAllocation {
334
+ allows_rollover: boolean;
335
+ currency: string;
336
+ }
294
337
  interface Item {
295
338
  id: string;
296
339
  name: string;
@@ -329,6 +372,7 @@ export declare namespace Price {
329
372
  billable_metric: PackagePrice.BillableMetric | null;
330
373
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
331
374
  created_at: string;
375
+ credit_allocation: PackagePrice.CreditAllocation | null;
332
376
  currency: string;
333
377
  discount: Shared.Discount | null;
334
378
  external_price_id: string | null;
@@ -348,6 +392,10 @@ export declare namespace Price {
348
392
  interface BillableMetric {
349
393
  id: string;
350
394
  }
395
+ interface CreditAllocation {
396
+ allows_rollover: boolean;
397
+ currency: string;
398
+ }
351
399
  interface Item {
352
400
  id: string;
353
401
  name: string;
@@ -391,6 +439,7 @@ export declare namespace Price {
391
439
  billable_metric: MatrixPrice.BillableMetric | null;
392
440
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
393
441
  created_at: string;
442
+ credit_allocation: MatrixPrice.CreditAllocation | null;
394
443
  currency: string;
395
444
  discount: Shared.Discount | null;
396
445
  external_price_id: string | null;
@@ -410,6 +459,10 @@ export declare namespace Price {
410
459
  interface BillableMetric {
411
460
  id: string;
412
461
  }
462
+ interface CreditAllocation {
463
+ allows_rollover: boolean;
464
+ currency: string;
465
+ }
413
466
  interface Item {
414
467
  id: string;
415
468
  name: string;
@@ -470,6 +523,7 @@ export declare namespace Price {
470
523
  billable_metric: TieredPrice.BillableMetric | null;
471
524
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
472
525
  created_at: string;
526
+ credit_allocation: TieredPrice.CreditAllocation | null;
473
527
  currency: string;
474
528
  discount: Shared.Discount | null;
475
529
  external_price_id: string | null;
@@ -489,6 +543,10 @@ export declare namespace Price {
489
543
  interface BillableMetric {
490
544
  id: string;
491
545
  }
546
+ interface CreditAllocation {
547
+ allows_rollover: boolean;
548
+ currency: string;
549
+ }
492
550
  interface Item {
493
551
  id: string;
494
552
  name: string;
@@ -543,6 +601,7 @@ export declare namespace Price {
543
601
  billable_metric: TieredBpsPrice.BillableMetric | null;
544
602
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
545
603
  created_at: string;
604
+ credit_allocation: TieredBpsPrice.CreditAllocation | null;
546
605
  currency: string;
547
606
  discount: Shared.Discount | null;
548
607
  external_price_id: string | null;
@@ -562,6 +621,10 @@ export declare namespace Price {
562
621
  interface BillableMetric {
563
622
  id: string;
564
623
  }
624
+ interface CreditAllocation {
625
+ allows_rollover: boolean;
626
+ currency: string;
627
+ }
565
628
  interface Item {
566
629
  id: string;
567
630
  name: string;
@@ -622,6 +685,7 @@ export declare namespace Price {
622
685
  bps_config: BpsPrice.BpsConfig;
623
686
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
624
687
  created_at: string;
688
+ credit_allocation: BpsPrice.CreditAllocation | null;
625
689
  currency: string;
626
690
  discount: Shared.Discount | null;
627
691
  external_price_id: string | null;
@@ -650,6 +714,10 @@ export declare namespace Price {
650
714
  */
651
715
  per_unit_maximum?: string | null;
652
716
  }
717
+ interface CreditAllocation {
718
+ allows_rollover: boolean;
719
+ currency: string;
720
+ }
653
721
  interface Item {
654
722
  id: string;
655
723
  name: string;
@@ -683,6 +751,7 @@ export declare namespace Price {
683
751
  bulk_bps_config: BulkBpsPrice.BulkBpsConfig;
684
752
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
685
753
  created_at: string;
754
+ credit_allocation: BulkBpsPrice.CreditAllocation | null;
686
755
  currency: string;
687
756
  discount: Shared.Discount | null;
688
757
  external_price_id: string | null;
@@ -724,6 +793,10 @@ export declare namespace Price {
724
793
  per_unit_maximum?: string | null;
725
794
  }
726
795
  }
796
+ interface CreditAllocation {
797
+ allows_rollover: boolean;
798
+ currency: string;
799
+ }
727
800
  interface Item {
728
801
  id: string;
729
802
  name: string;
@@ -757,6 +830,7 @@ export declare namespace Price {
757
830
  bulk_config: BulkPrice.BulkConfig;
758
831
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
759
832
  created_at: string;
833
+ credit_allocation: BulkPrice.CreditAllocation | null;
760
834
  currency: string;
761
835
  discount: Shared.Discount | null;
762
836
  external_price_id: string | null;
@@ -793,6 +867,10 @@ export declare namespace Price {
793
867
  maximum_units?: number | null;
794
868
  }
795
869
  }
870
+ interface CreditAllocation {
871
+ allows_rollover: boolean;
872
+ currency: string;
873
+ }
796
874
  interface Item {
797
875
  id: string;
798
876
  name: string;
@@ -825,6 +903,7 @@ export declare namespace Price {
825
903
  billable_metric: ThresholdTotalAmountPrice.BillableMetric | null;
826
904
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
827
905
  created_at: string;
906
+ credit_allocation: ThresholdTotalAmountPrice.CreditAllocation | null;
828
907
  currency: string;
829
908
  discount: Shared.Discount | null;
830
909
  external_price_id: string | null;
@@ -844,6 +923,10 @@ export declare namespace Price {
844
923
  interface BillableMetric {
845
924
  id: string;
846
925
  }
926
+ interface CreditAllocation {
927
+ allows_rollover: boolean;
928
+ currency: string;
929
+ }
847
930
  interface Item {
848
931
  id: string;
849
932
  name: string;
@@ -876,6 +959,7 @@ export declare namespace Price {
876
959
  billable_metric: TieredPackagePrice.BillableMetric | null;
877
960
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
878
961
  created_at: string;
962
+ credit_allocation: TieredPackagePrice.CreditAllocation | null;
879
963
  currency: string;
880
964
  discount: Shared.Discount | null;
881
965
  external_price_id: string | null;
@@ -895,6 +979,66 @@ export declare namespace Price {
895
979
  interface BillableMetric {
896
980
  id: string;
897
981
  }
982
+ interface CreditAllocation {
983
+ allows_rollover: boolean;
984
+ currency: string;
985
+ }
986
+ interface Item {
987
+ id: string;
988
+ name: string;
989
+ }
990
+ interface Maximum {
991
+ /**
992
+ * List of price_ids that this maximum amount applies to. For plan/plan phase
993
+ * maximums, this can be a subset of prices.
994
+ */
995
+ applies_to_price_ids: Array<string>;
996
+ /**
997
+ * Maximum amount applied
998
+ */
999
+ maximum_amount: string;
1000
+ }
1001
+ interface Minimum {
1002
+ /**
1003
+ * List of price_ids that this minimum amount applies to. For plan/plan phase
1004
+ * minimums, this can be a subset of prices.
1005
+ */
1006
+ applies_to_price_ids: Array<string>;
1007
+ /**
1008
+ * Minimum amount applied
1009
+ */
1010
+ minimum_amount: string;
1011
+ }
1012
+ }
1013
+ interface GroupedTieredPrice {
1014
+ id: string;
1015
+ billable_metric: GroupedTieredPrice.BillableMetric | null;
1016
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
1017
+ created_at: string;
1018
+ credit_allocation: GroupedTieredPrice.CreditAllocation | null;
1019
+ currency: string;
1020
+ discount: Shared.Discount | null;
1021
+ external_price_id: string | null;
1022
+ fixed_price_quantity: number | null;
1023
+ grouped_tiered_config: Record<string, unknown>;
1024
+ item: GroupedTieredPrice.Item;
1025
+ maximum: GroupedTieredPrice.Maximum | null;
1026
+ maximum_amount: string | null;
1027
+ minimum: GroupedTieredPrice.Minimum | null;
1028
+ minimum_amount: string | null;
1029
+ model_type: 'grouped_tiered';
1030
+ name: string;
1031
+ plan_phase_order: number | null;
1032
+ price_type: 'usage_price' | 'fixed_price';
1033
+ }
1034
+ namespace GroupedTieredPrice {
1035
+ interface BillableMetric {
1036
+ id: string;
1037
+ }
1038
+ interface CreditAllocation {
1039
+ allows_rollover: boolean;
1040
+ currency: string;
1041
+ }
898
1042
  interface Item {
899
1043
  id: string;
900
1044
  name: string;
@@ -927,6 +1071,7 @@ export declare namespace Price {
927
1071
  billable_metric: TieredWithMinimumPrice.BillableMetric | null;
928
1072
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
929
1073
  created_at: string;
1074
+ credit_allocation: TieredWithMinimumPrice.CreditAllocation | null;
930
1075
  currency: string;
931
1076
  discount: Shared.Discount | null;
932
1077
  external_price_id: string | null;
@@ -946,6 +1091,66 @@ export declare namespace Price {
946
1091
  interface BillableMetric {
947
1092
  id: string;
948
1093
  }
1094
+ interface CreditAllocation {
1095
+ allows_rollover: boolean;
1096
+ currency: string;
1097
+ }
1098
+ interface Item {
1099
+ id: string;
1100
+ name: string;
1101
+ }
1102
+ interface Maximum {
1103
+ /**
1104
+ * List of price_ids that this maximum amount applies to. For plan/plan phase
1105
+ * maximums, this can be a subset of prices.
1106
+ */
1107
+ applies_to_price_ids: Array<string>;
1108
+ /**
1109
+ * Maximum amount applied
1110
+ */
1111
+ maximum_amount: string;
1112
+ }
1113
+ interface Minimum {
1114
+ /**
1115
+ * List of price_ids that this minimum amount applies to. For plan/plan phase
1116
+ * minimums, this can be a subset of prices.
1117
+ */
1118
+ applies_to_price_ids: Array<string>;
1119
+ /**
1120
+ * Minimum amount applied
1121
+ */
1122
+ minimum_amount: string;
1123
+ }
1124
+ }
1125
+ interface TieredPackageWithMinimumPrice {
1126
+ id: string;
1127
+ billable_metric: TieredPackageWithMinimumPrice.BillableMetric | null;
1128
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
1129
+ created_at: string;
1130
+ credit_allocation: TieredPackageWithMinimumPrice.CreditAllocation | null;
1131
+ currency: string;
1132
+ discount: Shared.Discount | null;
1133
+ external_price_id: string | null;
1134
+ fixed_price_quantity: number | null;
1135
+ item: TieredPackageWithMinimumPrice.Item;
1136
+ maximum: TieredPackageWithMinimumPrice.Maximum | null;
1137
+ maximum_amount: string | null;
1138
+ minimum: TieredPackageWithMinimumPrice.Minimum | null;
1139
+ minimum_amount: string | null;
1140
+ model_type: 'tiered_package_with_minimum';
1141
+ name: string;
1142
+ plan_phase_order: number | null;
1143
+ price_type: 'usage_price' | 'fixed_price';
1144
+ tiered_package_with_minimum_config: Record<string, unknown>;
1145
+ }
1146
+ namespace TieredPackageWithMinimumPrice {
1147
+ interface BillableMetric {
1148
+ id: string;
1149
+ }
1150
+ interface CreditAllocation {
1151
+ allows_rollover: boolean;
1152
+ currency: string;
1153
+ }
949
1154
  interface Item {
950
1155
  id: string;
951
1156
  name: string;
@@ -978,6 +1183,7 @@ export declare namespace Price {
978
1183
  billable_metric: PackageWithAllocationPrice.BillableMetric | null;
979
1184
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
980
1185
  created_at: string;
1186
+ credit_allocation: PackageWithAllocationPrice.CreditAllocation | null;
981
1187
  currency: string;
982
1188
  discount: Shared.Discount | null;
983
1189
  external_price_id: string | null;
@@ -997,6 +1203,10 @@ export declare namespace Price {
997
1203
  interface BillableMetric {
998
1204
  id: string;
999
1205
  }
1206
+ interface CreditAllocation {
1207
+ allows_rollover: boolean;
1208
+ currency: string;
1209
+ }
1000
1210
  interface Item {
1001
1211
  id: string;
1002
1212
  name: string;
@@ -1029,6 +1239,7 @@ export declare namespace Price {
1029
1239
  billable_metric: UnitWithPercentPrice.BillableMetric | null;
1030
1240
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
1031
1241
  created_at: string;
1242
+ credit_allocation: UnitWithPercentPrice.CreditAllocation | null;
1032
1243
  currency: string;
1033
1244
  discount: Shared.Discount | null;
1034
1245
  external_price_id: string | null;
@@ -1048,6 +1259,10 @@ export declare namespace Price {
1048
1259
  interface BillableMetric {
1049
1260
  id: string;
1050
1261
  }
1262
+ interface CreditAllocation {
1263
+ allows_rollover: boolean;
1264
+ currency: string;
1265
+ }
1051
1266
  interface Item {
1052
1267
  id: string;
1053
1268
  name: string;
@@ -1080,6 +1295,7 @@ export declare namespace Price {
1080
1295
  billable_metric: MatrixWithAllocationPrice.BillableMetric | null;
1081
1296
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
1082
1297
  created_at: string;
1298
+ credit_allocation: MatrixWithAllocationPrice.CreditAllocation | null;
1083
1299
  currency: string;
1084
1300
  discount: Shared.Discount | null;
1085
1301
  external_price_id: string | null;
@@ -1099,6 +1315,10 @@ export declare namespace Price {
1099
1315
  interface BillableMetric {
1100
1316
  id: string;
1101
1317
  }
1318
+ interface CreditAllocation {
1319
+ allows_rollover: boolean;
1320
+ currency: string;
1321
+ }
1102
1322
  interface Item {
1103
1323
  id: string;
1104
1324
  name: string;
@@ -1159,7 +1379,10 @@ export declare namespace Price {
1159
1379
  }
1160
1380
  }
1161
1381
  }
1162
- export type PriceCreateParams = PriceCreateParams.NewFloatingUnitPrice | PriceCreateParams.NewFloatingPackagePrice | PriceCreateParams.NewFloatingMatrixPrice | PriceCreateParams.NewFloatingMatrixWithAllocationPrice | PriceCreateParams.NewFloatingTieredPrice | PriceCreateParams.NewFloatingTieredBpsPrice | PriceCreateParams.NewFloatingBpsPrice | PriceCreateParams.NewFloatingBulkBpsPrice | PriceCreateParams.NewFloatingBulkPrice | PriceCreateParams.NewFloatingThresholdTotalAmountPrice | PriceCreateParams.NewFloatingTieredPackagePrice | PriceCreateParams.NewFloatingTieredWithMinimumPrice | PriceCreateParams.NewFloatingPackageWithAllocationPrice | PriceCreateParams.NewFloatingTieredPackageWithMinimumPrice | PriceCreateParams.NewFloatingUnitWithPercentPrice;
1382
+ export interface PriceEvaluateResponse {
1383
+ data: Array<EvaluatePriceGroup>;
1384
+ }
1385
+ export type PriceCreateParams = PriceCreateParams.NewFloatingUnitPrice | PriceCreateParams.NewFloatingPackagePrice | PriceCreateParams.NewFloatingMatrixPrice | PriceCreateParams.NewFloatingMatrixWithAllocationPrice | PriceCreateParams.NewFloatingTieredPrice | PriceCreateParams.NewFloatingTieredBpsPrice | PriceCreateParams.NewFloatingBpsPrice | PriceCreateParams.NewFloatingBulkBpsPrice | PriceCreateParams.NewFloatingBulkPrice | PriceCreateParams.NewFloatingThresholdTotalAmountPrice | PriceCreateParams.NewFloatingTieredPackagePrice | PriceCreateParams.NewFloatingGroupedTieredPrice | PriceCreateParams.NewFloatingTieredWithMinimumPrice | PriceCreateParams.NewFloatingPackageWithAllocationPrice | PriceCreateParams.NewFloatingTieredPackageWithMinimumPrice | PriceCreateParams.NewFloatingUnitWithPercentPrice;
1163
1386
  export declare namespace PriceCreateParams {
1164
1387
  interface NewFloatingUnitPrice {
1165
1388
  /**
@@ -1829,6 +2052,49 @@ export declare namespace PriceCreateParams {
1829
2052
  */
1830
2053
  invoice_grouping_key?: string | null;
1831
2054
  }
2055
+ interface NewFloatingGroupedTieredPrice {
2056
+ /**
2057
+ * The cadence to bill for this price on.
2058
+ */
2059
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
2060
+ /**
2061
+ * An ISO 4217 currency string for which this price is billed in.
2062
+ */
2063
+ currency: string;
2064
+ grouped_tiered_config: Record<string, unknown>;
2065
+ /**
2066
+ * The id of the item the plan will be associated with.
2067
+ */
2068
+ item_id: string;
2069
+ model_type: 'grouped_tiered';
2070
+ /**
2071
+ * The name of the price.
2072
+ */
2073
+ name: string;
2074
+ /**
2075
+ * The id of the billable metric for the price. Only needed if the price is
2076
+ * usage-based.
2077
+ */
2078
+ billable_metric_id?: string | null;
2079
+ /**
2080
+ * If the Price represents a fixed cost, the price will be billed in-advance if
2081
+ * this is true, and in-arrears if this is false.
2082
+ */
2083
+ billed_in_advance?: boolean | null;
2084
+ /**
2085
+ * An alias for the price.
2086
+ */
2087
+ external_price_id?: string | null;
2088
+ /**
2089
+ * If the Price represents a fixed cost, this represents the quantity of units
2090
+ * applied.
2091
+ */
2092
+ fixed_price_quantity?: number | null;
2093
+ /**
2094
+ * The property used to group this price on an invoice
2095
+ */
2096
+ invoice_grouping_key?: string | null;
2097
+ }
1832
2098
  interface NewFloatingTieredWithMinimumPrice {
1833
2099
  /**
1834
2100
  * The cadence to bill for this price on.
@@ -2004,11 +2270,44 @@ export declare namespace PriceCreateParams {
2004
2270
  }
2005
2271
  export interface PriceListParams extends PageParams {
2006
2272
  }
2273
+ export interface PriceEvaluateParams {
2274
+ /**
2275
+ * The exclusive upper bound for event timestamps
2276
+ */
2277
+ timeframe_end: string;
2278
+ /**
2279
+ * The inclusive lower bound for event timestamps
2280
+ */
2281
+ timeframe_start: string;
2282
+ /**
2283
+ * The ID of the customer to which this evaluation is scoped.
2284
+ */
2285
+ customer_id?: string | null;
2286
+ /**
2287
+ * The external customer ID of the customer to which this evaluation is scoped.
2288
+ */
2289
+ external_customer_id?: string | null;
2290
+ /**
2291
+ * A boolean
2292
+ * [computed property](../guides/extensibility/advanced-metrics#computed-properties)
2293
+ * used to filter the underlying billable metric
2294
+ */
2295
+ filter?: string | null;
2296
+ /**
2297
+ * Properties (or
2298
+ * [computed properties](../guides/extensibility/advanced-metrics#computed-properties))
2299
+ * used to group the underlying billable metric
2300
+ */
2301
+ grouping_keys?: Array<string>;
2302
+ }
2007
2303
  export declare namespace Prices {
2304
+ export import EvaluatePriceGroup = PricesAPI.EvaluatePriceGroup;
2008
2305
  export import Price = PricesAPI.Price;
2306
+ export import PriceEvaluateResponse = PricesAPI.PriceEvaluateResponse;
2009
2307
  export import PricesPage = PricesAPI.PricesPage;
2010
2308
  export import PriceCreateParams = PricesAPI.PriceCreateParams;
2011
2309
  export import PriceListParams = PricesAPI.PriceListParams;
2310
+ export import PriceEvaluateParams = PricesAPI.PriceEvaluateParams;
2012
2311
  export import ExternalPriceID = ExternalPriceIDAPI.ExternalPriceID;
2013
2312
  }
2014
2313
  //# sourceMappingURL=prices.d.ts.map