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,4 +1,4 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- export { Discount, Price, PriceCreateParams, PriceListParams, PricesPage, Prices } from './prices';
4
3
  export { ExternalPriceID } from './external-price-id';
4
+ export { Price, PriceCreateParams, PriceListParams, PricesPage, Prices } from './prices';
@@ -4,7 +4,7 @@ import * as Core from "../../core";
4
4
  import { APIResource } from "../../resource";
5
5
  import { isRequestOptions } from "../../core";
6
6
  import * as PricesAPI from "./prices";
7
- import * as InvoicesAPI from "../invoices";
7
+ import * as Shared from "../shared";
8
8
  import * as ExternalPriceIDAPI from "./external-price-id";
9
9
  import { Page, type PageParams } from "../../pagination";
10
10
 
@@ -53,38 +53,6 @@ export class Prices extends APIResource {
53
53
 
54
54
  export class PricesPage extends Page<Price> {}
55
55
 
56
- export interface Discount {
57
- discount_type: 'percentage' | 'trial' | 'usage' | 'amount';
58
-
59
- /**
60
- * Only available if discount_type is `amount`.
61
- */
62
- amount_discount?: string | null;
63
-
64
- /**
65
- * List of price_ids that this discount applies to. For plan/plan phase discounts,
66
- * this can be a subset of prices.
67
- */
68
- applies_to_price_ids?: Array<string> | null;
69
-
70
- /**
71
- * Only available if discount_type is `percentage`. This is a number between 0
72
- * and 1.
73
- */
74
- percentage_discount?: number | null;
75
-
76
- /**
77
- * Only available if discount_type is `trial`
78
- */
79
- trial_amount_discount?: string | null;
80
-
81
- /**
82
- * Only available if discount_type is `usage`. Number of usage units that this
83
- * discount is for
84
- */
85
- usage_discount?: number | null;
86
- }
87
-
88
56
  /**
89
57
  * The Price resource represents a price that can be billed on a subscription,
90
58
  * resulting in a charge on an invoice in the form of an invoice line item. Prices
@@ -362,7 +330,7 @@ export namespace Price {
362
330
 
363
331
  unit_config: UnitPrice.UnitConfig;
364
332
 
365
- discount?: InvoicesAPI.InvoiceDiscount | null;
333
+ discount?: Shared.Discount | null;
366
334
 
367
335
  maximum?: UnitPrice.Maximum | null;
368
336
 
@@ -450,7 +418,7 @@ export namespace Price {
450
418
 
451
419
  price_type: 'usage_price' | 'fixed_price';
452
420
 
453
- discount?: InvoicesAPI.InvoiceDiscount | null;
421
+ discount?: Shared.Discount | null;
454
422
 
455
423
  maximum?: PackagePrice.Maximum | null;
456
424
 
@@ -539,7 +507,7 @@ export namespace Price {
539
507
 
540
508
  price_type: 'usage_price' | 'fixed_price';
541
509
 
542
- discount?: InvoicesAPI.InvoiceDiscount | null;
510
+ discount?: Shared.Discount | null;
543
511
 
544
512
  maximum?: MatrixPrice.Maximum | null;
545
513
 
@@ -659,7 +627,7 @@ export namespace Price {
659
627
 
660
628
  tiered_config: TieredPrice.TieredConfig;
661
629
 
662
- discount?: InvoicesAPI.InvoiceDiscount | null;
630
+ discount?: Shared.Discount | null;
663
631
 
664
632
  maximum?: TieredPrice.Maximum | null;
665
633
 
@@ -761,7 +729,7 @@ export namespace Price {
761
729
 
762
730
  tiered_bps_config: TieredBpsPrice.TieredBpsConfig;
763
731
 
764
- discount?: InvoicesAPI.InvoiceDiscount | null;
732
+ discount?: Shared.Discount | null;
765
733
 
766
734
  maximum?: TieredBpsPrice.Maximum | null;
767
735
 
@@ -869,7 +837,7 @@ export namespace Price {
869
837
 
870
838
  price_type: 'usage_price' | 'fixed_price';
871
839
 
872
- discount?: InvoicesAPI.InvoiceDiscount | null;
840
+ discount?: Shared.Discount | null;
873
841
 
874
842
  maximum?: BpsPrice.Maximum | null;
875
843
 
@@ -957,7 +925,7 @@ export namespace Price {
957
925
 
958
926
  price_type: 'usage_price' | 'fixed_price';
959
927
 
960
- discount?: InvoicesAPI.InvoiceDiscount | null;
928
+ discount?: Shared.Discount | null;
961
929
 
962
930
  maximum?: BulkBpsPrice.Maximum | null;
963
931
 
@@ -1060,7 +1028,7 @@ export namespace Price {
1060
1028
 
1061
1029
  price_type: 'usage_price' | 'fixed_price';
1062
1030
 
1063
- discount?: InvoicesAPI.InvoiceDiscount | null;
1031
+ discount?: Shared.Discount | null;
1064
1032
 
1065
1033
  maximum?: BulkPrice.Maximum | null;
1066
1034
 
@@ -1157,7 +1125,7 @@ export namespace Price {
1157
1125
 
1158
1126
  test_rating_function_config: Record<string, unknown>;
1159
1127
 
1160
- discount?: InvoicesAPI.InvoiceDiscount | null;
1128
+ discount?: Shared.Discount | null;
1161
1129
 
1162
1130
  maximum?: TestRatingFunctionPrice.Maximum | null;
1163
1131
 
@@ -1233,7 +1201,7 @@ export namespace Price {
1233
1201
 
1234
1202
  price_type: 'usage_price' | 'fixed_price';
1235
1203
 
1236
- discount?: InvoicesAPI.InvoiceDiscount | null;
1204
+ discount?: Shared.Discount | null;
1237
1205
 
1238
1206
  maximum?: FivetranExamplePrice.Maximum | null;
1239
1207
 
@@ -1309,7 +1277,7 @@ export namespace Price {
1309
1277
 
1310
1278
  threshold_total_amount_config: Record<string, unknown>;
1311
1279
 
1312
- discount?: InvoicesAPI.InvoiceDiscount | null;
1280
+ discount?: Shared.Discount | null;
1313
1281
 
1314
1282
  maximum?: ThresholdTotalAmountPrice.Maximum | null;
1315
1283
 
@@ -1385,7 +1353,7 @@ export namespace Price {
1385
1353
 
1386
1354
  tiered_package_config: Record<string, unknown>;
1387
1355
 
1388
- discount?: InvoicesAPI.InvoiceDiscount | null;
1356
+ discount?: Shared.Discount | null;
1389
1357
 
1390
1358
  maximum?: TieredPackagePrice.Maximum | null;
1391
1359
 
@@ -1461,7 +1429,7 @@ export namespace Price {
1461
1429
 
1462
1430
  tiered_with_minimum_config: Record<string, unknown>;
1463
1431
 
1464
- discount?: InvoicesAPI.InvoiceDiscount | null;
1432
+ discount?: Shared.Discount | null;
1465
1433
 
1466
1434
  maximum?: TieredWithMinimumPrice.Maximum | null;
1467
1435
 
@@ -1537,7 +1505,7 @@ export namespace Price {
1537
1505
 
1538
1506
  price_type: 'usage_price' | 'fixed_price';
1539
1507
 
1540
- discount?: InvoicesAPI.InvoiceDiscount | null;
1508
+ discount?: Shared.Discount | null;
1541
1509
 
1542
1510
  maximum?: PackageWithAllocationPrice.Maximum | null;
1543
1511
 
@@ -1588,25 +1556,25 @@ export namespace Price {
1588
1556
  }
1589
1557
 
1590
1558
  export type PriceCreateParams =
1591
- | PriceCreateParams.NewUnitPrice
1592
- | PriceCreateParams.NewPackagePrice
1593
- | PriceCreateParams.NewMatrixPrice
1594
- | PriceCreateParams.NewTieredPrice
1595
- | PriceCreateParams.NewTieredBpsPrice
1596
- | PriceCreateParams.NewBpsPrice
1597
- | PriceCreateParams.NewBulkBpsPrice
1598
- | PriceCreateParams.NewBulkPrice
1599
- | PriceCreateParams.NewThresholdTotalAmountPrice
1600
- | PriceCreateParams.NewTieredPackagePrice
1601
- | PriceCreateParams.NewTieredWithMinimumPrice
1602
- | PriceCreateParams.NewPackageWithAllocationPrice;
1559
+ | PriceCreateParams.NewFloatingUnitPrice
1560
+ | PriceCreateParams.NewFloatingPackagePrice
1561
+ | PriceCreateParams.NewFloatingMatrixPrice
1562
+ | PriceCreateParams.NewFloatingTieredPrice
1563
+ | PriceCreateParams.NewFloatingTieredBpsPrice
1564
+ | PriceCreateParams.NewFloatingBpsPrice
1565
+ | PriceCreateParams.NewFloatingBulkBpsPrice
1566
+ | PriceCreateParams.NewFloatingBulkPrice
1567
+ | PriceCreateParams.NewFloatingThresholdTotalAmountPrice
1568
+ | PriceCreateParams.NewFloatingTieredPackagePrice
1569
+ | PriceCreateParams.NewFloatingTieredWithMinimumPrice
1570
+ | PriceCreateParams.NewFloatingPackageWithAllocationPrice;
1603
1571
 
1604
1572
  export namespace PriceCreateParams {
1605
- export interface NewUnitPrice {
1573
+ export interface NewFloatingUnitPrice {
1606
1574
  /**
1607
1575
  * The cadence to bill for this price on.
1608
1576
  */
1609
- cadence: 'annual' | 'monthly' | 'quarterly';
1577
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
1610
1578
 
1611
1579
  /**
1612
1580
  * An ISO 4217 currency string for which this price is billed in.
@@ -1625,7 +1593,7 @@ export namespace PriceCreateParams {
1625
1593
  */
1626
1594
  name: string;
1627
1595
 
1628
- unit_config: PriceCreateParams.NewUnitPrice.UnitConfig;
1596
+ unit_config: PriceCreateParams.NewFloatingUnitPrice.UnitConfig;
1629
1597
 
1630
1598
  /**
1631
1599
  * The id of the billable metric for the price. Only needed if the price is
@@ -1656,7 +1624,7 @@ export namespace PriceCreateParams {
1656
1624
  invoice_grouping_key?: string | null;
1657
1625
  }
1658
1626
 
1659
- export namespace NewUnitPrice {
1627
+ export namespace NewFloatingUnitPrice {
1660
1628
  export interface UnitConfig {
1661
1629
  /**
1662
1630
  * Rate per unit of usage
@@ -1670,11 +1638,11 @@ export namespace PriceCreateParams {
1670
1638
  }
1671
1639
  }
1672
1640
 
1673
- export interface NewPackagePrice {
1641
+ export interface NewFloatingPackagePrice {
1674
1642
  /**
1675
1643
  * The cadence to bill for this price on.
1676
1644
  */
1677
- cadence: 'annual' | 'monthly' | 'quarterly';
1645
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
1678
1646
 
1679
1647
  /**
1680
1648
  * An ISO 4217 currency string for which this price is billed in.
@@ -1693,7 +1661,7 @@ export namespace PriceCreateParams {
1693
1661
  */
1694
1662
  name: string;
1695
1663
 
1696
- package_config: PriceCreateParams.NewPackagePrice.PackageConfig;
1664
+ package_config: PriceCreateParams.NewFloatingPackagePrice.PackageConfig;
1697
1665
 
1698
1666
  /**
1699
1667
  * The id of the billable metric for the price. Only needed if the price is
@@ -1724,7 +1692,7 @@ export namespace PriceCreateParams {
1724
1692
  invoice_grouping_key?: string | null;
1725
1693
  }
1726
1694
 
1727
- export namespace NewPackagePrice {
1695
+ export namespace NewFloatingPackagePrice {
1728
1696
  export interface PackageConfig {
1729
1697
  /**
1730
1698
  * A currency amount to rate usage by
@@ -1739,11 +1707,11 @@ export namespace PriceCreateParams {
1739
1707
  }
1740
1708
  }
1741
1709
 
1742
- export interface NewMatrixPrice {
1710
+ export interface NewFloatingMatrixPrice {
1743
1711
  /**
1744
1712
  * The cadence to bill for this price on.
1745
1713
  */
1746
- cadence: 'annual' | 'monthly' | 'quarterly';
1714
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
1747
1715
 
1748
1716
  /**
1749
1717
  * An ISO 4217 currency string for which this price is billed in.
@@ -1755,7 +1723,7 @@ export namespace PriceCreateParams {
1755
1723
  */
1756
1724
  item_id: string;
1757
1725
 
1758
- matrix_config: PriceCreateParams.NewMatrixPrice.MatrixConfig;
1726
+ matrix_config: PriceCreateParams.NewFloatingMatrixPrice.MatrixConfig;
1759
1727
 
1760
1728
  model_type: 'matrix';
1761
1729
 
@@ -1793,7 +1761,7 @@ export namespace PriceCreateParams {
1793
1761
  invoice_grouping_key?: string | null;
1794
1762
  }
1795
1763
 
1796
- export namespace NewMatrixPrice {
1764
+ export namespace NewFloatingMatrixPrice {
1797
1765
  export interface MatrixConfig {
1798
1766
  /**
1799
1767
  * Default per unit rate for any usage not bucketed into a specified matrix_value
@@ -1839,11 +1807,11 @@ export namespace PriceCreateParams {
1839
1807
  }
1840
1808
  }
1841
1809
 
1842
- export interface NewTieredPrice {
1810
+ export interface NewFloatingTieredPrice {
1843
1811
  /**
1844
1812
  * The cadence to bill for this price on.
1845
1813
  */
1846
- cadence: 'annual' | 'monthly' | 'quarterly';
1814
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
1847
1815
 
1848
1816
  /**
1849
1817
  * An ISO 4217 currency string for which this price is billed in.
@@ -1862,7 +1830,7 @@ export namespace PriceCreateParams {
1862
1830
  */
1863
1831
  name: string;
1864
1832
 
1865
- tiered_config: PriceCreateParams.NewTieredPrice.TieredConfig;
1833
+ tiered_config: PriceCreateParams.NewFloatingTieredPrice.TieredConfig;
1866
1834
 
1867
1835
  /**
1868
1836
  * The id of the billable metric for the price. Only needed if the price is
@@ -1893,7 +1861,7 @@ export namespace PriceCreateParams {
1893
1861
  invoice_grouping_key?: string | null;
1894
1862
  }
1895
1863
 
1896
- export namespace NewTieredPrice {
1864
+ export namespace NewFloatingTieredPrice {
1897
1865
  export interface TieredConfig {
1898
1866
  /**
1899
1867
  * Tiers for rating based on total usage quantities into the specified tier
@@ -1921,11 +1889,11 @@ export namespace PriceCreateParams {
1921
1889
  }
1922
1890
  }
1923
1891
 
1924
- export interface NewTieredBpsPrice {
1892
+ export interface NewFloatingTieredBpsPrice {
1925
1893
  /**
1926
1894
  * The cadence to bill for this price on.
1927
1895
  */
1928
- cadence: 'annual' | 'monthly' | 'quarterly';
1896
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
1929
1897
 
1930
1898
  /**
1931
1899
  * An ISO 4217 currency string for which this price is billed in.
@@ -1944,7 +1912,7 @@ export namespace PriceCreateParams {
1944
1912
  */
1945
1913
  name: string;
1946
1914
 
1947
- tiered_bps_config: PriceCreateParams.NewTieredBpsPrice.TieredBpsConfig;
1915
+ tiered_bps_config: PriceCreateParams.NewFloatingTieredBpsPrice.TieredBpsConfig;
1948
1916
 
1949
1917
  /**
1950
1918
  * The id of the billable metric for the price. Only needed if the price is
@@ -1975,7 +1943,7 @@ export namespace PriceCreateParams {
1975
1943
  invoice_grouping_key?: string | null;
1976
1944
  }
1977
1945
 
1978
- export namespace NewTieredBpsPrice {
1946
+ export namespace NewFloatingTieredBpsPrice {
1979
1947
  export interface TieredBpsConfig {
1980
1948
  /**
1981
1949
  * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
@@ -2009,13 +1977,13 @@ export namespace PriceCreateParams {
2009
1977
  }
2010
1978
  }
2011
1979
 
2012
- export interface NewBpsPrice {
2013
- bps_config: PriceCreateParams.NewBpsPrice.BpsConfig;
1980
+ export interface NewFloatingBpsPrice {
1981
+ bps_config: PriceCreateParams.NewFloatingBpsPrice.BpsConfig;
2014
1982
 
2015
1983
  /**
2016
1984
  * The cadence to bill for this price on.
2017
1985
  */
2018
- cadence: 'annual' | 'monthly' | 'quarterly';
1986
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
2019
1987
 
2020
1988
  /**
2021
1989
  * An ISO 4217 currency string for which this price is billed in.
@@ -2063,7 +2031,7 @@ export namespace PriceCreateParams {
2063
2031
  invoice_grouping_key?: string | null;
2064
2032
  }
2065
2033
 
2066
- export namespace NewBpsPrice {
2034
+ export namespace NewFloatingBpsPrice {
2067
2035
  export interface BpsConfig {
2068
2036
  /**
2069
2037
  * Basis point take rate per event
@@ -2077,13 +2045,13 @@ export namespace PriceCreateParams {
2077
2045
  }
2078
2046
  }
2079
2047
 
2080
- export interface NewBulkBpsPrice {
2081
- bulk_bps_config: PriceCreateParams.NewBulkBpsPrice.BulkBpsConfig;
2048
+ export interface NewFloatingBulkBpsPrice {
2049
+ bulk_bps_config: PriceCreateParams.NewFloatingBulkBpsPrice.BulkBpsConfig;
2082
2050
 
2083
2051
  /**
2084
2052
  * The cadence to bill for this price on.
2085
2053
  */
2086
- cadence: 'annual' | 'monthly' | 'quarterly';
2054
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
2087
2055
 
2088
2056
  /**
2089
2057
  * An ISO 4217 currency string for which this price is billed in.
@@ -2131,7 +2099,7 @@ export namespace PriceCreateParams {
2131
2099
  invoice_grouping_key?: string | null;
2132
2100
  }
2133
2101
 
2134
- export namespace NewBulkBpsPrice {
2102
+ export namespace NewFloatingBulkBpsPrice {
2135
2103
  export interface BulkBpsConfig {
2136
2104
  /**
2137
2105
  * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
@@ -2160,13 +2128,13 @@ export namespace PriceCreateParams {
2160
2128
  }
2161
2129
  }
2162
2130
 
2163
- export interface NewBulkPrice {
2164
- bulk_config: PriceCreateParams.NewBulkPrice.BulkConfig;
2131
+ export interface NewFloatingBulkPrice {
2132
+ bulk_config: PriceCreateParams.NewFloatingBulkPrice.BulkConfig;
2165
2133
 
2166
2134
  /**
2167
2135
  * The cadence to bill for this price on.
2168
2136
  */
2169
- cadence: 'annual' | 'monthly' | 'quarterly';
2137
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
2170
2138
 
2171
2139
  /**
2172
2140
  * An ISO 4217 currency string for which this price is billed in.
@@ -2214,7 +2182,7 @@ export namespace PriceCreateParams {
2214
2182
  invoice_grouping_key?: string | null;
2215
2183
  }
2216
2184
 
2217
- export namespace NewBulkPrice {
2185
+ export namespace NewFloatingBulkPrice {
2218
2186
  export interface BulkConfig {
2219
2187
  /**
2220
2188
  * Bulk tiers for rating based on total usage volume
@@ -2237,11 +2205,11 @@ export namespace PriceCreateParams {
2237
2205
  }
2238
2206
  }
2239
2207
 
2240
- export interface NewThresholdTotalAmountPrice {
2208
+ export interface NewFloatingThresholdTotalAmountPrice {
2241
2209
  /**
2242
2210
  * The cadence to bill for this price on.
2243
2211
  */
2244
- cadence: 'annual' | 'monthly' | 'quarterly';
2212
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
2245
2213
 
2246
2214
  /**
2247
2215
  * An ISO 4217 currency string for which this price is billed in.
@@ -2291,11 +2259,11 @@ export namespace PriceCreateParams {
2291
2259
  invoice_grouping_key?: string | null;
2292
2260
  }
2293
2261
 
2294
- export interface NewTieredPackagePrice {
2262
+ export interface NewFloatingTieredPackagePrice {
2295
2263
  /**
2296
2264
  * The cadence to bill for this price on.
2297
2265
  */
2298
- cadence: 'annual' | 'monthly' | 'quarterly';
2266
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
2299
2267
 
2300
2268
  /**
2301
2269
  * An ISO 4217 currency string for which this price is billed in.
@@ -2345,11 +2313,11 @@ export namespace PriceCreateParams {
2345
2313
  invoice_grouping_key?: string | null;
2346
2314
  }
2347
2315
 
2348
- export interface NewTieredWithMinimumPrice {
2316
+ export interface NewFloatingTieredWithMinimumPrice {
2349
2317
  /**
2350
2318
  * The cadence to bill for this price on.
2351
2319
  */
2352
- cadence: 'annual' | 'monthly' | 'quarterly';
2320
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
2353
2321
 
2354
2322
  /**
2355
2323
  * An ISO 4217 currency string for which this price is billed in.
@@ -2399,11 +2367,11 @@ export namespace PriceCreateParams {
2399
2367
  invoice_grouping_key?: string | null;
2400
2368
  }
2401
2369
 
2402
- export interface NewPackageWithAllocationPrice {
2370
+ export interface NewFloatingPackageWithAllocationPrice {
2403
2371
  /**
2404
2372
  * The cadence to bill for this price on.
2405
2373
  */
2406
- cadence: 'annual' | 'monthly' | 'quarterly';
2374
+ cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
2407
2375
 
2408
2376
  /**
2409
2377
  * An ISO 4217 currency string for which this price is billed in.
@@ -2457,7 +2425,6 @@ export namespace PriceCreateParams {
2457
2425
  export interface PriceListParams extends PageParams {}
2458
2426
 
2459
2427
  export namespace Prices {
2460
- export import Discount = PricesAPI.Discount;
2461
2428
  export import Price = PricesAPI.Price;
2462
2429
  export import PricesPage = PricesAPI.PricesPage;
2463
2430
  export import PriceCreateParams = PricesAPI.PriceCreateParams;
@@ -0,0 +1,84 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ export type Discount =
4
+ | Discount.PercentageDiscount
5
+ | Discount.TrialDiscount
6
+ | Discount.UsageDiscount
7
+ | Discount.AmountDiscount;
8
+
9
+ export namespace Discount {
10
+ export interface PercentageDiscount {
11
+ /**
12
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
13
+ * this can be a subset of prices.
14
+ */
15
+ applies_to_price_ids: Array<string>;
16
+
17
+ discount_type: 'percentage';
18
+
19
+ /**
20
+ * Only available if discount_type is `percentage`. This is a number between 0
21
+ * and 1.
22
+ */
23
+ percentage_discount: number;
24
+
25
+ reason?: string | null;
26
+ }
27
+
28
+ export interface TrialDiscount {
29
+ /**
30
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
31
+ * this can be a subset of prices.
32
+ */
33
+ applies_to_price_ids: Array<string>;
34
+
35
+ discount_type: 'trial';
36
+
37
+ reason?: string | null;
38
+
39
+ /**
40
+ * Only available if discount_type is `trial`
41
+ */
42
+ trial_amount_discount?: string | null;
43
+
44
+ /**
45
+ * Only available if discount_type is `trial`
46
+ */
47
+ trial_percentage_discount?: number | null;
48
+ }
49
+
50
+ export interface UsageDiscount {
51
+ /**
52
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
53
+ * this can be a subset of prices.
54
+ */
55
+ applies_to_price_ids: Array<string>;
56
+
57
+ discount_type: 'usage';
58
+
59
+ /**
60
+ * Only available if discount_type is `usage`. Number of usage units that this
61
+ * discount is for
62
+ */
63
+ usage_discount: number;
64
+
65
+ reason?: string | null;
66
+ }
67
+
68
+ export interface AmountDiscount {
69
+ /**
70
+ * Only available if discount_type is `amount`.
71
+ */
72
+ amount_discount: string;
73
+
74
+ /**
75
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
76
+ * this can be a subset of prices.
77
+ */
78
+ applies_to_price_ids: Array<string>;
79
+
80
+ discount_type: 'amount';
81
+
82
+ reason?: string | null;
83
+ }
84
+ }