orb-billing 5.5.1 → 5.7.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 (86) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/core.js +3 -3
  3. package/core.js.map +1 -1
  4. package/core.mjs +3 -3
  5. package/core.mjs.map +1 -1
  6. package/index.d.mts +4 -15
  7. package/index.d.ts +4 -15
  8. package/index.d.ts.map +1 -1
  9. package/index.js.map +1 -1
  10. package/index.mjs.map +1 -1
  11. package/package.json +4 -1
  12. package/resources/alerts.d.ts +1 -1
  13. package/resources/beta/beta.d.ts +448 -4
  14. package/resources/beta/beta.d.ts.map +1 -1
  15. package/resources/beta/beta.js.map +1 -1
  16. package/resources/beta/beta.mjs.map +1 -1
  17. package/resources/beta/external-plan-id.d.ts +448 -4
  18. package/resources/beta/external-plan-id.d.ts.map +1 -1
  19. package/resources/customers/balance-transactions.d.ts +2 -2
  20. package/resources/customers/balance-transactions.d.ts.map +1 -1
  21. package/resources/customers/balance-transactions.js.map +1 -1
  22. package/resources/customers/balance-transactions.mjs.map +1 -1
  23. package/resources/customers/credits/ledger.d.ts +22 -8
  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/customers.d.ts +54 -6
  28. package/resources/customers/customers.d.ts.map +1 -1
  29. package/resources/customers/customers.js.map +1 -1
  30. package/resources/customers/customers.mjs.map +1 -1
  31. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +1 -1
  32. package/resources/dimensional-price-groups/dimensional-price-groups.js +1 -1
  33. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +1 -1
  34. package/resources/events/backfills.d.ts +2 -2
  35. package/resources/events/backfills.js +2 -2
  36. package/resources/events/backfills.mjs +2 -2
  37. package/resources/index.d.ts +1 -1
  38. package/resources/index.d.ts.map +1 -1
  39. package/resources/index.js.map +1 -1
  40. package/resources/index.mjs.map +1 -1
  41. package/resources/invoice-line-items.d.ts +1 -1
  42. package/resources/invoices.d.ts +39 -11
  43. package/resources/invoices.d.ts.map +1 -1
  44. package/resources/invoices.js +4 -4
  45. package/resources/invoices.js.map +1 -1
  46. package/resources/invoices.mjs +4 -4
  47. package/resources/invoices.mjs.map +1 -1
  48. package/resources/plans/plans.d.ts +224 -2
  49. package/resources/plans/plans.d.ts.map +1 -1
  50. package/resources/plans/plans.js.map +1 -1
  51. package/resources/plans/plans.mjs.map +1 -1
  52. package/resources/prices/prices.d.ts +1089 -192
  53. package/resources/prices/prices.d.ts.map +1 -1
  54. package/resources/prices/prices.js.map +1 -1
  55. package/resources/prices/prices.mjs.map +1 -1
  56. package/resources/shared.d.ts +2656 -925
  57. package/resources/shared.d.ts.map +1 -1
  58. package/resources/shared.js.map +1 -1
  59. package/resources/shared.mjs.map +1 -1
  60. package/resources/subscriptions.d.ts +1831 -370
  61. package/resources/subscriptions.d.ts.map +1 -1
  62. package/resources/subscriptions.js +1 -1
  63. package/resources/subscriptions.js.map +1 -1
  64. package/resources/subscriptions.mjs +1 -1
  65. package/resources/subscriptions.mjs.map +1 -1
  66. package/src/core.ts +3 -3
  67. package/src/index.ts +5 -21
  68. package/src/resources/alerts.ts +1 -1
  69. package/src/resources/beta/beta.ts +544 -24
  70. package/src/resources/beta/external-plan-id.ts +544 -24
  71. package/src/resources/customers/balance-transactions.ts +4 -2
  72. package/src/resources/customers/credits/ledger.ts +24 -8
  73. package/src/resources/customers/customers.ts +79 -6
  74. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +1 -1
  75. package/src/resources/events/backfills.ts +2 -2
  76. package/src/resources/index.ts +1 -4
  77. package/src/resources/invoice-line-items.ts +1 -1
  78. package/src/resources/invoices.ts +44 -11
  79. package/src/resources/plans/plans.ts +272 -12
  80. package/src/resources/prices/prices.ts +1255 -206
  81. package/src/resources/shared.ts +3057 -1046
  82. package/src/resources/subscriptions.ts +2401 -694
  83. package/src/version.ts +1 -1
  84. package/version.d.ts +1 -1
  85. package/version.js +1 -1
  86. package/version.mjs +1 -1
@@ -766,7 +766,7 @@ export class Subscriptions extends APIResource {
766
766
  * This endpoint can be used to change an existing subscription's plan. It returns
767
767
  * the serialized updated subscription object.
768
768
  *
769
- * The body parameter `change_option` determines when the plan change occurrs. Orb
769
+ * The body parameter `change_option` determines when the plan change occurs. Orb
770
770
  * supports three options:
771
771
  *
772
772
  * - `end_of_subscription_term`: changes the plan at the end of the existing plan's
@@ -1092,8 +1092,11 @@ export interface DiscountOverride {
1092
1092
  usage_discount?: number | null;
1093
1093
  }
1094
1094
 
1095
- export interface NewSubscriptionBPSPrice {
1096
- bps_config: Shared.BPSConfig;
1095
+ export interface NewSubscriptionBulkPrice {
1096
+ /**
1097
+ * Configuration for bulk pricing
1098
+ */
1099
+ bulk_config: Shared.BulkConfig;
1097
1100
 
1098
1101
  /**
1099
1102
  * The cadence to bill for this price on.
@@ -1105,7 +1108,10 @@ export interface NewSubscriptionBPSPrice {
1105
1108
  */
1106
1109
  item_id: string;
1107
1110
 
1108
- model_type: 'bps';
1111
+ /**
1112
+ * The pricing model type
1113
+ */
1114
+ model_type: 'bulk';
1109
1115
 
1110
1116
  /**
1111
1117
  * The name of the price.
@@ -1187,8 +1193,11 @@ export interface NewSubscriptionBPSPrice {
1187
1193
  reference_id?: string | null;
1188
1194
  }
1189
1195
 
1190
- export interface NewSubscriptionBulkBPSPrice {
1191
- bulk_bps_config: Shared.BulkBPSConfig;
1196
+ export interface NewSubscriptionBulkWithProrationPrice {
1197
+ /**
1198
+ * Configuration for bulk_with_proration pricing
1199
+ */
1200
+ bulk_with_proration_config: NewSubscriptionBulkWithProrationPrice.BulkWithProrationConfig;
1192
1201
 
1193
1202
  /**
1194
1203
  * The cadence to bill for this price on.
@@ -1200,7 +1209,10 @@ export interface NewSubscriptionBulkBPSPrice {
1200
1209
  */
1201
1210
  item_id: string;
1202
1211
 
1203
- model_type: 'bulk_bps';
1212
+ /**
1213
+ * The pricing model type
1214
+ */
1215
+ model_type: 'bulk_with_proration';
1204
1216
 
1205
1217
  /**
1206
1218
  * The name of the price.
@@ -1282,20 +1294,55 @@ export interface NewSubscriptionBulkBPSPrice {
1282
1294
  reference_id?: string | null;
1283
1295
  }
1284
1296
 
1285
- export interface NewSubscriptionBulkPrice {
1286
- bulk_config: Shared.BulkConfig;
1297
+ export namespace NewSubscriptionBulkWithProrationPrice {
1298
+ /**
1299
+ * Configuration for bulk_with_proration pricing
1300
+ */
1301
+ export interface BulkWithProrationConfig {
1302
+ /**
1303
+ * Bulk tiers for rating based on total usage volume
1304
+ */
1305
+ tiers: Array<BulkWithProrationConfig.Tier>;
1306
+ }
1307
+
1308
+ export namespace BulkWithProrationConfig {
1309
+ /**
1310
+ * Configuration for a single bulk pricing tier with proration
1311
+ */
1312
+ export interface Tier {
1313
+ /**
1314
+ * Cost per unit
1315
+ */
1316
+ unit_amount: string;
1317
+
1318
+ /**
1319
+ * The lower bound for this tier
1320
+ */
1321
+ tier_lower_bound?: string | null;
1322
+ }
1323
+ }
1324
+ }
1287
1325
 
1326
+ export interface NewSubscriptionCumulativeGroupedBulkPrice {
1288
1327
  /**
1289
1328
  * The cadence to bill for this price on.
1290
1329
  */
1291
1330
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1292
1331
 
1332
+ /**
1333
+ * Configuration for cumulative_grouped_bulk pricing
1334
+ */
1335
+ cumulative_grouped_bulk_config: NewSubscriptionCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig;
1336
+
1293
1337
  /**
1294
1338
  * The id of the item the price will be associated with.
1295
1339
  */
1296
1340
  item_id: string;
1297
1341
 
1298
- model_type: 'bulk';
1342
+ /**
1343
+ * The pricing model type
1344
+ */
1345
+ model_type: 'cumulative_grouped_bulk';
1299
1346
 
1300
1347
  /**
1301
1348
  * The name of the price.
@@ -1377,20 +1424,65 @@ export interface NewSubscriptionBulkPrice {
1377
1424
  reference_id?: string | null;
1378
1425
  }
1379
1426
 
1380
- export interface NewSubscriptionBulkWithProrationPrice {
1381
- bulk_with_proration_config: { [key: string]: unknown };
1427
+ export namespace NewSubscriptionCumulativeGroupedBulkPrice {
1428
+ /**
1429
+ * Configuration for cumulative_grouped_bulk pricing
1430
+ */
1431
+ export interface CumulativeGroupedBulkConfig {
1432
+ /**
1433
+ * Each tier lower bound must have the same group of values.
1434
+ */
1435
+ dimension_values: Array<CumulativeGroupedBulkConfig.DimensionValue>;
1436
+
1437
+ /**
1438
+ * Grouping key name
1439
+ */
1440
+ group: string;
1441
+ }
1382
1442
 
1443
+ export namespace CumulativeGroupedBulkConfig {
1444
+ /**
1445
+ * Configuration for a dimension value entry
1446
+ */
1447
+ export interface DimensionValue {
1448
+ /**
1449
+ * Grouping key value
1450
+ */
1451
+ grouping_key: string;
1452
+
1453
+ /**
1454
+ * Tier lower bound
1455
+ */
1456
+ tier_lower_bound: string;
1457
+
1458
+ /**
1459
+ * Unit amount for this combination
1460
+ */
1461
+ unit_amount: string;
1462
+ }
1463
+ }
1464
+ }
1465
+
1466
+ export interface NewSubscriptionGroupedAllocationPrice {
1383
1467
  /**
1384
1468
  * The cadence to bill for this price on.
1385
1469
  */
1386
1470
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1387
1471
 
1472
+ /**
1473
+ * Configuration for grouped_allocation pricing
1474
+ */
1475
+ grouped_allocation_config: NewSubscriptionGroupedAllocationPrice.GroupedAllocationConfig;
1476
+
1388
1477
  /**
1389
1478
  * The id of the item the price will be associated with.
1390
1479
  */
1391
1480
  item_id: string;
1392
1481
 
1393
- model_type: 'bulk_with_proration';
1482
+ /**
1483
+ * The pricing model type
1484
+ */
1485
+ model_type: 'grouped_allocation';
1394
1486
 
1395
1487
  /**
1396
1488
  * The name of the price.
@@ -1472,20 +1564,48 @@ export interface NewSubscriptionBulkWithProrationPrice {
1472
1564
  reference_id?: string | null;
1473
1565
  }
1474
1566
 
1475
- export interface NewSubscriptionCumulativeGroupedBulkPrice {
1567
+ export namespace NewSubscriptionGroupedAllocationPrice {
1568
+ /**
1569
+ * Configuration for grouped_allocation pricing
1570
+ */
1571
+ export interface GroupedAllocationConfig {
1572
+ /**
1573
+ * Usage allocation per group
1574
+ */
1575
+ allocation: string;
1576
+
1577
+ /**
1578
+ * How to determine the groups that should each be allocated some quantity
1579
+ */
1580
+ grouping_key: string;
1581
+
1582
+ /**
1583
+ * Unit rate for post-allocation
1584
+ */
1585
+ overage_unit_rate: string;
1586
+ }
1587
+ }
1588
+
1589
+ export interface NewSubscriptionGroupedTieredPackagePrice {
1476
1590
  /**
1477
1591
  * The cadence to bill for this price on.
1478
1592
  */
1479
1593
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1480
1594
 
1481
- cumulative_grouped_bulk_config: { [key: string]: unknown };
1595
+ /**
1596
+ * Configuration for grouped_tiered_package pricing
1597
+ */
1598
+ grouped_tiered_package_config: NewSubscriptionGroupedTieredPackagePrice.GroupedTieredPackageConfig;
1482
1599
 
1483
1600
  /**
1484
1601
  * The id of the item the price will be associated with.
1485
1602
  */
1486
1603
  item_id: string;
1487
1604
 
1488
- model_type: 'cumulative_grouped_bulk';
1605
+ /**
1606
+ * The pricing model type
1607
+ */
1608
+ model_type: 'grouped_tiered_package';
1489
1609
 
1490
1610
  /**
1491
1611
  * The name of the price.
@@ -1567,20 +1687,66 @@ export interface NewSubscriptionCumulativeGroupedBulkPrice {
1567
1687
  reference_id?: string | null;
1568
1688
  }
1569
1689
 
1570
- export interface NewSubscriptionGroupedAllocationPrice {
1690
+ export namespace NewSubscriptionGroupedTieredPackagePrice {
1691
+ /**
1692
+ * Configuration for grouped_tiered_package pricing
1693
+ */
1694
+ export interface GroupedTieredPackageConfig {
1695
+ /**
1696
+ * The event property used to group before tiering
1697
+ */
1698
+ grouping_key: string;
1699
+
1700
+ /**
1701
+ * Package size
1702
+ */
1703
+ package_size: string;
1704
+
1705
+ /**
1706
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
1707
+ * are defined using exclusive lower bounds.
1708
+ */
1709
+ tiers: Array<GroupedTieredPackageConfig.Tier>;
1710
+ }
1711
+
1712
+ export namespace GroupedTieredPackageConfig {
1713
+ /**
1714
+ * Configuration for a single tier
1715
+ */
1716
+ export interface Tier {
1717
+ /**
1718
+ * Price per package
1719
+ */
1720
+ per_unit: string;
1721
+
1722
+ /**
1723
+ * Tier lower bound
1724
+ */
1725
+ tier_lower_bound: string;
1726
+ }
1727
+ }
1728
+ }
1729
+
1730
+ export interface NewSubscriptionGroupedTieredPrice {
1571
1731
  /**
1572
1732
  * The cadence to bill for this price on.
1573
1733
  */
1574
1734
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1575
1735
 
1576
- grouped_allocation_config: { [key: string]: unknown };
1736
+ /**
1737
+ * Configuration for grouped_tiered pricing
1738
+ */
1739
+ grouped_tiered_config: NewSubscriptionGroupedTieredPrice.GroupedTieredConfig;
1577
1740
 
1578
1741
  /**
1579
1742
  * The id of the item the price will be associated with.
1580
1743
  */
1581
1744
  item_id: string;
1582
1745
 
1583
- model_type: 'grouped_allocation';
1746
+ /**
1747
+ * The pricing model type
1748
+ */
1749
+ model_type: 'grouped_tiered';
1584
1750
 
1585
1751
  /**
1586
1752
  * The name of the price.
@@ -1662,20 +1828,61 @@ export interface NewSubscriptionGroupedAllocationPrice {
1662
1828
  reference_id?: string | null;
1663
1829
  }
1664
1830
 
1665
- export interface NewSubscriptionGroupedTieredPackagePrice {
1831
+ export namespace NewSubscriptionGroupedTieredPrice {
1832
+ /**
1833
+ * Configuration for grouped_tiered pricing
1834
+ */
1835
+ export interface GroupedTieredConfig {
1836
+ /**
1837
+ * The billable metric property used to group before tiering
1838
+ */
1839
+ grouping_key: string;
1840
+
1841
+ /**
1842
+ * Apply tiered pricing to each segment generated after grouping with the provided
1843
+ * key
1844
+ */
1845
+ tiers: Array<GroupedTieredConfig.Tier>;
1846
+ }
1847
+
1848
+ export namespace GroupedTieredConfig {
1849
+ /**
1850
+ * Configuration for a single tier
1851
+ */
1852
+ export interface Tier {
1853
+ /**
1854
+ * Tier lower bound
1855
+ */
1856
+ tier_lower_bound: string;
1857
+
1858
+ /**
1859
+ * Per unit amount
1860
+ */
1861
+ unit_amount: string;
1862
+ }
1863
+ }
1864
+ }
1865
+
1866
+ export interface NewSubscriptionGroupedWithMeteredMinimumPrice {
1666
1867
  /**
1667
1868
  * The cadence to bill for this price on.
1668
1869
  */
1669
1870
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1670
1871
 
1671
- grouped_tiered_package_config: { [key: string]: unknown };
1872
+ /**
1873
+ * Configuration for grouped_with_metered_minimum pricing
1874
+ */
1875
+ grouped_with_metered_minimum_config: NewSubscriptionGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig;
1672
1876
 
1673
1877
  /**
1674
1878
  * The id of the item the price will be associated with.
1675
1879
  */
1676
1880
  item_id: string;
1677
1881
 
1678
- model_type: 'grouped_tiered_package';
1882
+ /**
1883
+ * The pricing model type
1884
+ */
1885
+ model_type: 'grouped_with_metered_minimum';
1679
1886
 
1680
1887
  /**
1681
1888
  * The name of the price.
@@ -1757,20 +1964,97 @@ export interface NewSubscriptionGroupedTieredPackagePrice {
1757
1964
  reference_id?: string | null;
1758
1965
  }
1759
1966
 
1760
- export interface NewSubscriptionGroupedTieredPrice {
1967
+ export namespace NewSubscriptionGroupedWithMeteredMinimumPrice {
1968
+ /**
1969
+ * Configuration for grouped_with_metered_minimum pricing
1970
+ */
1971
+ export interface GroupedWithMeteredMinimumConfig {
1972
+ /**
1973
+ * Used to partition the usage into groups. The minimum amount is applied to each
1974
+ * group.
1975
+ */
1976
+ grouping_key: string;
1977
+
1978
+ /**
1979
+ * The minimum amount to charge per group per unit
1980
+ */
1981
+ minimum_unit_amount: string;
1982
+
1983
+ /**
1984
+ * Used to determine the unit rate
1985
+ */
1986
+ pricing_key: string;
1987
+
1988
+ /**
1989
+ * Scale the unit rates by the scaling factor.
1990
+ */
1991
+ scaling_factors: Array<GroupedWithMeteredMinimumConfig.ScalingFactor>;
1992
+
1993
+ /**
1994
+ * Used to determine the unit rate scaling factor
1995
+ */
1996
+ scaling_key: string;
1997
+
1998
+ /**
1999
+ * Apply per unit pricing to each pricing value. The minimum amount is applied any
2000
+ * unmatched usage.
2001
+ */
2002
+ unit_amounts: Array<GroupedWithMeteredMinimumConfig.UnitAmount>;
2003
+ }
2004
+
2005
+ export namespace GroupedWithMeteredMinimumConfig {
2006
+ /**
2007
+ * Configuration for a scaling factor
2008
+ */
2009
+ export interface ScalingFactor {
2010
+ /**
2011
+ * Scaling factor
2012
+ */
2013
+ scaling_factor: string;
2014
+
2015
+ /**
2016
+ * Scaling value
2017
+ */
2018
+ scaling_value: string;
2019
+ }
2020
+
2021
+ /**
2022
+ * Configuration for a unit amount
2023
+ */
2024
+ export interface UnitAmount {
2025
+ /**
2026
+ * Pricing value
2027
+ */
2028
+ pricing_value: string;
2029
+
2030
+ /**
2031
+ * Per unit amount
2032
+ */
2033
+ unit_amount: string;
2034
+ }
2035
+ }
2036
+ }
2037
+
2038
+ export interface NewSubscriptionGroupedWithProratedMinimumPrice {
1761
2039
  /**
1762
2040
  * The cadence to bill for this price on.
1763
2041
  */
1764
2042
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1765
2043
 
1766
- grouped_tiered_config: { [key: string]: unknown };
2044
+ /**
2045
+ * Configuration for grouped_with_prorated_minimum pricing
2046
+ */
2047
+ grouped_with_prorated_minimum_config: NewSubscriptionGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig;
1767
2048
 
1768
2049
  /**
1769
2050
  * The id of the item the price will be associated with.
1770
2051
  */
1771
2052
  item_id: string;
1772
2053
 
1773
- model_type: 'grouped_tiered';
2054
+ /**
2055
+ * The pricing model type
2056
+ */
2057
+ model_type: 'grouped_with_prorated_minimum';
1774
2058
 
1775
2059
  /**
1776
2060
  * The name of the price.
@@ -1852,20 +2136,48 @@ export interface NewSubscriptionGroupedTieredPrice {
1852
2136
  reference_id?: string | null;
1853
2137
  }
1854
2138
 
1855
- export interface NewSubscriptionGroupedWithMeteredMinimumPrice {
2139
+ export namespace NewSubscriptionGroupedWithProratedMinimumPrice {
2140
+ /**
2141
+ * Configuration for grouped_with_prorated_minimum pricing
2142
+ */
2143
+ export interface GroupedWithProratedMinimumConfig {
2144
+ /**
2145
+ * How to determine the groups that should each have a minimum
2146
+ */
2147
+ grouping_key: string;
2148
+
2149
+ /**
2150
+ * The minimum amount to charge per group
2151
+ */
2152
+ minimum: string;
2153
+
2154
+ /**
2155
+ * The amount to charge per unit
2156
+ */
2157
+ unit_rate: string;
2158
+ }
2159
+ }
2160
+
2161
+ export interface NewSubscriptionMatrixPrice {
1856
2162
  /**
1857
2163
  * The cadence to bill for this price on.
1858
2164
  */
1859
2165
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1860
2166
 
1861
- grouped_with_metered_minimum_config: { [key: string]: unknown };
1862
-
1863
2167
  /**
1864
2168
  * The id of the item the price will be associated with.
1865
2169
  */
1866
2170
  item_id: string;
1867
2171
 
1868
- model_type: 'grouped_with_metered_minimum';
2172
+ /**
2173
+ * Configuration for matrix pricing
2174
+ */
2175
+ matrix_config: Shared.MatrixConfig;
2176
+
2177
+ /**
2178
+ * The pricing model type
2179
+ */
2180
+ model_type: 'matrix';
1869
2181
 
1870
2182
  /**
1871
2183
  * The name of the price.
@@ -1947,20 +2259,26 @@ export interface NewSubscriptionGroupedWithMeteredMinimumPrice {
1947
2259
  reference_id?: string | null;
1948
2260
  }
1949
2261
 
1950
- export interface NewSubscriptionGroupedWithProratedMinimumPrice {
2262
+ export interface NewSubscriptionMatrixWithAllocationPrice {
1951
2263
  /**
1952
2264
  * The cadence to bill for this price on.
1953
2265
  */
1954
2266
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
1955
2267
 
1956
- grouped_with_prorated_minimum_config: { [key: string]: unknown };
1957
-
1958
2268
  /**
1959
2269
  * The id of the item the price will be associated with.
1960
2270
  */
1961
2271
  item_id: string;
1962
2272
 
1963
- model_type: 'grouped_with_prorated_minimum';
2273
+ /**
2274
+ * Configuration for matrix_with_allocation pricing
2275
+ */
2276
+ matrix_with_allocation_config: Shared.MatrixWithAllocationConfig;
2277
+
2278
+ /**
2279
+ * The pricing model type
2280
+ */
2281
+ model_type: 'matrix_with_allocation';
1964
2282
 
1965
2283
  /**
1966
2284
  * The name of the price.
@@ -2042,7 +2360,7 @@ export interface NewSubscriptionGroupedWithProratedMinimumPrice {
2042
2360
  reference_id?: string | null;
2043
2361
  }
2044
2362
 
2045
- export interface NewSubscriptionMatrixPrice {
2363
+ export interface NewSubscriptionMatrixWithDisplayNamePrice {
2046
2364
  /**
2047
2365
  * The cadence to bill for this price on.
2048
2366
  */
@@ -2053,9 +2371,15 @@ export interface NewSubscriptionMatrixPrice {
2053
2371
  */
2054
2372
  item_id: string;
2055
2373
 
2056
- matrix_config: Shared.MatrixConfig;
2374
+ /**
2375
+ * Configuration for matrix_with_display_name pricing
2376
+ */
2377
+ matrix_with_display_name_config: NewSubscriptionMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig;
2057
2378
 
2058
- model_type: 'matrix';
2379
+ /**
2380
+ * The pricing model type
2381
+ */
2382
+ model_type: 'matrix_with_display_name';
2059
2383
 
2060
2384
  /**
2061
2385
  * The name of the price.
@@ -2137,20 +2461,65 @@ export interface NewSubscriptionMatrixPrice {
2137
2461
  reference_id?: string | null;
2138
2462
  }
2139
2463
 
2140
- export interface NewSubscriptionMatrixWithAllocationPrice {
2464
+ export namespace NewSubscriptionMatrixWithDisplayNamePrice {
2141
2465
  /**
2142
- * The cadence to bill for this price on.
2466
+ * Configuration for matrix_with_display_name pricing
2143
2467
  */
2144
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
2468
+ export interface MatrixWithDisplayNameConfig {
2469
+ /**
2470
+ * Used to determine the unit rate
2471
+ */
2472
+ dimension: string;
2145
2473
 
2146
- /**
2147
- * The id of the item the price will be associated with.
2148
- */
2149
- item_id: string;
2474
+ /**
2475
+ * Apply per unit pricing to each dimension value
2476
+ */
2477
+ unit_amounts: Array<MatrixWithDisplayNameConfig.UnitAmount>;
2478
+ }
2150
2479
 
2151
- matrix_with_allocation_config: Shared.MatrixWithAllocationConfig;
2480
+ export namespace MatrixWithDisplayNameConfig {
2481
+ /**
2482
+ * Configuration for a unit amount item
2483
+ */
2484
+ export interface UnitAmount {
2485
+ /**
2486
+ * The dimension value
2487
+ */
2488
+ dimension_value: string;
2152
2489
 
2153
- model_type: 'matrix_with_allocation';
2490
+ /**
2491
+ * Display name for this dimension value
2492
+ */
2493
+ display_name: string;
2494
+
2495
+ /**
2496
+ * Per unit amount
2497
+ */
2498
+ unit_amount: string;
2499
+ }
2500
+ }
2501
+ }
2502
+
2503
+ export interface NewSubscriptionMaxGroupTieredPackagePrice {
2504
+ /**
2505
+ * The cadence to bill for this price on.
2506
+ */
2507
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
2508
+
2509
+ /**
2510
+ * The id of the item the price will be associated with.
2511
+ */
2512
+ item_id: string;
2513
+
2514
+ /**
2515
+ * Configuration for max_group_tiered_package pricing
2516
+ */
2517
+ max_group_tiered_package_config: NewSubscriptionMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig;
2518
+
2519
+ /**
2520
+ * The pricing model type
2521
+ */
2522
+ model_type: 'max_group_tiered_package';
2154
2523
 
2155
2524
  /**
2156
2525
  * The name of the price.
@@ -2232,7 +2601,46 @@ export interface NewSubscriptionMatrixWithAllocationPrice {
2232
2601
  reference_id?: string | null;
2233
2602
  }
2234
2603
 
2235
- export interface NewSubscriptionMatrixWithDisplayNamePrice {
2604
+ export namespace NewSubscriptionMaxGroupTieredPackagePrice {
2605
+ /**
2606
+ * Configuration for max_group_tiered_package pricing
2607
+ */
2608
+ export interface MaxGroupTieredPackageConfig {
2609
+ /**
2610
+ * The event property used to group before tiering the group with the highest value
2611
+ */
2612
+ grouping_key: string;
2613
+
2614
+ /**
2615
+ * Package size
2616
+ */
2617
+ package_size: string;
2618
+
2619
+ /**
2620
+ * Apply tiered pricing to the largest group after grouping with the provided key.
2621
+ */
2622
+ tiers: Array<MaxGroupTieredPackageConfig.Tier>;
2623
+ }
2624
+
2625
+ export namespace MaxGroupTieredPackageConfig {
2626
+ /**
2627
+ * Configuration for a single tier
2628
+ */
2629
+ export interface Tier {
2630
+ /**
2631
+ * Tier lower bound
2632
+ */
2633
+ tier_lower_bound: string;
2634
+
2635
+ /**
2636
+ * Per unit amount
2637
+ */
2638
+ unit_amount: string;
2639
+ }
2640
+ }
2641
+ }
2642
+
2643
+ export interface NewSubscriptionMinimumCompositePrice {
2236
2644
  /**
2237
2645
  * The cadence to bill for this price on.
2238
2646
  */
@@ -2243,9 +2651,15 @@ export interface NewSubscriptionMatrixWithDisplayNamePrice {
2243
2651
  */
2244
2652
  item_id: string;
2245
2653
 
2246
- matrix_with_display_name_config: { [key: string]: unknown };
2654
+ /**
2655
+ * Configuration for minimum pricing
2656
+ */
2657
+ minimum_config: NewSubscriptionMinimumCompositePrice.MinimumConfig;
2247
2658
 
2248
- model_type: 'matrix_with_display_name';
2659
+ /**
2660
+ * The pricing model type
2661
+ */
2662
+ model_type: 'minimum';
2249
2663
 
2250
2664
  /**
2251
2665
  * The name of the price.
@@ -2327,7 +2741,24 @@ export interface NewSubscriptionMatrixWithDisplayNamePrice {
2327
2741
  reference_id?: string | null;
2328
2742
  }
2329
2743
 
2330
- export interface NewSubscriptionMaxGroupTieredPackagePrice {
2744
+ export namespace NewSubscriptionMinimumCompositePrice {
2745
+ /**
2746
+ * Configuration for minimum pricing
2747
+ */
2748
+ export interface MinimumConfig {
2749
+ /**
2750
+ * The minimum amount to apply
2751
+ */
2752
+ minimum_amount: string;
2753
+
2754
+ /**
2755
+ * If true, subtotals from this price are prorated based on the service period
2756
+ */
2757
+ prorated?: boolean;
2758
+ }
2759
+ }
2760
+
2761
+ export interface NewSubscriptionPackagePrice {
2331
2762
  /**
2332
2763
  * The cadence to bill for this price on.
2333
2764
  */
@@ -2338,15 +2769,21 @@ export interface NewSubscriptionMaxGroupTieredPackagePrice {
2338
2769
  */
2339
2770
  item_id: string;
2340
2771
 
2341
- max_group_tiered_package_config: { [key: string]: unknown };
2342
-
2343
- model_type: 'max_group_tiered_package';
2772
+ /**
2773
+ * The pricing model type
2774
+ */
2775
+ model_type: 'package';
2344
2776
 
2345
2777
  /**
2346
2778
  * The name of the price.
2347
2779
  */
2348
2780
  name: string;
2349
2781
 
2782
+ /**
2783
+ * Configuration for package pricing
2784
+ */
2785
+ package_config: Shared.PackageConfig;
2786
+
2350
2787
  /**
2351
2788
  * The id of the billable metric for the price. Only needed if the price is
2352
2789
  * usage-based.
@@ -2422,7 +2859,7 @@ export interface NewSubscriptionMaxGroupTieredPackagePrice {
2422
2859
  reference_id?: string | null;
2423
2860
  }
2424
2861
 
2425
- export interface NewSubscriptionPackagePrice {
2862
+ export interface NewSubscriptionPackageWithAllocationPrice {
2426
2863
  /**
2427
2864
  * The cadence to bill for this price on.
2428
2865
  */
@@ -2433,14 +2870,20 @@ export interface NewSubscriptionPackagePrice {
2433
2870
  */
2434
2871
  item_id: string;
2435
2872
 
2436
- model_type: 'package';
2873
+ /**
2874
+ * The pricing model type
2875
+ */
2876
+ model_type: 'package_with_allocation';
2437
2877
 
2438
2878
  /**
2439
2879
  * The name of the price.
2440
2880
  */
2441
2881
  name: string;
2442
2882
 
2443
- package_config: Shared.PackageConfig;
2883
+ /**
2884
+ * Configuration for package_with_allocation pricing
2885
+ */
2886
+ package_with_allocation_config: NewSubscriptionPackageWithAllocationPrice.PackageWithAllocationConfig;
2444
2887
 
2445
2888
  /**
2446
2889
  * The id of the billable metric for the price. Only needed if the price is
@@ -2517,7 +2960,29 @@ export interface NewSubscriptionPackagePrice {
2517
2960
  reference_id?: string | null;
2518
2961
  }
2519
2962
 
2520
- export interface NewSubscriptionPackageWithAllocationPrice {
2963
+ export namespace NewSubscriptionPackageWithAllocationPrice {
2964
+ /**
2965
+ * Configuration for package_with_allocation pricing
2966
+ */
2967
+ export interface PackageWithAllocationConfig {
2968
+ /**
2969
+ * Usage allocation
2970
+ */
2971
+ allocation: string;
2972
+
2973
+ /**
2974
+ * Price per package
2975
+ */
2976
+ package_amount: string;
2977
+
2978
+ /**
2979
+ * Package size
2980
+ */
2981
+ package_size: string;
2982
+ }
2983
+ }
2984
+
2985
+ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
2521
2986
  /**
2522
2987
  * The cadence to bill for this price on.
2523
2988
  */
@@ -2528,14 +2993,20 @@ export interface NewSubscriptionPackageWithAllocationPrice {
2528
2993
  */
2529
2994
  item_id: string;
2530
2995
 
2531
- model_type: 'package_with_allocation';
2996
+ /**
2997
+ * The pricing model type
2998
+ */
2999
+ model_type: 'scalable_matrix_with_tiered_pricing';
2532
3000
 
2533
3001
  /**
2534
3002
  * The name of the price.
2535
3003
  */
2536
3004
  name: string;
2537
3005
 
2538
- package_with_allocation_config: { [key: string]: unknown };
3006
+ /**
3007
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
3008
+ */
3009
+ scalable_matrix_with_tiered_pricing_config: NewSubscriptionScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig;
2539
3010
 
2540
3011
  /**
2541
3012
  * The id of the billable metric for the price. Only needed if the price is
@@ -2612,7 +3083,71 @@ export interface NewSubscriptionPackageWithAllocationPrice {
2612
3083
  reference_id?: string | null;
2613
3084
  }
2614
3085
 
2615
- export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
3086
+ export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice {
3087
+ /**
3088
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
3089
+ */
3090
+ export interface ScalableMatrixWithTieredPricingConfig {
3091
+ /**
3092
+ * Used for the scalable matrix first dimension
3093
+ */
3094
+ first_dimension: string;
3095
+
3096
+ /**
3097
+ * Apply a scaling factor to each dimension
3098
+ */
3099
+ matrix_scaling_factors: Array<ScalableMatrixWithTieredPricingConfig.MatrixScalingFactor>;
3100
+
3101
+ /**
3102
+ * Tier pricing structure
3103
+ */
3104
+ tiers: Array<ScalableMatrixWithTieredPricingConfig.Tier>;
3105
+
3106
+ /**
3107
+ * Used for the scalable matrix second dimension (optional)
3108
+ */
3109
+ second_dimension?: string | null;
3110
+ }
3111
+
3112
+ export namespace ScalableMatrixWithTieredPricingConfig {
3113
+ /**
3114
+ * Configuration for a single matrix scaling factor
3115
+ */
3116
+ export interface MatrixScalingFactor {
3117
+ /**
3118
+ * First dimension value
3119
+ */
3120
+ first_dimension_value: string;
3121
+
3122
+ /**
3123
+ * Scaling factor
3124
+ */
3125
+ scaling_factor: string;
3126
+
3127
+ /**
3128
+ * Second dimension value (optional)
3129
+ */
3130
+ second_dimension_value?: string | null;
3131
+ }
3132
+
3133
+ /**
3134
+ * Configuration for a single tier entry with business logic
3135
+ */
3136
+ export interface Tier {
3137
+ /**
3138
+ * Tier lower bound
3139
+ */
3140
+ tier_lower_bound: string;
3141
+
3142
+ /**
3143
+ * Per unit amount
3144
+ */
3145
+ unit_amount: string;
3146
+ }
3147
+ }
3148
+ }
3149
+
3150
+ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
2616
3151
  /**
2617
3152
  * The cadence to bill for this price on.
2618
3153
  */
@@ -2623,14 +3158,20 @@ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
2623
3158
  */
2624
3159
  item_id: string;
2625
3160
 
2626
- model_type: 'scalable_matrix_with_tiered_pricing';
3161
+ /**
3162
+ * The pricing model type
3163
+ */
3164
+ model_type: 'scalable_matrix_with_unit_pricing';
2627
3165
 
2628
3166
  /**
2629
3167
  * The name of the price.
2630
3168
  */
2631
3169
  name: string;
2632
3170
 
2633
- scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown };
3171
+ /**
3172
+ * Configuration for scalable_matrix_with_unit_pricing pricing
3173
+ */
3174
+ scalable_matrix_with_unit_pricing_config: NewSubscriptionScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig;
2634
3175
 
2635
3176
  /**
2636
3177
  * The id of the billable metric for the price. Only needed if the price is
@@ -2707,7 +3248,61 @@ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
2707
3248
  reference_id?: string | null;
2708
3249
  }
2709
3250
 
2710
- export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
3251
+ export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice {
3252
+ /**
3253
+ * Configuration for scalable_matrix_with_unit_pricing pricing
3254
+ */
3255
+ export interface ScalableMatrixWithUnitPricingConfig {
3256
+ /**
3257
+ * Used to determine the unit rate
3258
+ */
3259
+ first_dimension: string;
3260
+
3261
+ /**
3262
+ * Apply a scaling factor to each dimension
3263
+ */
3264
+ matrix_scaling_factors: Array<ScalableMatrixWithUnitPricingConfig.MatrixScalingFactor>;
3265
+
3266
+ /**
3267
+ * The final unit price to rate against the output of the matrix
3268
+ */
3269
+ unit_price: string;
3270
+
3271
+ /**
3272
+ * If true, the unit price will be prorated to the billing period
3273
+ */
3274
+ prorate?: boolean | null;
3275
+
3276
+ /**
3277
+ * Used to determine the unit rate (optional)
3278
+ */
3279
+ second_dimension?: string | null;
3280
+ }
3281
+
3282
+ export namespace ScalableMatrixWithUnitPricingConfig {
3283
+ /**
3284
+ * Configuration for a single matrix scaling factor
3285
+ */
3286
+ export interface MatrixScalingFactor {
3287
+ /**
3288
+ * First dimension value
3289
+ */
3290
+ first_dimension_value: string;
3291
+
3292
+ /**
3293
+ * Scaling factor
3294
+ */
3295
+ scaling_factor: string;
3296
+
3297
+ /**
3298
+ * Second dimension value (optional)
3299
+ */
3300
+ second_dimension_value?: string | null;
3301
+ }
3302
+ }
3303
+ }
3304
+
3305
+ export interface NewSubscriptionThresholdTotalAmountPrice {
2711
3306
  /**
2712
3307
  * The cadence to bill for this price on.
2713
3308
  */
@@ -2718,14 +3313,20 @@ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
2718
3313
  */
2719
3314
  item_id: string;
2720
3315
 
2721
- model_type: 'scalable_matrix_with_unit_pricing';
3316
+ /**
3317
+ * The pricing model type
3318
+ */
3319
+ model_type: 'threshold_total_amount';
2722
3320
 
2723
3321
  /**
2724
3322
  * The name of the price.
2725
3323
  */
2726
3324
  name: string;
2727
3325
 
2728
- scalable_matrix_with_unit_pricing_config: { [key: string]: unknown };
3326
+ /**
3327
+ * Configuration for threshold_total_amount pricing
3328
+ */
3329
+ threshold_total_amount_config: NewSubscriptionThresholdTotalAmountPrice.ThresholdTotalAmountConfig;
2729
3330
 
2730
3331
  /**
2731
3332
  * The id of the billable metric for the price. Only needed if the price is
@@ -2802,7 +3403,42 @@ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
2802
3403
  reference_id?: string | null;
2803
3404
  }
2804
3405
 
2805
- export interface NewSubscriptionThresholdTotalAmountPrice {
3406
+ export namespace NewSubscriptionThresholdTotalAmountPrice {
3407
+ /**
3408
+ * Configuration for threshold_total_amount pricing
3409
+ */
3410
+ export interface ThresholdTotalAmountConfig {
3411
+ /**
3412
+ * When the quantity consumed passes a provided threshold, the configured total
3413
+ * will be charged
3414
+ */
3415
+ consumption_table: Array<ThresholdTotalAmountConfig.ConsumptionTable>;
3416
+
3417
+ /**
3418
+ * If true, the unit price will be prorated to the billing period
3419
+ */
3420
+ prorate?: boolean | null;
3421
+ }
3422
+
3423
+ export namespace ThresholdTotalAmountConfig {
3424
+ /**
3425
+ * Configuration for a single threshold
3426
+ */
3427
+ export interface ConsumptionTable {
3428
+ /**
3429
+ * Quantity threshold
3430
+ */
3431
+ threshold: string;
3432
+
3433
+ /**
3434
+ * Total amount for this threshold
3435
+ */
3436
+ total_amount: string;
3437
+ }
3438
+ }
3439
+ }
3440
+
3441
+ export interface NewSubscriptionTieredPackagePrice {
2806
3442
  /**
2807
3443
  * The cadence to bill for this price on.
2808
3444
  */
@@ -2813,14 +3449,20 @@ export interface NewSubscriptionThresholdTotalAmountPrice {
2813
3449
  */
2814
3450
  item_id: string;
2815
3451
 
2816
- model_type: 'threshold_total_amount';
3452
+ /**
3453
+ * The pricing model type
3454
+ */
3455
+ model_type: 'tiered_package';
2817
3456
 
2818
3457
  /**
2819
3458
  * The name of the price.
2820
3459
  */
2821
3460
  name: string;
2822
3461
 
2823
- threshold_total_amount_config: { [key: string]: unknown };
3462
+ /**
3463
+ * Configuration for tiered_package pricing
3464
+ */
3465
+ tiered_package_config: NewSubscriptionTieredPackagePrice.TieredPackageConfig;
2824
3466
 
2825
3467
  /**
2826
3468
  * The id of the billable metric for the price. Only needed if the price is
@@ -2897,7 +3539,42 @@ export interface NewSubscriptionThresholdTotalAmountPrice {
2897
3539
  reference_id?: string | null;
2898
3540
  }
2899
3541
 
2900
- export interface NewSubscriptionTierWithProrationPrice {
3542
+ export namespace NewSubscriptionTieredPackagePrice {
3543
+ /**
3544
+ * Configuration for tiered_package pricing
3545
+ */
3546
+ export interface TieredPackageConfig {
3547
+ /**
3548
+ * Package size
3549
+ */
3550
+ package_size: string;
3551
+
3552
+ /**
3553
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
3554
+ * are defined using exclusive lower bounds.
3555
+ */
3556
+ tiers: Array<TieredPackageConfig.Tier>;
3557
+ }
3558
+
3559
+ export namespace TieredPackageConfig {
3560
+ /**
3561
+ * Configuration for a single tier with business logic
3562
+ */
3563
+ export interface Tier {
3564
+ /**
3565
+ * Price per package
3566
+ */
3567
+ per_unit: string;
3568
+
3569
+ /**
3570
+ * Tier lower bound
3571
+ */
3572
+ tier_lower_bound: string;
3573
+ }
3574
+ }
3575
+ }
3576
+
3577
+ export interface NewSubscriptionTieredPackageWithMinimumPrice {
2901
3578
  /**
2902
3579
  * The cadence to bill for this price on.
2903
3580
  */
@@ -2908,14 +3585,20 @@ export interface NewSubscriptionTierWithProrationPrice {
2908
3585
  */
2909
3586
  item_id: string;
2910
3587
 
2911
- model_type: 'tiered_with_proration';
3588
+ /**
3589
+ * The pricing model type
3590
+ */
3591
+ model_type: 'tiered_package_with_minimum';
2912
3592
 
2913
3593
  /**
2914
3594
  * The name of the price.
2915
3595
  */
2916
3596
  name: string;
2917
3597
 
2918
- tiered_with_proration_config: { [key: string]: unknown };
3598
+ /**
3599
+ * Configuration for tiered_package_with_minimum pricing
3600
+ */
3601
+ tiered_package_with_minimum_config: NewSubscriptionTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig;
2919
3602
 
2920
3603
  /**
2921
3604
  * The id of the billable metric for the price. Only needed if the price is
@@ -2992,25 +3675,71 @@ export interface NewSubscriptionTierWithProrationPrice {
2992
3675
  reference_id?: string | null;
2993
3676
  }
2994
3677
 
2995
- export interface NewSubscriptionTieredBPSPrice {
3678
+ export namespace NewSubscriptionTieredPackageWithMinimumPrice {
2996
3679
  /**
2997
- * The cadence to bill for this price on.
3680
+ * Configuration for tiered_package_with_minimum pricing
2998
3681
  */
2999
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
3682
+ export interface TieredPackageWithMinimumConfig {
3683
+ /**
3684
+ * Package size
3685
+ */
3686
+ package_size: number;
3000
3687
 
3001
- /**
3688
+ /**
3689
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
3690
+ * are defined using exclusive lower bounds.
3691
+ */
3692
+ tiers: Array<TieredPackageWithMinimumConfig.Tier>;
3693
+ }
3694
+
3695
+ export namespace TieredPackageWithMinimumConfig {
3696
+ /**
3697
+ * Configuration for a single tier
3698
+ */
3699
+ export interface Tier {
3700
+ /**
3701
+ * Minimum amount
3702
+ */
3703
+ minimum_amount: string;
3704
+
3705
+ /**
3706
+ * Price per package
3707
+ */
3708
+ per_unit: string;
3709
+
3710
+ /**
3711
+ * Tier lower bound
3712
+ */
3713
+ tier_lower_bound: string;
3714
+ }
3715
+ }
3716
+ }
3717
+
3718
+ export interface NewSubscriptionTieredPrice {
3719
+ /**
3720
+ * The cadence to bill for this price on.
3721
+ */
3722
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
3723
+
3724
+ /**
3002
3725
  * The id of the item the price will be associated with.
3003
3726
  */
3004
3727
  item_id: string;
3005
3728
 
3006
- model_type: 'tiered_bps';
3729
+ /**
3730
+ * The pricing model type
3731
+ */
3732
+ model_type: 'tiered';
3007
3733
 
3008
3734
  /**
3009
3735
  * The name of the price.
3010
3736
  */
3011
3737
  name: string;
3012
3738
 
3013
- tiered_bps_config: Shared.TieredBPSConfig;
3739
+ /**
3740
+ * Configuration for tiered pricing
3741
+ */
3742
+ tiered_config: Shared.TieredConfig;
3014
3743
 
3015
3744
  /**
3016
3745
  * The id of the billable metric for the price. Only needed if the price is
@@ -3087,7 +3816,7 @@ export interface NewSubscriptionTieredBPSPrice {
3087
3816
  reference_id?: string | null;
3088
3817
  }
3089
3818
 
3090
- export interface NewSubscriptionTieredPackagePrice {
3819
+ export interface NewSubscriptionTieredWithMinimumPrice {
3091
3820
  /**
3092
3821
  * The cadence to bill for this price on.
3093
3822
  */
@@ -3098,14 +3827,20 @@ export interface NewSubscriptionTieredPackagePrice {
3098
3827
  */
3099
3828
  item_id: string;
3100
3829
 
3101
- model_type: 'tiered_package';
3830
+ /**
3831
+ * The pricing model type
3832
+ */
3833
+ model_type: 'tiered_with_minimum';
3102
3834
 
3103
3835
  /**
3104
3836
  * The name of the price.
3105
3837
  */
3106
3838
  name: string;
3107
3839
 
3108
- tiered_package_config: { [key: string]: unknown };
3840
+ /**
3841
+ * Configuration for tiered_with_minimum pricing
3842
+ */
3843
+ tiered_with_minimum_config: NewSubscriptionTieredWithMinimumPrice.TieredWithMinimumConfig;
3109
3844
 
3110
3845
  /**
3111
3846
  * The id of the billable metric for the price. Only needed if the price is
@@ -3182,7 +3917,52 @@ export interface NewSubscriptionTieredPackagePrice {
3182
3917
  reference_id?: string | null;
3183
3918
  }
3184
3919
 
3185
- export interface NewSubscriptionTieredPackageWithMinimumPrice {
3920
+ export namespace NewSubscriptionTieredWithMinimumPrice {
3921
+ /**
3922
+ * Configuration for tiered_with_minimum pricing
3923
+ */
3924
+ export interface TieredWithMinimumConfig {
3925
+ /**
3926
+ * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are
3927
+ * defined using exclusive lower bounds.
3928
+ */
3929
+ tiers: Array<TieredWithMinimumConfig.Tier>;
3930
+
3931
+ /**
3932
+ * If true, tiers with an accrued amount of 0 will not be included in the rating.
3933
+ */
3934
+ hide_zero_amount_tiers?: boolean;
3935
+
3936
+ /**
3937
+ * If true, the unit price will be prorated to the billing period
3938
+ */
3939
+ prorate?: boolean;
3940
+ }
3941
+
3942
+ export namespace TieredWithMinimumConfig {
3943
+ /**
3944
+ * Configuration for a single tier
3945
+ */
3946
+ export interface Tier {
3947
+ /**
3948
+ * Minimum amount
3949
+ */
3950
+ minimum_amount: string;
3951
+
3952
+ /**
3953
+ * Tier lower bound
3954
+ */
3955
+ tier_lower_bound: string;
3956
+
3957
+ /**
3958
+ * Per unit amount
3959
+ */
3960
+ unit_amount: string;
3961
+ }
3962
+ }
3963
+ }
3964
+
3965
+ export interface NewSubscriptionUnitPrice {
3186
3966
  /**
3187
3967
  * The cadence to bill for this price on.
3188
3968
  */
@@ -3193,14 +3973,20 @@ export interface NewSubscriptionTieredPackageWithMinimumPrice {
3193
3973
  */
3194
3974
  item_id: string;
3195
3975
 
3196
- model_type: 'tiered_package_with_minimum';
3976
+ /**
3977
+ * The pricing model type
3978
+ */
3979
+ model_type: 'unit';
3197
3980
 
3198
3981
  /**
3199
3982
  * The name of the price.
3200
3983
  */
3201
3984
  name: string;
3202
3985
 
3203
- tiered_package_with_minimum_config: { [key: string]: unknown };
3986
+ /**
3987
+ * Configuration for unit pricing
3988
+ */
3989
+ unit_config: Shared.UnitConfig;
3204
3990
 
3205
3991
  /**
3206
3992
  * The id of the billable metric for the price. Only needed if the price is
@@ -3277,7 +4063,7 @@ export interface NewSubscriptionTieredPackageWithMinimumPrice {
3277
4063
  reference_id?: string | null;
3278
4064
  }
3279
4065
 
3280
- export interface NewSubscriptionTieredPrice {
4066
+ export interface NewSubscriptionUnitWithPercentPrice {
3281
4067
  /**
3282
4068
  * The cadence to bill for this price on.
3283
4069
  */
@@ -3288,14 +4074,20 @@ export interface NewSubscriptionTieredPrice {
3288
4074
  */
3289
4075
  item_id: string;
3290
4076
 
3291
- model_type: 'tiered';
4077
+ /**
4078
+ * The pricing model type
4079
+ */
4080
+ model_type: 'unit_with_percent';
3292
4081
 
3293
4082
  /**
3294
4083
  * The name of the price.
3295
4084
  */
3296
4085
  name: string;
3297
4086
 
3298
- tiered_config: Shared.TieredConfig;
4087
+ /**
4088
+ * Configuration for unit_with_percent pricing
4089
+ */
4090
+ unit_with_percent_config: NewSubscriptionUnitWithPercentPrice.UnitWithPercentConfig;
3299
4091
 
3300
4092
  /**
3301
4093
  * The id of the billable metric for the price. Only needed if the price is
@@ -3372,7 +4164,24 @@ export interface NewSubscriptionTieredPrice {
3372
4164
  reference_id?: string | null;
3373
4165
  }
3374
4166
 
3375
- export interface NewSubscriptionTieredWithMinimumPrice {
4167
+ export namespace NewSubscriptionUnitWithPercentPrice {
4168
+ /**
4169
+ * Configuration for unit_with_percent pricing
4170
+ */
4171
+ export interface UnitWithPercentConfig {
4172
+ /**
4173
+ * What percent, out of 100, of the calculated total to charge
4174
+ */
4175
+ percent: string;
4176
+
4177
+ /**
4178
+ * Rate per unit of usage
4179
+ */
4180
+ unit_amount: string;
4181
+ }
4182
+ }
4183
+
4184
+ export interface NewSubscriptionUnitWithProrationPrice {
3376
4185
  /**
3377
4186
  * The cadence to bill for this price on.
3378
4187
  */
@@ -3383,14 +4192,20 @@ export interface NewSubscriptionTieredWithMinimumPrice {
3383
4192
  */
3384
4193
  item_id: string;
3385
4194
 
3386
- model_type: 'tiered_with_minimum';
4195
+ /**
4196
+ * The pricing model type
4197
+ */
4198
+ model_type: 'unit_with_proration';
3387
4199
 
3388
4200
  /**
3389
4201
  * The name of the price.
3390
4202
  */
3391
4203
  name: string;
3392
4204
 
3393
- tiered_with_minimum_config: { [key: string]: unknown };
4205
+ /**
4206
+ * Configuration for unit_with_proration pricing
4207
+ */
4208
+ unit_with_proration_config: NewSubscriptionUnitWithProrationPrice.UnitWithProrationConfig;
3394
4209
 
3395
4210
  /**
3396
4211
  * The id of the billable metric for the price. Only needed if the price is
@@ -3467,442 +4282,169 @@ export interface NewSubscriptionTieredWithMinimumPrice {
3467
4282
  reference_id?: string | null;
3468
4283
  }
3469
4284
 
3470
- export interface NewSubscriptionUnitPrice {
4285
+ export namespace NewSubscriptionUnitWithProrationPrice {
3471
4286
  /**
3472
- * The cadence to bill for this price on.
4287
+ * Configuration for unit_with_proration pricing
3473
4288
  */
3474
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
4289
+ export interface UnitWithProrationConfig {
4290
+ /**
4291
+ * Rate per unit of usage
4292
+ */
4293
+ unit_amount: string;
4294
+ }
4295
+ }
4296
+
4297
+ /**
4298
+ * A [subscription](/core-concepts#subscription) represents the purchase of a plan
4299
+ * by a customer.
4300
+ *
4301
+ * By default, subscriptions begin on the day that they're created and renew
4302
+ * automatically for each billing cycle at the cadence that's configured in the
4303
+ * plan definition.
4304
+ *
4305
+ * Subscriptions also default to **beginning of month alignment**, which means the
4306
+ * first invoice issued for the subscription will have pro-rated charges between
4307
+ * the `start_date` and the first of the following month. Subsequent billing
4308
+ * periods will always start and end on a month boundary (e.g. subsequent month
4309
+ * starts for monthly billing).
4310
+ *
4311
+ * Depending on the plan configuration, any _flat_ recurring fees will be billed
4312
+ * either at the beginning (in-advance) or end (in-arrears) of each billing cycle.
4313
+ * Plans default to **in-advance billing**. Usage-based fees are billed in arrears
4314
+ * as usage is accumulated. In the normal course of events, you can expect an
4315
+ * invoice to contain usage-based charges for the previous period, and a recurring
4316
+ * fee for the following period.
4317
+ */
4318
+ export interface Subscription {
4319
+ id: string;
3475
4320
 
3476
4321
  /**
3477
- * The id of the item the price will be associated with.
4322
+ * The current plan phase that is active, only if the subscription's plan has
4323
+ * phases.
3478
4324
  */
3479
- item_id: string;
4325
+ active_plan_phase_order: number | null;
3480
4326
 
3481
- model_type: 'unit';
4327
+ /**
4328
+ * The adjustment intervals for this subscription sorted by the start_date of the
4329
+ * adjustment interval.
4330
+ */
4331
+ adjustment_intervals: Array<Shared.AdjustmentInterval>;
3482
4332
 
3483
4333
  /**
3484
- * The name of the price.
4334
+ * Determines whether issued invoices for this subscription will automatically be
4335
+ * charged with the saved payment method on the due date. This property defaults to
4336
+ * the plan's behavior. If null, defaults to the customer's setting.
3485
4337
  */
3486
- name: string;
4338
+ auto_collection: boolean | null;
3487
4339
 
3488
- unit_config: Shared.UnitConfig;
4340
+ billing_cycle_anchor_configuration: Shared.BillingCycleAnchorConfiguration;
3489
4341
 
3490
4342
  /**
3491
- * The id of the billable metric for the price. Only needed if the price is
3492
- * usage-based.
4343
+ * The day of the month on which the billing cycle is anchored. If the maximum
4344
+ * number of days in a month is greater than this value, the last day of the month
4345
+ * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
4346
+ * period begins on the 30th.
3493
4347
  */
3494
- billable_metric_id?: string | null;
4348
+ billing_cycle_day: number;
4349
+
4350
+ created_at: string;
3495
4351
 
3496
4352
  /**
3497
- * If the Price represents a fixed cost, the price will be billed in-advance if
3498
- * this is true, and in-arrears if this is false.
4353
+ * The end of the current billing period. This is an exclusive timestamp, such that
4354
+ * the instant returned is not part of the billing period. Set to null for
4355
+ * subscriptions that are not currently active.
3499
4356
  */
3500
- billed_in_advance?: boolean | null;
4357
+ current_billing_period_end_date: string | null;
3501
4358
 
3502
4359
  /**
3503
- * For custom cadence: specifies the duration of the billing period in days or
3504
- * months.
4360
+ * The start date of the current billing period. This is an inclusive timestamp;
4361
+ * the instant returned is exactly the beginning of the billing period. Set to null
4362
+ * if the subscription is not currently active.
3505
4363
  */
3506
- billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
4364
+ current_billing_period_start_date: string | null;
3507
4365
 
3508
4366
  /**
3509
- * The per unit conversion rate of the price currency to the invoicing currency.
4367
+ * A customer is a buyer of your products, and the other party to the billing
4368
+ * relationship.
4369
+ *
4370
+ * In Orb, customers are assigned system generated identifiers automatically, but
4371
+ * it's often desirable to have these match existing identifiers in your system. To
4372
+ * avoid having to denormalize Orb ID information, you can pass in an
4373
+ * `external_customer_id` with your own identifier. See
4374
+ * [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
4375
+ * information about how these aliases work in Orb.
4376
+ *
4377
+ * In addition to having an identifier in your system, a customer may exist in a
4378
+ * payment provider solution like Stripe. Use the `payment_provider_id` and the
4379
+ * `payment_provider` enum field to express this mapping.
4380
+ *
4381
+ * A customer also has a timezone (from the standard
4382
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
4383
+ * your account's timezone. See [Timezone localization](/essentials/timezones) for
4384
+ * information on what this timezone parameter influences within Orb.
3510
4385
  */
3511
- conversion_rate?: number | null;
4386
+ customer: CustomersAPI.Customer;
3512
4387
 
3513
4388
  /**
3514
- * The configuration for the rate of the price currency to the invoicing currency.
4389
+ * Determines the default memo on this subscriptions' invoices. Note that if this
4390
+ * is not provided, it is determined by the plan configuration.
3515
4391
  */
3516
- conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
4392
+ default_invoice_memo: string | null;
3517
4393
 
3518
4394
  /**
3519
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this
3520
- * price is billed.
4395
+ * @deprecated The discount intervals for this subscription sorted by the
4396
+ * start_date. This field is deprecated in favor of `adjustment_intervals`.
3521
4397
  */
3522
- currency?: string | null;
4398
+ discount_intervals: Array<
4399
+ Shared.AmountDiscountInterval | Shared.PercentageDiscountInterval | Shared.UsageDiscountInterval
4400
+ >;
3523
4401
 
3524
4402
  /**
3525
- * For dimensional price: specifies a price group and dimension values
4403
+ * The date Orb stops billing for this subscription.
3526
4404
  */
3527
- dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
4405
+ end_date: string | null;
4406
+
4407
+ fixed_fee_quantity_schedule: Array<Shared.FixedFeeQuantityScheduleEntry>;
4408
+
4409
+ invoicing_threshold: string | null;
3528
4410
 
3529
4411
  /**
3530
- * An alias for the price.
4412
+ * @deprecated The maximum intervals for this subscription sorted by the
4413
+ * start_date. This field is deprecated in favor of `adjustment_intervals`.
3531
4414
  */
3532
- external_price_id?: string | null;
4415
+ maximum_intervals: Array<Shared.MaximumInterval>;
3533
4416
 
3534
4417
  /**
3535
- * If the Price represents a fixed cost, this represents the quantity of units
3536
- * applied.
4418
+ * User specified key-value pairs for the resource. If not present, this defaults
4419
+ * to an empty dictionary. Individual keys can be removed by setting the value to
4420
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
4421
+ * `null`.
3537
4422
  */
3538
- fixed_price_quantity?: number | null;
4423
+ metadata: { [key: string]: string };
3539
4424
 
3540
4425
  /**
3541
- * The property used to group this price on an invoice
4426
+ * @deprecated The minimum intervals for this subscription sorted by the
4427
+ * start_date. This field is deprecated in favor of `adjustment_intervals`.
3542
4428
  */
3543
- invoice_grouping_key?: string | null;
4429
+ minimum_intervals: Array<Shared.MinimumInterval>;
3544
4430
 
3545
4431
  /**
3546
- * Within each billing cycle, specifies the cadence at which invoices are produced.
3547
- * If unspecified, a single invoice is produced per billing cycle.
4432
+ * The name of the subscription.
3548
4433
  */
3549
- invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
4434
+ name: string;
3550
4435
 
3551
4436
  /**
3552
- * User-specified key/value pairs for the resource. Individual keys can be removed
3553
- * by setting the value to `null`, and the entire metadata mapping can be cleared
3554
- * by setting `metadata` to `null`.
4437
+ * Determines the difference between the invoice issue date for subscription
4438
+ * invoices as the date that they are due. A value of `0` here represents that the
4439
+ * invoice is due on issue, whereas a value of `30` represents that the customer
4440
+ * has a month to pay the invoice.
3555
4441
  */
3556
- metadata?: { [key: string]: string | null } | null;
4442
+ net_terms: number;
3557
4443
 
3558
4444
  /**
3559
- * A transient ID that can be used to reference this price when adding adjustments
3560
- * in the same API call.
4445
+ * A pending subscription change if one exists on this subscription.
3561
4446
  */
3562
- reference_id?: string | null;
3563
- }
3564
-
3565
- export interface NewSubscriptionUnitWithPercentPrice {
3566
- /**
3567
- * The cadence to bill for this price on.
3568
- */
3569
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
3570
-
3571
- /**
3572
- * The id of the item the price will be associated with.
3573
- */
3574
- item_id: string;
3575
-
3576
- model_type: 'unit_with_percent';
3577
-
3578
- /**
3579
- * The name of the price.
3580
- */
3581
- name: string;
3582
-
3583
- unit_with_percent_config: { [key: string]: unknown };
3584
-
3585
- /**
3586
- * The id of the billable metric for the price. Only needed if the price is
3587
- * usage-based.
3588
- */
3589
- billable_metric_id?: string | null;
3590
-
3591
- /**
3592
- * If the Price represents a fixed cost, the price will be billed in-advance if
3593
- * this is true, and in-arrears if this is false.
3594
- */
3595
- billed_in_advance?: boolean | null;
3596
-
3597
- /**
3598
- * For custom cadence: specifies the duration of the billing period in days or
3599
- * months.
3600
- */
3601
- billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
3602
-
3603
- /**
3604
- * The per unit conversion rate of the price currency to the invoicing currency.
3605
- */
3606
- conversion_rate?: number | null;
3607
-
3608
- /**
3609
- * The configuration for the rate of the price currency to the invoicing currency.
3610
- */
3611
- conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
3612
-
3613
- /**
3614
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this
3615
- * price is billed.
3616
- */
3617
- currency?: string | null;
3618
-
3619
- /**
3620
- * For dimensional price: specifies a price group and dimension values
3621
- */
3622
- dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
3623
-
3624
- /**
3625
- * An alias for the price.
3626
- */
3627
- external_price_id?: string | null;
3628
-
3629
- /**
3630
- * If the Price represents a fixed cost, this represents the quantity of units
3631
- * applied.
3632
- */
3633
- fixed_price_quantity?: number | null;
3634
-
3635
- /**
3636
- * The property used to group this price on an invoice
3637
- */
3638
- invoice_grouping_key?: string | null;
3639
-
3640
- /**
3641
- * Within each billing cycle, specifies the cadence at which invoices are produced.
3642
- * If unspecified, a single invoice is produced per billing cycle.
3643
- */
3644
- invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
3645
-
3646
- /**
3647
- * User-specified key/value pairs for the resource. Individual keys can be removed
3648
- * by setting the value to `null`, and the entire metadata mapping can be cleared
3649
- * by setting `metadata` to `null`.
3650
- */
3651
- metadata?: { [key: string]: string | null } | null;
3652
-
3653
- /**
3654
- * A transient ID that can be used to reference this price when adding adjustments
3655
- * in the same API call.
3656
- */
3657
- reference_id?: string | null;
3658
- }
3659
-
3660
- export interface NewSubscriptionUnitWithProrationPrice {
3661
- /**
3662
- * The cadence to bill for this price on.
3663
- */
3664
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
3665
-
3666
- /**
3667
- * The id of the item the price will be associated with.
3668
- */
3669
- item_id: string;
3670
-
3671
- model_type: 'unit_with_proration';
3672
-
3673
- /**
3674
- * The name of the price.
3675
- */
3676
- name: string;
3677
-
3678
- unit_with_proration_config: { [key: string]: unknown };
3679
-
3680
- /**
3681
- * The id of the billable metric for the price. Only needed if the price is
3682
- * usage-based.
3683
- */
3684
- billable_metric_id?: string | null;
3685
-
3686
- /**
3687
- * If the Price represents a fixed cost, the price will be billed in-advance if
3688
- * this is true, and in-arrears if this is false.
3689
- */
3690
- billed_in_advance?: boolean | null;
3691
-
3692
- /**
3693
- * For custom cadence: specifies the duration of the billing period in days or
3694
- * months.
3695
- */
3696
- billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
3697
-
3698
- /**
3699
- * The per unit conversion rate of the price currency to the invoicing currency.
3700
- */
3701
- conversion_rate?: number | null;
3702
-
3703
- /**
3704
- * The configuration for the rate of the price currency to the invoicing currency.
3705
- */
3706
- conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
3707
-
3708
- /**
3709
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this
3710
- * price is billed.
3711
- */
3712
- currency?: string | null;
3713
-
3714
- /**
3715
- * For dimensional price: specifies a price group and dimension values
3716
- */
3717
- dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
3718
-
3719
- /**
3720
- * An alias for the price.
3721
- */
3722
- external_price_id?: string | null;
3723
-
3724
- /**
3725
- * If the Price represents a fixed cost, this represents the quantity of units
3726
- * applied.
3727
- */
3728
- fixed_price_quantity?: number | null;
3729
-
3730
- /**
3731
- * The property used to group this price on an invoice
3732
- */
3733
- invoice_grouping_key?: string | null;
3734
-
3735
- /**
3736
- * Within each billing cycle, specifies the cadence at which invoices are produced.
3737
- * If unspecified, a single invoice is produced per billing cycle.
3738
- */
3739
- invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
3740
-
3741
- /**
3742
- * User-specified key/value pairs for the resource. Individual keys can be removed
3743
- * by setting the value to `null`, and the entire metadata mapping can be cleared
3744
- * by setting `metadata` to `null`.
3745
- */
3746
- metadata?: { [key: string]: string | null } | null;
3747
-
3748
- /**
3749
- * A transient ID that can be used to reference this price when adding adjustments
3750
- * in the same API call.
3751
- */
3752
- reference_id?: string | null;
3753
- }
3754
-
3755
- /**
3756
- * A [subscription](/core-concepts#subscription) represents the purchase of a plan
3757
- * by a customer.
3758
- *
3759
- * By default, subscriptions begin on the day that they're created and renew
3760
- * automatically for each billing cycle at the cadence that's configured in the
3761
- * plan definition.
3762
- *
3763
- * Subscriptions also default to **beginning of month alignment**, which means the
3764
- * first invoice issued for the subscription will have pro-rated charges between
3765
- * the `start_date` and the first of the following month. Subsequent billing
3766
- * periods will always start and end on a month boundary (e.g. subsequent month
3767
- * starts for monthly billing).
3768
- *
3769
- * Depending on the plan configuration, any _flat_ recurring fees will be billed
3770
- * either at the beginning (in-advance) or end (in-arrears) of each billing cycle.
3771
- * Plans default to **in-advance billing**. Usage-based fees are billed in arrears
3772
- * as usage is accumulated. In the normal course of events, you can expect an
3773
- * invoice to contain usage-based charges for the previous period, and a recurring
3774
- * fee for the following period.
3775
- */
3776
- export interface Subscription {
3777
- id: string;
3778
-
3779
- /**
3780
- * The current plan phase that is active, only if the subscription's plan has
3781
- * phases.
3782
- */
3783
- active_plan_phase_order: number | null;
3784
-
3785
- /**
3786
- * The adjustment intervals for this subscription sorted by the start_date of the
3787
- * adjustment interval.
3788
- */
3789
- adjustment_intervals: Array<Shared.AdjustmentInterval>;
3790
-
3791
- /**
3792
- * Determines whether issued invoices for this subscription will automatically be
3793
- * charged with the saved payment method on the due date. This property defaults to
3794
- * the plan's behavior. If null, defaults to the customer's setting.
3795
- */
3796
- auto_collection: boolean | null;
3797
-
3798
- billing_cycle_anchor_configuration: Shared.BillingCycleAnchorConfiguration;
3799
-
3800
- /**
3801
- * The day of the month on which the billing cycle is anchored. If the maximum
3802
- * number of days in a month is greater than this value, the last day of the month
3803
- * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
3804
- * period begins on the 30th.
3805
- */
3806
- billing_cycle_day: number;
3807
-
3808
- created_at: string;
3809
-
3810
- /**
3811
- * The end of the current billing period. This is an exclusive timestamp, such that
3812
- * the instant returned is not part of the billing period. Set to null for
3813
- * subscriptions that are not currently active.
3814
- */
3815
- current_billing_period_end_date: string | null;
3816
-
3817
- /**
3818
- * The start date of the current billing period. This is an inclusive timestamp;
3819
- * the instant returned is exactly the beginning of the billing period. Set to null
3820
- * if the subscription is not currently active.
3821
- */
3822
- current_billing_period_start_date: string | null;
3823
-
3824
- /**
3825
- * A customer is a buyer of your products, and the other party to the billing
3826
- * relationship.
3827
- *
3828
- * In Orb, customers are assigned system generated identifiers automatically, but
3829
- * it's often desirable to have these match existing identifiers in your system. To
3830
- * avoid having to denormalize Orb ID information, you can pass in an
3831
- * `external_customer_id` with your own identifier. See
3832
- * [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
3833
- * information about how these aliases work in Orb.
3834
- *
3835
- * In addition to having an identifier in your system, a customer may exist in a
3836
- * payment provider solution like Stripe. Use the `payment_provider_id` and the
3837
- * `payment_provider` enum field to express this mapping.
3838
- *
3839
- * A customer also has a timezone (from the standard
3840
- * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
3841
- * your account's timezone. See [Timezone localization](/essentials/timezones) for
3842
- * information on what this timezone parameter influences within Orb.
3843
- */
3844
- customer: CustomersAPI.Customer;
3845
-
3846
- /**
3847
- * Determines the default memo on this subscriptions' invoices. Note that if this
3848
- * is not provided, it is determined by the plan configuration.
3849
- */
3850
- default_invoice_memo: string | null;
3851
-
3852
- /**
3853
- * @deprecated The discount intervals for this subscription sorted by the
3854
- * start_date. This field is deprecated in favor of `adjustment_intervals`.
3855
- */
3856
- discount_intervals: Array<
3857
- Shared.AmountDiscountInterval | Shared.PercentageDiscountInterval | Shared.UsageDiscountInterval
3858
- >;
3859
-
3860
- /**
3861
- * The date Orb stops billing for this subscription.
3862
- */
3863
- end_date: string | null;
3864
-
3865
- fixed_fee_quantity_schedule: Array<Shared.FixedFeeQuantityScheduleEntry>;
3866
-
3867
- invoicing_threshold: string | null;
3868
-
3869
- /**
3870
- * @deprecated The maximum intervals for this subscription sorted by the
3871
- * start_date. This field is deprecated in favor of `adjustment_intervals`.
3872
- */
3873
- maximum_intervals: Array<Shared.MaximumInterval>;
3874
-
3875
- /**
3876
- * User specified key-value pairs for the resource. If not present, this defaults
3877
- * to an empty dictionary. Individual keys can be removed by setting the value to
3878
- * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
3879
- * `null`.
3880
- */
3881
- metadata: { [key: string]: string };
3882
-
3883
- /**
3884
- * @deprecated The minimum intervals for this subscription sorted by the
3885
- * start_date. This field is deprecated in favor of `adjustment_intervals`.
3886
- */
3887
- minimum_intervals: Array<Shared.MinimumInterval>;
3888
-
3889
- /**
3890
- * The name of the subscription.
3891
- */
3892
- name: string;
3893
-
3894
- /**
3895
- * Determines the difference between the invoice issue date for subscription
3896
- * invoices as the date that they are due. A value of `0` here represents that the
3897
- * invoice is due on issue, whereas a value of `30` represents that the customer
3898
- * has a month to pay the invoice.
3899
- */
3900
- net_terms: number;
3901
-
3902
- /**
3903
- * A pending subscription change if one exists on this subscription.
3904
- */
3905
- pending_subscription_change: Shared.SubscriptionChangeMinified | null;
4447
+ pending_subscription_change: Shared.SubscriptionChangeMinified | null;
3906
4448
 
3907
4449
  /**
3908
4450
  * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
@@ -4253,92 +4795,352 @@ export namespace SubscriptionCreateParams {
4253
4795
  start_date?: string | null;
4254
4796
  }
4255
4797
 
4256
- export interface AddPrice {
4257
- /**
4258
- * The definition of a new allocation price to create and add to the subscription.
4259
- */
4260
- allocation_price?: Shared.NewAllocationPrice | null;
4798
+ export interface AddPrice {
4799
+ /**
4800
+ * The definition of a new allocation price to create and add to the subscription.
4801
+ */
4802
+ allocation_price?: Shared.NewAllocationPrice | null;
4803
+
4804
+ /**
4805
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
4806
+ * discounts for this price.
4807
+ */
4808
+ discounts?: Array<SubscriptionsAPI.DiscountOverride> | null;
4809
+
4810
+ /**
4811
+ * The end date of the price interval. This is the date that the price will stop
4812
+ * billing on the subscription. If null, billing will end when the phase or
4813
+ * subscription ends.
4814
+ */
4815
+ end_date?: string | null;
4816
+
4817
+ /**
4818
+ * The external price id of the price to add to the subscription.
4819
+ */
4820
+ external_price_id?: string | null;
4821
+
4822
+ /**
4823
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
4824
+ * amount for this price.
4825
+ */
4826
+ maximum_amount?: string | null;
4827
+
4828
+ /**
4829
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
4830
+ * amount for this price.
4831
+ */
4832
+ minimum_amount?: string | null;
4833
+
4834
+ /**
4835
+ * The phase to add this price to.
4836
+ */
4837
+ plan_phase_order?: number | null;
4838
+
4839
+ /**
4840
+ * New subscription price request body params.
4841
+ */
4842
+ price?:
4843
+ | SubscriptionsAPI.NewSubscriptionUnitPrice
4844
+ | SubscriptionsAPI.NewSubscriptionTieredPrice
4845
+ | SubscriptionsAPI.NewSubscriptionBulkPrice
4846
+ | SubscriptionsAPI.NewSubscriptionPackagePrice
4847
+ | SubscriptionsAPI.NewSubscriptionMatrixPrice
4848
+ | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
4849
+ | SubscriptionsAPI.NewSubscriptionTieredPackagePrice
4850
+ | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
4851
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
4852
+ | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
4853
+ | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
4854
+ | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
4855
+ | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
4856
+ | AddPrice.NewSubscriptionTieredWithProrationPrice
4857
+ | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
4858
+ | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
4859
+ | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
4860
+ | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
4861
+ | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
4862
+ | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
4863
+ | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
4864
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
4865
+ | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
4866
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
4867
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
4868
+ | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
4869
+ | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice
4870
+ | null;
4871
+
4872
+ /**
4873
+ * The id of the price to add to the subscription.
4874
+ */
4875
+ price_id?: string | null;
4876
+
4877
+ /**
4878
+ * The start date of the price interval. This is the date that the price will start
4879
+ * billing on the subscription. If null, billing will start when the phase or
4880
+ * subscription starts.
4881
+ */
4882
+ start_date?: string | null;
4883
+ }
4884
+
4885
+ export namespace AddPrice {
4886
+ export interface NewSubscriptionTieredWithProrationPrice {
4887
+ /**
4888
+ * The cadence to bill for this price on.
4889
+ */
4890
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
4891
+
4892
+ /**
4893
+ * The id of the item the price will be associated with.
4894
+ */
4895
+ item_id: string;
4896
+
4897
+ /**
4898
+ * The pricing model type
4899
+ */
4900
+ model_type: 'tiered_with_proration';
4901
+
4902
+ /**
4903
+ * The name of the price.
4904
+ */
4905
+ name: string;
4906
+
4907
+ /**
4908
+ * Configuration for tiered_with_proration pricing
4909
+ */
4910
+ tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig;
4911
+
4912
+ /**
4913
+ * The id of the billable metric for the price. Only needed if the price is
4914
+ * usage-based.
4915
+ */
4916
+ billable_metric_id?: string | null;
4917
+
4918
+ /**
4919
+ * If the Price represents a fixed cost, the price will be billed in-advance if
4920
+ * this is true, and in-arrears if this is false.
4921
+ */
4922
+ billed_in_advance?: boolean | null;
4923
+
4924
+ /**
4925
+ * For custom cadence: specifies the duration of the billing period in days or
4926
+ * months.
4927
+ */
4928
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
4929
+
4930
+ /**
4931
+ * The per unit conversion rate of the price currency to the invoicing currency.
4932
+ */
4933
+ conversion_rate?: number | null;
4934
+
4935
+ /**
4936
+ * The configuration for the rate of the price currency to the invoicing currency.
4937
+ */
4938
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
4939
+
4940
+ /**
4941
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
4942
+ * price is billed.
4943
+ */
4944
+ currency?: string | null;
4945
+
4946
+ /**
4947
+ * For dimensional price: specifies a price group and dimension values
4948
+ */
4949
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
4950
+
4951
+ /**
4952
+ * An alias for the price.
4953
+ */
4954
+ external_price_id?: string | null;
4955
+
4956
+ /**
4957
+ * If the Price represents a fixed cost, this represents the quantity of units
4958
+ * applied.
4959
+ */
4960
+ fixed_price_quantity?: number | null;
4961
+
4962
+ /**
4963
+ * The property used to group this price on an invoice
4964
+ */
4965
+ invoice_grouping_key?: string | null;
4966
+
4967
+ /**
4968
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
4969
+ * If unspecified, a single invoice is produced per billing cycle.
4970
+ */
4971
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
4972
+
4973
+ /**
4974
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4975
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4976
+ * by setting `metadata` to `null`.
4977
+ */
4978
+ metadata?: { [key: string]: string | null } | null;
4979
+
4980
+ /**
4981
+ * A transient ID that can be used to reference this price when adding adjustments
4982
+ * in the same API call.
4983
+ */
4984
+ reference_id?: string | null;
4985
+ }
4986
+
4987
+ export namespace NewSubscriptionTieredWithProrationPrice {
4988
+ /**
4989
+ * Configuration for tiered_with_proration pricing
4990
+ */
4991
+ export interface TieredWithProrationConfig {
4992
+ /**
4993
+ * Tiers for rating based on total usage quantities into the specified tier with
4994
+ * proration
4995
+ */
4996
+ tiers: Array<TieredWithProrationConfig.Tier>;
4997
+ }
4998
+
4999
+ export namespace TieredWithProrationConfig {
5000
+ /**
5001
+ * Configuration for a single tiered with proration tier
5002
+ */
5003
+ export interface Tier {
5004
+ /**
5005
+ * Inclusive tier starting value
5006
+ */
5007
+ tier_lower_bound: string;
5008
+
5009
+ /**
5010
+ * Amount per unit
5011
+ */
5012
+ unit_amount: string;
5013
+ }
5014
+ }
5015
+ }
5016
+
5017
+ export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice {
5018
+ /**
5019
+ * The cadence to bill for this price on.
5020
+ */
5021
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5022
+
5023
+ /**
5024
+ * Configuration for grouped_with_min_max_thresholds pricing
5025
+ */
5026
+ grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
5027
+
5028
+ /**
5029
+ * The id of the item the price will be associated with.
5030
+ */
5031
+ item_id: string;
5032
+
5033
+ /**
5034
+ * The pricing model type
5035
+ */
5036
+ model_type: 'grouped_with_min_max_thresholds';
5037
+
5038
+ /**
5039
+ * The name of the price.
5040
+ */
5041
+ name: string;
5042
+
5043
+ /**
5044
+ * The id of the billable metric for the price. Only needed if the price is
5045
+ * usage-based.
5046
+ */
5047
+ billable_metric_id?: string | null;
5048
+
5049
+ /**
5050
+ * If the Price represents a fixed cost, the price will be billed in-advance if
5051
+ * this is true, and in-arrears if this is false.
5052
+ */
5053
+ billed_in_advance?: boolean | null;
5054
+
5055
+ /**
5056
+ * For custom cadence: specifies the duration of the billing period in days or
5057
+ * months.
5058
+ */
5059
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
4261
5060
 
4262
- /**
4263
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
4264
- * discounts for this price.
4265
- */
4266
- discounts?: Array<SubscriptionsAPI.DiscountOverride> | null;
5061
+ /**
5062
+ * The per unit conversion rate of the price currency to the invoicing currency.
5063
+ */
5064
+ conversion_rate?: number | null;
4267
5065
 
4268
- /**
4269
- * The end date of the price interval. This is the date that the price will stop
4270
- * billing on the subscription. If null, billing will end when the phase or
4271
- * subscription ends.
4272
- */
4273
- end_date?: string | null;
5066
+ /**
5067
+ * The configuration for the rate of the price currency to the invoicing currency.
5068
+ */
5069
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
4274
5070
 
4275
- /**
4276
- * The external price id of the price to add to the subscription.
4277
- */
4278
- external_price_id?: string | null;
5071
+ /**
5072
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
5073
+ * price is billed.
5074
+ */
5075
+ currency?: string | null;
4279
5076
 
4280
- /**
4281
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
4282
- * amount for this price.
4283
- */
4284
- maximum_amount?: string | null;
5077
+ /**
5078
+ * For dimensional price: specifies a price group and dimension values
5079
+ */
5080
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
4285
5081
 
4286
- /**
4287
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
4288
- * amount for this price.
4289
- */
4290
- minimum_amount?: string | null;
5082
+ /**
5083
+ * An alias for the price.
5084
+ */
5085
+ external_price_id?: string | null;
4291
5086
 
4292
- /**
4293
- * The phase to add this price to.
4294
- */
4295
- plan_phase_order?: number | null;
5087
+ /**
5088
+ * If the Price represents a fixed cost, this represents the quantity of units
5089
+ * applied.
5090
+ */
5091
+ fixed_price_quantity?: number | null;
4296
5092
 
4297
- /**
4298
- * The definition of a new price to create and add to the subscription.
4299
- */
4300
- price?:
4301
- | SubscriptionsAPI.NewSubscriptionUnitPrice
4302
- | SubscriptionsAPI.NewSubscriptionPackagePrice
4303
- | SubscriptionsAPI.NewSubscriptionMatrixPrice
4304
- | SubscriptionsAPI.NewSubscriptionTieredPrice
4305
- | SubscriptionsAPI.NewSubscriptionTieredBPSPrice
4306
- | SubscriptionsAPI.NewSubscriptionBPSPrice
4307
- | SubscriptionsAPI.NewSubscriptionBulkBPSPrice
4308
- | SubscriptionsAPI.NewSubscriptionBulkPrice
4309
- | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
4310
- | SubscriptionsAPI.NewSubscriptionTieredPackagePrice
4311
- | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
4312
- | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
4313
- | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
4314
- | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice
4315
- | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
4316
- | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
4317
- | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
4318
- | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
4319
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
4320
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
4321
- | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
4322
- | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
4323
- | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
4324
- | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
4325
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
4326
- | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
4327
- | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
4328
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
4329
- | null;
5093
+ /**
5094
+ * The property used to group this price on an invoice
5095
+ */
5096
+ invoice_grouping_key?: string | null;
4330
5097
 
4331
- /**
4332
- * The id of the price to add to the subscription.
4333
- */
4334
- price_id?: string | null;
5098
+ /**
5099
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
5100
+ * If unspecified, a single invoice is produced per billing cycle.
5101
+ */
5102
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
4335
5103
 
4336
- /**
4337
- * The start date of the price interval. This is the date that the price will start
4338
- * billing on the subscription. If null, billing will start when the phase or
4339
- * subscription starts.
4340
- */
4341
- start_date?: string | null;
5104
+ /**
5105
+ * User-specified key/value pairs for the resource. Individual keys can be removed
5106
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
5107
+ * by setting `metadata` to `null`.
5108
+ */
5109
+ metadata?: { [key: string]: string | null } | null;
5110
+
5111
+ /**
5112
+ * A transient ID that can be used to reference this price when adding adjustments
5113
+ * in the same API call.
5114
+ */
5115
+ reference_id?: string | null;
5116
+ }
5117
+
5118
+ export namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice {
5119
+ /**
5120
+ * Configuration for grouped_with_min_max_thresholds pricing
5121
+ */
5122
+ export interface GroupedWithMinMaxThresholdsConfig {
5123
+ /**
5124
+ * The event property used to group before applying thresholds
5125
+ */
5126
+ grouping_key: string;
5127
+
5128
+ /**
5129
+ * The maximum amount to charge each group
5130
+ */
5131
+ maximum_charge: string;
5132
+
5133
+ /**
5134
+ * The minimum amount to charge each group, regardless of usage
5135
+ */
5136
+ minimum_charge: string;
5137
+
5138
+ /**
5139
+ * The base price charged per group
5140
+ */
5141
+ per_unit_rate: string;
5142
+ }
5143
+ }
4342
5144
  }
4343
5145
 
4344
5146
  export interface RemoveAdjustment {
@@ -4417,37 +5219,36 @@ export namespace SubscriptionCreateParams {
4417
5219
  minimum_amount?: string | null;
4418
5220
 
4419
5221
  /**
4420
- * The definition of a new price to create and add to the subscription.
5222
+ * New subscription price request body params.
4421
5223
  */
4422
5224
  price?:
4423
5225
  | SubscriptionsAPI.NewSubscriptionUnitPrice
4424
- | SubscriptionsAPI.NewSubscriptionPackagePrice
4425
- | SubscriptionsAPI.NewSubscriptionMatrixPrice
4426
5226
  | SubscriptionsAPI.NewSubscriptionTieredPrice
4427
- | SubscriptionsAPI.NewSubscriptionTieredBPSPrice
4428
- | SubscriptionsAPI.NewSubscriptionBPSPrice
4429
- | SubscriptionsAPI.NewSubscriptionBulkBPSPrice
4430
5227
  | SubscriptionsAPI.NewSubscriptionBulkPrice
5228
+ | SubscriptionsAPI.NewSubscriptionPackagePrice
5229
+ | SubscriptionsAPI.NewSubscriptionMatrixPrice
4431
5230
  | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
4432
5231
  | SubscriptionsAPI.NewSubscriptionTieredPackagePrice
4433
5232
  | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
4434
- | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
5233
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
5234
+ | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
4435
5235
  | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
4436
- | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice
5236
+ | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
5237
+ | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
5238
+ | ReplacePrice.NewSubscriptionTieredWithProrationPrice
4437
5239
  | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
4438
5240
  | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
4439
- | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
4440
5241
  | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
4441
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
4442
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
4443
- | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
4444
- | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
5242
+ | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
4445
5243
  | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
5244
+ | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
4446
5245
  | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
4447
5246
  | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
4448
- | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
4449
- | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
4450
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
5247
+ | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
5248
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
5249
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
5250
+ | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
5251
+ | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice
4451
5252
  | null;
4452
5253
 
4453
5254
  /**
@@ -4455,6 +5256,267 @@ export namespace SubscriptionCreateParams {
4455
5256
  */
4456
5257
  price_id?: string | null;
4457
5258
  }
5259
+
5260
+ export namespace ReplacePrice {
5261
+ export interface NewSubscriptionTieredWithProrationPrice {
5262
+ /**
5263
+ * The cadence to bill for this price on.
5264
+ */
5265
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5266
+
5267
+ /**
5268
+ * The id of the item the price will be associated with.
5269
+ */
5270
+ item_id: string;
5271
+
5272
+ /**
5273
+ * The pricing model type
5274
+ */
5275
+ model_type: 'tiered_with_proration';
5276
+
5277
+ /**
5278
+ * The name of the price.
5279
+ */
5280
+ name: string;
5281
+
5282
+ /**
5283
+ * Configuration for tiered_with_proration pricing
5284
+ */
5285
+ tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig;
5286
+
5287
+ /**
5288
+ * The id of the billable metric for the price. Only needed if the price is
5289
+ * usage-based.
5290
+ */
5291
+ billable_metric_id?: string | null;
5292
+
5293
+ /**
5294
+ * If the Price represents a fixed cost, the price will be billed in-advance if
5295
+ * this is true, and in-arrears if this is false.
5296
+ */
5297
+ billed_in_advance?: boolean | null;
5298
+
5299
+ /**
5300
+ * For custom cadence: specifies the duration of the billing period in days or
5301
+ * months.
5302
+ */
5303
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5304
+
5305
+ /**
5306
+ * The per unit conversion rate of the price currency to the invoicing currency.
5307
+ */
5308
+ conversion_rate?: number | null;
5309
+
5310
+ /**
5311
+ * The configuration for the rate of the price currency to the invoicing currency.
5312
+ */
5313
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
5314
+
5315
+ /**
5316
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
5317
+ * price is billed.
5318
+ */
5319
+ currency?: string | null;
5320
+
5321
+ /**
5322
+ * For dimensional price: specifies a price group and dimension values
5323
+ */
5324
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
5325
+
5326
+ /**
5327
+ * An alias for the price.
5328
+ */
5329
+ external_price_id?: string | null;
5330
+
5331
+ /**
5332
+ * If the Price represents a fixed cost, this represents the quantity of units
5333
+ * applied.
5334
+ */
5335
+ fixed_price_quantity?: number | null;
5336
+
5337
+ /**
5338
+ * The property used to group this price on an invoice
5339
+ */
5340
+ invoice_grouping_key?: string | null;
5341
+
5342
+ /**
5343
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
5344
+ * If unspecified, a single invoice is produced per billing cycle.
5345
+ */
5346
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5347
+
5348
+ /**
5349
+ * User-specified key/value pairs for the resource. Individual keys can be removed
5350
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
5351
+ * by setting `metadata` to `null`.
5352
+ */
5353
+ metadata?: { [key: string]: string | null } | null;
5354
+
5355
+ /**
5356
+ * A transient ID that can be used to reference this price when adding adjustments
5357
+ * in the same API call.
5358
+ */
5359
+ reference_id?: string | null;
5360
+ }
5361
+
5362
+ export namespace NewSubscriptionTieredWithProrationPrice {
5363
+ /**
5364
+ * Configuration for tiered_with_proration pricing
5365
+ */
5366
+ export interface TieredWithProrationConfig {
5367
+ /**
5368
+ * Tiers for rating based on total usage quantities into the specified tier with
5369
+ * proration
5370
+ */
5371
+ tiers: Array<TieredWithProrationConfig.Tier>;
5372
+ }
5373
+
5374
+ export namespace TieredWithProrationConfig {
5375
+ /**
5376
+ * Configuration for a single tiered with proration tier
5377
+ */
5378
+ export interface Tier {
5379
+ /**
5380
+ * Inclusive tier starting value
5381
+ */
5382
+ tier_lower_bound: string;
5383
+
5384
+ /**
5385
+ * Amount per unit
5386
+ */
5387
+ unit_amount: string;
5388
+ }
5389
+ }
5390
+ }
5391
+
5392
+ export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice {
5393
+ /**
5394
+ * The cadence to bill for this price on.
5395
+ */
5396
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5397
+
5398
+ /**
5399
+ * Configuration for grouped_with_min_max_thresholds pricing
5400
+ */
5401
+ grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
5402
+
5403
+ /**
5404
+ * The id of the item the price will be associated with.
5405
+ */
5406
+ item_id: string;
5407
+
5408
+ /**
5409
+ * The pricing model type
5410
+ */
5411
+ model_type: 'grouped_with_min_max_thresholds';
5412
+
5413
+ /**
5414
+ * The name of the price.
5415
+ */
5416
+ name: string;
5417
+
5418
+ /**
5419
+ * The id of the billable metric for the price. Only needed if the price is
5420
+ * usage-based.
5421
+ */
5422
+ billable_metric_id?: string | null;
5423
+
5424
+ /**
5425
+ * If the Price represents a fixed cost, the price will be billed in-advance if
5426
+ * this is true, and in-arrears if this is false.
5427
+ */
5428
+ billed_in_advance?: boolean | null;
5429
+
5430
+ /**
5431
+ * For custom cadence: specifies the duration of the billing period in days or
5432
+ * months.
5433
+ */
5434
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5435
+
5436
+ /**
5437
+ * The per unit conversion rate of the price currency to the invoicing currency.
5438
+ */
5439
+ conversion_rate?: number | null;
5440
+
5441
+ /**
5442
+ * The configuration for the rate of the price currency to the invoicing currency.
5443
+ */
5444
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
5445
+
5446
+ /**
5447
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
5448
+ * price is billed.
5449
+ */
5450
+ currency?: string | null;
5451
+
5452
+ /**
5453
+ * For dimensional price: specifies a price group and dimension values
5454
+ */
5455
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
5456
+
5457
+ /**
5458
+ * An alias for the price.
5459
+ */
5460
+ external_price_id?: string | null;
5461
+
5462
+ /**
5463
+ * If the Price represents a fixed cost, this represents the quantity of units
5464
+ * applied.
5465
+ */
5466
+ fixed_price_quantity?: number | null;
5467
+
5468
+ /**
5469
+ * The property used to group this price on an invoice
5470
+ */
5471
+ invoice_grouping_key?: string | null;
5472
+
5473
+ /**
5474
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
5475
+ * If unspecified, a single invoice is produced per billing cycle.
5476
+ */
5477
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5478
+
5479
+ /**
5480
+ * User-specified key/value pairs for the resource. Individual keys can be removed
5481
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
5482
+ * by setting `metadata` to `null`.
5483
+ */
5484
+ metadata?: { [key: string]: string | null } | null;
5485
+
5486
+ /**
5487
+ * A transient ID that can be used to reference this price when adding adjustments
5488
+ * in the same API call.
5489
+ */
5490
+ reference_id?: string | null;
5491
+ }
5492
+
5493
+ export namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice {
5494
+ /**
5495
+ * Configuration for grouped_with_min_max_thresholds pricing
5496
+ */
5497
+ export interface GroupedWithMinMaxThresholdsConfig {
5498
+ /**
5499
+ * The event property used to group before applying thresholds
5500
+ */
5501
+ grouping_key: string;
5502
+
5503
+ /**
5504
+ * The maximum amount to charge each group
5505
+ */
5506
+ maximum_charge: string;
5507
+
5508
+ /**
5509
+ * The minimum amount to charge each group, regardless of usage
5510
+ */
5511
+ minimum_charge: string;
5512
+
5513
+ /**
5514
+ * The base price charged per group
5515
+ */
5516
+ per_unit_rate: string;
5517
+ }
5518
+ }
5519
+ }
4458
5520
  }
4459
5521
 
4460
5522
  export interface SubscriptionUpdateParams {
@@ -4698,37 +5760,36 @@ export namespace SubscriptionPriceIntervalsParams {
4698
5760
  minimum_amount?: number | null;
4699
5761
 
4700
5762
  /**
4701
- * The definition of a new price to create and add to the subscription.
5763
+ * New floating price request body params.
4702
5764
  */
4703
5765
  price?:
4704
5766
  | Shared.NewFloatingUnitPrice
4705
- | Shared.NewFloatingPackagePrice
4706
- | Shared.NewFloatingMatrixPrice
4707
- | Shared.NewFloatingMatrixWithAllocationPrice
4708
5767
  | Shared.NewFloatingTieredPrice
4709
- | Shared.NewFloatingTieredBPSPrice
4710
- | Shared.NewFloatingBPSPrice
4711
- | Shared.NewFloatingBulkBPSPrice
4712
5768
  | Shared.NewFloatingBulkPrice
5769
+ | Shared.NewFloatingPackagePrice
5770
+ | Shared.NewFloatingMatrixPrice
4713
5771
  | Shared.NewFloatingThresholdTotalAmountPrice
4714
5772
  | Shared.NewFloatingTieredPackagePrice
4715
- | Shared.NewFloatingGroupedTieredPrice
4716
- | Shared.NewFloatingMaxGroupTieredPackagePrice
4717
5773
  | Shared.NewFloatingTieredWithMinimumPrice
4718
- | Shared.NewFloatingPackageWithAllocationPrice
5774
+ | Shared.NewFloatingGroupedTieredPrice
4719
5775
  | Shared.NewFloatingTieredPackageWithMinimumPrice
5776
+ | Shared.NewFloatingPackageWithAllocationPrice
4720
5777
  | Shared.NewFloatingUnitWithPercentPrice
5778
+ | Shared.NewFloatingMatrixWithAllocationPrice
4721
5779
  | Shared.NewFloatingTieredWithProrationPrice
4722
5780
  | Shared.NewFloatingUnitWithProrationPrice
4723
5781
  | Shared.NewFloatingGroupedAllocationPrice
5782
+ | Shared.NewFloatingBulkWithProrationPrice
4724
5783
  | Shared.NewFloatingGroupedWithProratedMinimumPrice
4725
5784
  | Shared.NewFloatingGroupedWithMeteredMinimumPrice
5785
+ | Add.NewFloatingGroupedWithMinMaxThresholdsPrice
4726
5786
  | Shared.NewFloatingMatrixWithDisplayNamePrice
4727
- | Shared.NewFloatingBulkWithProrationPrice
4728
5787
  | Shared.NewFloatingGroupedTieredPackagePrice
5788
+ | Shared.NewFloatingMaxGroupTieredPackagePrice
4729
5789
  | Shared.NewFloatingScalableMatrixWithUnitPricingPrice
4730
5790
  | Shared.NewFloatingScalableMatrixWithTieredPricingPrice
4731
5791
  | Shared.NewFloatingCumulativeGroupedBulkPrice
5792
+ | Shared.NewFloatingMinimumCompositePrice
4732
5793
  | null;
4733
5794
 
4734
5795
  /**
@@ -4788,26 +5849,155 @@ export namespace SubscriptionPriceIntervalsParams {
4788
5849
  */
4789
5850
  quantity: number;
4790
5851
  }
5852
+
5853
+ export interface NewFloatingGroupedWithMinMaxThresholdsPrice {
5854
+ /**
5855
+ * The cadence to bill for this price on.
5856
+ */
5857
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
5858
+
5859
+ /**
5860
+ * An ISO 4217 currency string for which this price is billed in.
5861
+ */
5862
+ currency: string;
5863
+
5864
+ /**
5865
+ * Configuration for grouped_with_min_max_thresholds pricing
5866
+ */
5867
+ grouped_with_min_max_thresholds_config: NewFloatingGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
5868
+
5869
+ /**
5870
+ * The id of the item the price will be associated with.
5871
+ */
5872
+ item_id: string;
5873
+
5874
+ /**
5875
+ * The pricing model type
5876
+ */
5877
+ model_type: 'grouped_with_min_max_thresholds';
5878
+
5879
+ /**
5880
+ * The name of the price.
5881
+ */
5882
+ name: string;
5883
+
5884
+ /**
5885
+ * The id of the billable metric for the price. Only needed if the price is
5886
+ * usage-based.
5887
+ */
5888
+ billable_metric_id?: string | null;
5889
+
5890
+ /**
5891
+ * If the Price represents a fixed cost, the price will be billed in-advance if
5892
+ * this is true, and in-arrears if this is false.
5893
+ */
5894
+ billed_in_advance?: boolean | null;
5895
+
5896
+ /**
5897
+ * For custom cadence: specifies the duration of the billing period in days or
5898
+ * months.
5899
+ */
5900
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5901
+
5902
+ /**
5903
+ * The per unit conversion rate of the price currency to the invoicing currency.
5904
+ */
5905
+ conversion_rate?: number | null;
5906
+
5907
+ /**
5908
+ * The configuration for the rate of the price currency to the invoicing currency.
5909
+ */
5910
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
5911
+
5912
+ /**
5913
+ * For dimensional price: specifies a price group and dimension values
5914
+ */
5915
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
5916
+
5917
+ /**
5918
+ * An alias for the price.
5919
+ */
5920
+ external_price_id?: string | null;
5921
+
5922
+ /**
5923
+ * If the Price represents a fixed cost, this represents the quantity of units
5924
+ * applied.
5925
+ */
5926
+ fixed_price_quantity?: number | null;
5927
+
5928
+ /**
5929
+ * The property used to group this price on an invoice
5930
+ */
5931
+ invoice_grouping_key?: string | null;
5932
+
5933
+ /**
5934
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
5935
+ * If unspecified, a single invoice is produced per billing cycle.
5936
+ */
5937
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5938
+
5939
+ /**
5940
+ * User-specified key/value pairs for the resource. Individual keys can be removed
5941
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
5942
+ * by setting `metadata` to `null`.
5943
+ */
5944
+ metadata?: { [key: string]: string | null } | null;
5945
+ }
5946
+
5947
+ export namespace NewFloatingGroupedWithMinMaxThresholdsPrice {
5948
+ /**
5949
+ * Configuration for grouped_with_min_max_thresholds pricing
5950
+ */
5951
+ export interface GroupedWithMinMaxThresholdsConfig {
5952
+ /**
5953
+ * The event property used to group before applying thresholds
5954
+ */
5955
+ grouping_key: string;
5956
+
5957
+ /**
5958
+ * The maximum amount to charge each group
5959
+ */
5960
+ maximum_charge: string;
5961
+
5962
+ /**
5963
+ * The minimum amount to charge each group, regardless of usage
5964
+ */
5965
+ minimum_charge: string;
5966
+
5967
+ /**
5968
+ * The base price charged per group
5969
+ */
5970
+ per_unit_rate: string;
5971
+ }
5972
+ }
4791
5973
  }
4792
5974
 
4793
5975
  export interface AddAdjustment {
5976
+ /**
5977
+ * The start date of the adjustment interval. This is the date that the adjustment
5978
+ * will start affecting prices on the subscription. The adjustment will apply to
5979
+ * invoice dates that overlap with this `start_date`. This `start_date` is treated
5980
+ * as inclusive for in-advance prices, and exclusive for in-arrears prices.
5981
+ */
5982
+ start_date: (string & {}) | Shared.BillingCycleRelativeDate;
5983
+
4794
5984
  /**
4795
5985
  * The definition of a new adjustment to create and add to the subscription.
4796
5986
  */
4797
- adjustment:
5987
+ adjustment?:
4798
5988
  | Shared.NewPercentageDiscount
4799
5989
  | Shared.NewUsageDiscount
4800
5990
  | Shared.NewAmountDiscount
4801
5991
  | Shared.NewMinimum
4802
- | Shared.NewMaximum;
5992
+ | Shared.NewMaximum
5993
+ | null;
4803
5994
 
4804
5995
  /**
4805
- * The start date of the adjustment interval. This is the date that the adjustment
4806
- * will start affecting prices on the subscription. The adjustment will apply to
4807
- * invoice dates that overlap with this `start_date`. This `start_date` is treated
4808
- * as inclusive for in-advance prices, and exclusive for in-arrears prices.
5996
+ * The ID of the adjustment to add to the subscription. Adjustment IDs can be
5997
+ * re-used from existing subscriptions or plans, but adjustments associated with
5998
+ * coupon redemptions cannot be re-used.
4809
5999
  */
4810
- start_date: (string & {}) | Shared.BillingCycleRelativeDate;
6000
+ adjustment_id?: string | null;
4811
6001
 
4812
6002
  /**
4813
6003
  * The end date of the adjustment interval. This is the date that the adjustment
@@ -5108,105 +6298,365 @@ export namespace SubscriptionSchedulePlanChangeParams {
5108
6298
  */
5109
6299
  end_date?: string | null;
5110
6300
 
5111
- /**
5112
- * The phase to add this adjustment to.
5113
- */
5114
- plan_phase_order?: number | null;
6301
+ /**
6302
+ * The phase to add this adjustment to.
6303
+ */
6304
+ plan_phase_order?: number | null;
6305
+
6306
+ /**
6307
+ * The start date of the adjustment interval. This is the date that the adjustment
6308
+ * will start affecting prices on the subscription. If null, the adjustment will
6309
+ * start when the phase or subscription starts.
6310
+ */
6311
+ start_date?: string | null;
6312
+ }
6313
+
6314
+ export interface AddPrice {
6315
+ /**
6316
+ * The definition of a new allocation price to create and add to the subscription.
6317
+ */
6318
+ allocation_price?: Shared.NewAllocationPrice | null;
6319
+
6320
+ /**
6321
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
6322
+ * discounts for this price.
6323
+ */
6324
+ discounts?: Array<SubscriptionsAPI.DiscountOverride> | null;
6325
+
6326
+ /**
6327
+ * The end date of the price interval. This is the date that the price will stop
6328
+ * billing on the subscription. If null, billing will end when the phase or
6329
+ * subscription ends.
6330
+ */
6331
+ end_date?: string | null;
6332
+
6333
+ /**
6334
+ * The external price id of the price to add to the subscription.
6335
+ */
6336
+ external_price_id?: string | null;
6337
+
6338
+ /**
6339
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
6340
+ * amount for this price.
6341
+ */
6342
+ maximum_amount?: string | null;
6343
+
6344
+ /**
6345
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
6346
+ * amount for this price.
6347
+ */
6348
+ minimum_amount?: string | null;
6349
+
6350
+ /**
6351
+ * The phase to add this price to.
6352
+ */
6353
+ plan_phase_order?: number | null;
6354
+
6355
+ /**
6356
+ * New subscription price request body params.
6357
+ */
6358
+ price?:
6359
+ | SubscriptionsAPI.NewSubscriptionUnitPrice
6360
+ | SubscriptionsAPI.NewSubscriptionTieredPrice
6361
+ | SubscriptionsAPI.NewSubscriptionBulkPrice
6362
+ | SubscriptionsAPI.NewSubscriptionPackagePrice
6363
+ | SubscriptionsAPI.NewSubscriptionMatrixPrice
6364
+ | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
6365
+ | SubscriptionsAPI.NewSubscriptionTieredPackagePrice
6366
+ | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
6367
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
6368
+ | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
6369
+ | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
6370
+ | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
6371
+ | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
6372
+ | AddPrice.NewSubscriptionTieredWithProrationPrice
6373
+ | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
6374
+ | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
6375
+ | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
6376
+ | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
6377
+ | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
6378
+ | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
6379
+ | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
6380
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
6381
+ | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
6382
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
6383
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
6384
+ | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
6385
+ | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice
6386
+ | null;
6387
+
6388
+ /**
6389
+ * The id of the price to add to the subscription.
6390
+ */
6391
+ price_id?: string | null;
6392
+
6393
+ /**
6394
+ * The start date of the price interval. This is the date that the price will start
6395
+ * billing on the subscription. If null, billing will start when the phase or
6396
+ * subscription starts.
6397
+ */
6398
+ start_date?: string | null;
6399
+ }
6400
+
6401
+ export namespace AddPrice {
6402
+ export interface NewSubscriptionTieredWithProrationPrice {
6403
+ /**
6404
+ * The cadence to bill for this price on.
6405
+ */
6406
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6407
+
6408
+ /**
6409
+ * The id of the item the price will be associated with.
6410
+ */
6411
+ item_id: string;
6412
+
6413
+ /**
6414
+ * The pricing model type
6415
+ */
6416
+ model_type: 'tiered_with_proration';
6417
+
6418
+ /**
6419
+ * The name of the price.
6420
+ */
6421
+ name: string;
6422
+
6423
+ /**
6424
+ * Configuration for tiered_with_proration pricing
6425
+ */
6426
+ tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig;
6427
+
6428
+ /**
6429
+ * The id of the billable metric for the price. Only needed if the price is
6430
+ * usage-based.
6431
+ */
6432
+ billable_metric_id?: string | null;
6433
+
6434
+ /**
6435
+ * If the Price represents a fixed cost, the price will be billed in-advance if
6436
+ * this is true, and in-arrears if this is false.
6437
+ */
6438
+ billed_in_advance?: boolean | null;
6439
+
6440
+ /**
6441
+ * For custom cadence: specifies the duration of the billing period in days or
6442
+ * months.
6443
+ */
6444
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6445
+
6446
+ /**
6447
+ * The per unit conversion rate of the price currency to the invoicing currency.
6448
+ */
6449
+ conversion_rate?: number | null;
6450
+
6451
+ /**
6452
+ * The configuration for the rate of the price currency to the invoicing currency.
6453
+ */
6454
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
6455
+
6456
+ /**
6457
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
6458
+ * price is billed.
6459
+ */
6460
+ currency?: string | null;
6461
+
6462
+ /**
6463
+ * For dimensional price: specifies a price group and dimension values
6464
+ */
6465
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
6466
+
6467
+ /**
6468
+ * An alias for the price.
6469
+ */
6470
+ external_price_id?: string | null;
6471
+
6472
+ /**
6473
+ * If the Price represents a fixed cost, this represents the quantity of units
6474
+ * applied.
6475
+ */
6476
+ fixed_price_quantity?: number | null;
6477
+
6478
+ /**
6479
+ * The property used to group this price on an invoice
6480
+ */
6481
+ invoice_grouping_key?: string | null;
6482
+
6483
+ /**
6484
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
6485
+ * If unspecified, a single invoice is produced per billing cycle.
6486
+ */
6487
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6488
+
6489
+ /**
6490
+ * User-specified key/value pairs for the resource. Individual keys can be removed
6491
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
6492
+ * by setting `metadata` to `null`.
6493
+ */
6494
+ metadata?: { [key: string]: string | null } | null;
6495
+
6496
+ /**
6497
+ * A transient ID that can be used to reference this price when adding adjustments
6498
+ * in the same API call.
6499
+ */
6500
+ reference_id?: string | null;
6501
+ }
6502
+
6503
+ export namespace NewSubscriptionTieredWithProrationPrice {
6504
+ /**
6505
+ * Configuration for tiered_with_proration pricing
6506
+ */
6507
+ export interface TieredWithProrationConfig {
6508
+ /**
6509
+ * Tiers for rating based on total usage quantities into the specified tier with
6510
+ * proration
6511
+ */
6512
+ tiers: Array<TieredWithProrationConfig.Tier>;
6513
+ }
6514
+
6515
+ export namespace TieredWithProrationConfig {
6516
+ /**
6517
+ * Configuration for a single tiered with proration tier
6518
+ */
6519
+ export interface Tier {
6520
+ /**
6521
+ * Inclusive tier starting value
6522
+ */
6523
+ tier_lower_bound: string;
6524
+
6525
+ /**
6526
+ * Amount per unit
6527
+ */
6528
+ unit_amount: string;
6529
+ }
6530
+ }
6531
+ }
6532
+
6533
+ export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice {
6534
+ /**
6535
+ * The cadence to bill for this price on.
6536
+ */
6537
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6538
+
6539
+ /**
6540
+ * Configuration for grouped_with_min_max_thresholds pricing
6541
+ */
6542
+ grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
6543
+
6544
+ /**
6545
+ * The id of the item the price will be associated with.
6546
+ */
6547
+ item_id: string;
6548
+
6549
+ /**
6550
+ * The pricing model type
6551
+ */
6552
+ model_type: 'grouped_with_min_max_thresholds';
6553
+
6554
+ /**
6555
+ * The name of the price.
6556
+ */
6557
+ name: string;
6558
+
6559
+ /**
6560
+ * The id of the billable metric for the price. Only needed if the price is
6561
+ * usage-based.
6562
+ */
6563
+ billable_metric_id?: string | null;
6564
+
6565
+ /**
6566
+ * If the Price represents a fixed cost, the price will be billed in-advance if
6567
+ * this is true, and in-arrears if this is false.
6568
+ */
6569
+ billed_in_advance?: boolean | null;
6570
+
6571
+ /**
6572
+ * For custom cadence: specifies the duration of the billing period in days or
6573
+ * months.
6574
+ */
6575
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5115
6576
 
5116
- /**
5117
- * The start date of the adjustment interval. This is the date that the adjustment
5118
- * will start affecting prices on the subscription. If null, the adjustment will
5119
- * start when the phase or subscription starts.
5120
- */
5121
- start_date?: string | null;
5122
- }
6577
+ /**
6578
+ * The per unit conversion rate of the price currency to the invoicing currency.
6579
+ */
6580
+ conversion_rate?: number | null;
5123
6581
 
5124
- export interface AddPrice {
5125
- /**
5126
- * The definition of a new allocation price to create and add to the subscription.
5127
- */
5128
- allocation_price?: Shared.NewAllocationPrice | null;
6582
+ /**
6583
+ * The configuration for the rate of the price currency to the invoicing currency.
6584
+ */
6585
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
5129
6586
 
5130
- /**
5131
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
5132
- * discounts for this price.
5133
- */
5134
- discounts?: Array<SubscriptionsAPI.DiscountOverride> | null;
6587
+ /**
6588
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
6589
+ * price is billed.
6590
+ */
6591
+ currency?: string | null;
5135
6592
 
5136
- /**
5137
- * The end date of the price interval. This is the date that the price will stop
5138
- * billing on the subscription. If null, billing will end when the phase or
5139
- * subscription ends.
5140
- */
5141
- end_date?: string | null;
6593
+ /**
6594
+ * For dimensional price: specifies a price group and dimension values
6595
+ */
6596
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
5142
6597
 
5143
- /**
5144
- * The external price id of the price to add to the subscription.
5145
- */
5146
- external_price_id?: string | null;
6598
+ /**
6599
+ * An alias for the price.
6600
+ */
6601
+ external_price_id?: string | null;
5147
6602
 
5148
- /**
5149
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
5150
- * amount for this price.
5151
- */
5152
- maximum_amount?: string | null;
6603
+ /**
6604
+ * If the Price represents a fixed cost, this represents the quantity of units
6605
+ * applied.
6606
+ */
6607
+ fixed_price_quantity?: number | null;
5153
6608
 
5154
- /**
5155
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
5156
- * amount for this price.
5157
- */
5158
- minimum_amount?: string | null;
6609
+ /**
6610
+ * The property used to group this price on an invoice
6611
+ */
6612
+ invoice_grouping_key?: string | null;
5159
6613
 
5160
- /**
5161
- * The phase to add this price to.
5162
- */
5163
- plan_phase_order?: number | null;
6614
+ /**
6615
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
6616
+ * If unspecified, a single invoice is produced per billing cycle.
6617
+ */
6618
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
5164
6619
 
5165
- /**
5166
- * The definition of a new price to create and add to the subscription.
5167
- */
5168
- price?:
5169
- | SubscriptionsAPI.NewSubscriptionUnitPrice
5170
- | SubscriptionsAPI.NewSubscriptionPackagePrice
5171
- | SubscriptionsAPI.NewSubscriptionMatrixPrice
5172
- | SubscriptionsAPI.NewSubscriptionTieredPrice
5173
- | SubscriptionsAPI.NewSubscriptionTieredBPSPrice
5174
- | SubscriptionsAPI.NewSubscriptionBPSPrice
5175
- | SubscriptionsAPI.NewSubscriptionBulkBPSPrice
5176
- | SubscriptionsAPI.NewSubscriptionBulkPrice
5177
- | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
5178
- | SubscriptionsAPI.NewSubscriptionTieredPackagePrice
5179
- | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
5180
- | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
5181
- | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
5182
- | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice
5183
- | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
5184
- | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
5185
- | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
5186
- | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
5187
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
5188
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
5189
- | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
5190
- | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
5191
- | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
5192
- | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
5193
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
5194
- | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
5195
- | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
5196
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
5197
- | null;
6620
+ /**
6621
+ * User-specified key/value pairs for the resource. Individual keys can be removed
6622
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
6623
+ * by setting `metadata` to `null`.
6624
+ */
6625
+ metadata?: { [key: string]: string | null } | null;
5198
6626
 
5199
- /**
5200
- * The id of the price to add to the subscription.
5201
- */
5202
- price_id?: string | null;
6627
+ /**
6628
+ * A transient ID that can be used to reference this price when adding adjustments
6629
+ * in the same API call.
6630
+ */
6631
+ reference_id?: string | null;
6632
+ }
5203
6633
 
5204
- /**
5205
- * The start date of the price interval. This is the date that the price will start
5206
- * billing on the subscription. If null, billing will start when the phase or
5207
- * subscription starts.
5208
- */
5209
- start_date?: string | null;
6634
+ export namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice {
6635
+ /**
6636
+ * Configuration for grouped_with_min_max_thresholds pricing
6637
+ */
6638
+ export interface GroupedWithMinMaxThresholdsConfig {
6639
+ /**
6640
+ * The event property used to group before applying thresholds
6641
+ */
6642
+ grouping_key: string;
6643
+
6644
+ /**
6645
+ * The maximum amount to charge each group
6646
+ */
6647
+ maximum_charge: string;
6648
+
6649
+ /**
6650
+ * The minimum amount to charge each group, regardless of usage
6651
+ */
6652
+ minimum_charge: string;
6653
+
6654
+ /**
6655
+ * The base price charged per group
6656
+ */
6657
+ per_unit_rate: string;
6658
+ }
6659
+ }
5210
6660
  }
5211
6661
 
5212
6662
  export interface RemoveAdjustment {
@@ -5285,37 +6735,36 @@ export namespace SubscriptionSchedulePlanChangeParams {
5285
6735
  minimum_amount?: string | null;
5286
6736
 
5287
6737
  /**
5288
- * The definition of a new price to create and add to the subscription.
6738
+ * New subscription price request body params.
5289
6739
  */
5290
6740
  price?:
5291
6741
  | SubscriptionsAPI.NewSubscriptionUnitPrice
5292
- | SubscriptionsAPI.NewSubscriptionPackagePrice
5293
- | SubscriptionsAPI.NewSubscriptionMatrixPrice
5294
6742
  | SubscriptionsAPI.NewSubscriptionTieredPrice
5295
- | SubscriptionsAPI.NewSubscriptionTieredBPSPrice
5296
- | SubscriptionsAPI.NewSubscriptionBPSPrice
5297
- | SubscriptionsAPI.NewSubscriptionBulkBPSPrice
5298
6743
  | SubscriptionsAPI.NewSubscriptionBulkPrice
6744
+ | SubscriptionsAPI.NewSubscriptionPackagePrice
6745
+ | SubscriptionsAPI.NewSubscriptionMatrixPrice
5299
6746
  | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
5300
6747
  | SubscriptionsAPI.NewSubscriptionTieredPackagePrice
5301
6748
  | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
5302
- | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
6749
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
6750
+ | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
5303
6751
  | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
5304
- | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice
6752
+ | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
6753
+ | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
6754
+ | ReplacePrice.NewSubscriptionTieredWithProrationPrice
5305
6755
  | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
5306
6756
  | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
5307
- | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
5308
6757
  | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
5309
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
5310
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
5311
- | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
5312
- | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
6758
+ | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
5313
6759
  | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
6760
+ | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
5314
6761
  | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
5315
6762
  | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
5316
- | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
5317
- | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
5318
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
6763
+ | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
6764
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
6765
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
6766
+ | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
6767
+ | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice
5319
6768
  | null;
5320
6769
 
5321
6770
  /**
@@ -5323,6 +6772,267 @@ export namespace SubscriptionSchedulePlanChangeParams {
5323
6772
  */
5324
6773
  price_id?: string | null;
5325
6774
  }
6775
+
6776
+ export namespace ReplacePrice {
6777
+ export interface NewSubscriptionTieredWithProrationPrice {
6778
+ /**
6779
+ * The cadence to bill for this price on.
6780
+ */
6781
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6782
+
6783
+ /**
6784
+ * The id of the item the price will be associated with.
6785
+ */
6786
+ item_id: string;
6787
+
6788
+ /**
6789
+ * The pricing model type
6790
+ */
6791
+ model_type: 'tiered_with_proration';
6792
+
6793
+ /**
6794
+ * The name of the price.
6795
+ */
6796
+ name: string;
6797
+
6798
+ /**
6799
+ * Configuration for tiered_with_proration pricing
6800
+ */
6801
+ tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig;
6802
+
6803
+ /**
6804
+ * The id of the billable metric for the price. Only needed if the price is
6805
+ * usage-based.
6806
+ */
6807
+ billable_metric_id?: string | null;
6808
+
6809
+ /**
6810
+ * If the Price represents a fixed cost, the price will be billed in-advance if
6811
+ * this is true, and in-arrears if this is false.
6812
+ */
6813
+ billed_in_advance?: boolean | null;
6814
+
6815
+ /**
6816
+ * For custom cadence: specifies the duration of the billing period in days or
6817
+ * months.
6818
+ */
6819
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6820
+
6821
+ /**
6822
+ * The per unit conversion rate of the price currency to the invoicing currency.
6823
+ */
6824
+ conversion_rate?: number | null;
6825
+
6826
+ /**
6827
+ * The configuration for the rate of the price currency to the invoicing currency.
6828
+ */
6829
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
6830
+
6831
+ /**
6832
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
6833
+ * price is billed.
6834
+ */
6835
+ currency?: string | null;
6836
+
6837
+ /**
6838
+ * For dimensional price: specifies a price group and dimension values
6839
+ */
6840
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
6841
+
6842
+ /**
6843
+ * An alias for the price.
6844
+ */
6845
+ external_price_id?: string | null;
6846
+
6847
+ /**
6848
+ * If the Price represents a fixed cost, this represents the quantity of units
6849
+ * applied.
6850
+ */
6851
+ fixed_price_quantity?: number | null;
6852
+
6853
+ /**
6854
+ * The property used to group this price on an invoice
6855
+ */
6856
+ invoice_grouping_key?: string | null;
6857
+
6858
+ /**
6859
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
6860
+ * If unspecified, a single invoice is produced per billing cycle.
6861
+ */
6862
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6863
+
6864
+ /**
6865
+ * User-specified key/value pairs for the resource. Individual keys can be removed
6866
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
6867
+ * by setting `metadata` to `null`.
6868
+ */
6869
+ metadata?: { [key: string]: string | null } | null;
6870
+
6871
+ /**
6872
+ * A transient ID that can be used to reference this price when adding adjustments
6873
+ * in the same API call.
6874
+ */
6875
+ reference_id?: string | null;
6876
+ }
6877
+
6878
+ export namespace NewSubscriptionTieredWithProrationPrice {
6879
+ /**
6880
+ * Configuration for tiered_with_proration pricing
6881
+ */
6882
+ export interface TieredWithProrationConfig {
6883
+ /**
6884
+ * Tiers for rating based on total usage quantities into the specified tier with
6885
+ * proration
6886
+ */
6887
+ tiers: Array<TieredWithProrationConfig.Tier>;
6888
+ }
6889
+
6890
+ export namespace TieredWithProrationConfig {
6891
+ /**
6892
+ * Configuration for a single tiered with proration tier
6893
+ */
6894
+ export interface Tier {
6895
+ /**
6896
+ * Inclusive tier starting value
6897
+ */
6898
+ tier_lower_bound: string;
6899
+
6900
+ /**
6901
+ * Amount per unit
6902
+ */
6903
+ unit_amount: string;
6904
+ }
6905
+ }
6906
+ }
6907
+
6908
+ export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice {
6909
+ /**
6910
+ * The cadence to bill for this price on.
6911
+ */
6912
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
6913
+
6914
+ /**
6915
+ * Configuration for grouped_with_min_max_thresholds pricing
6916
+ */
6917
+ grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
6918
+
6919
+ /**
6920
+ * The id of the item the price will be associated with.
6921
+ */
6922
+ item_id: string;
6923
+
6924
+ /**
6925
+ * The pricing model type
6926
+ */
6927
+ model_type: 'grouped_with_min_max_thresholds';
6928
+
6929
+ /**
6930
+ * The name of the price.
6931
+ */
6932
+ name: string;
6933
+
6934
+ /**
6935
+ * The id of the billable metric for the price. Only needed if the price is
6936
+ * usage-based.
6937
+ */
6938
+ billable_metric_id?: string | null;
6939
+
6940
+ /**
6941
+ * If the Price represents a fixed cost, the price will be billed in-advance if
6942
+ * this is true, and in-arrears if this is false.
6943
+ */
6944
+ billed_in_advance?: boolean | null;
6945
+
6946
+ /**
6947
+ * For custom cadence: specifies the duration of the billing period in days or
6948
+ * months.
6949
+ */
6950
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6951
+
6952
+ /**
6953
+ * The per unit conversion rate of the price currency to the invoicing currency.
6954
+ */
6955
+ conversion_rate?: number | null;
6956
+
6957
+ /**
6958
+ * The configuration for the rate of the price currency to the invoicing currency.
6959
+ */
6960
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
6961
+
6962
+ /**
6963
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
6964
+ * price is billed.
6965
+ */
6966
+ currency?: string | null;
6967
+
6968
+ /**
6969
+ * For dimensional price: specifies a price group and dimension values
6970
+ */
6971
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
6972
+
6973
+ /**
6974
+ * An alias for the price.
6975
+ */
6976
+ external_price_id?: string | null;
6977
+
6978
+ /**
6979
+ * If the Price represents a fixed cost, this represents the quantity of units
6980
+ * applied.
6981
+ */
6982
+ fixed_price_quantity?: number | null;
6983
+
6984
+ /**
6985
+ * The property used to group this price on an invoice
6986
+ */
6987
+ invoice_grouping_key?: string | null;
6988
+
6989
+ /**
6990
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
6991
+ * If unspecified, a single invoice is produced per billing cycle.
6992
+ */
6993
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
6994
+
6995
+ /**
6996
+ * User-specified key/value pairs for the resource. Individual keys can be removed
6997
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
6998
+ * by setting `metadata` to `null`.
6999
+ */
7000
+ metadata?: { [key: string]: string | null } | null;
7001
+
7002
+ /**
7003
+ * A transient ID that can be used to reference this price when adding adjustments
7004
+ * in the same API call.
7005
+ */
7006
+ reference_id?: string | null;
7007
+ }
7008
+
7009
+ export namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice {
7010
+ /**
7011
+ * Configuration for grouped_with_min_max_thresholds pricing
7012
+ */
7013
+ export interface GroupedWithMinMaxThresholdsConfig {
7014
+ /**
7015
+ * The event property used to group before applying thresholds
7016
+ */
7017
+ grouping_key: string;
7018
+
7019
+ /**
7020
+ * The maximum amount to charge each group
7021
+ */
7022
+ maximum_charge: string;
7023
+
7024
+ /**
7025
+ * The minimum amount to charge each group, regardless of usage
7026
+ */
7027
+ minimum_charge: string;
7028
+
7029
+ /**
7030
+ * The base price charged per group
7031
+ */
7032
+ per_unit_rate: string;
7033
+ }
7034
+ }
7035
+ }
5326
7036
  }
5327
7037
 
5328
7038
  export interface SubscriptionTriggerPhaseParams {
@@ -5397,8 +7107,6 @@ Subscriptions.SubscriptionFetchScheduleResponsesPage = SubscriptionFetchSchedule
5397
7107
  export declare namespace Subscriptions {
5398
7108
  export {
5399
7109
  type DiscountOverride as DiscountOverride,
5400
- type NewSubscriptionBPSPrice as NewSubscriptionBPSPrice,
5401
- type NewSubscriptionBulkBPSPrice as NewSubscriptionBulkBPSPrice,
5402
7110
  type NewSubscriptionBulkPrice as NewSubscriptionBulkPrice,
5403
7111
  type NewSubscriptionBulkWithProrationPrice as NewSubscriptionBulkWithProrationPrice,
5404
7112
  type NewSubscriptionCumulativeGroupedBulkPrice as NewSubscriptionCumulativeGroupedBulkPrice,
@@ -5411,13 +7119,12 @@ export declare namespace Subscriptions {
5411
7119
  type NewSubscriptionMatrixWithAllocationPrice as NewSubscriptionMatrixWithAllocationPrice,
5412
7120
  type NewSubscriptionMatrixWithDisplayNamePrice as NewSubscriptionMatrixWithDisplayNamePrice,
5413
7121
  type NewSubscriptionMaxGroupTieredPackagePrice as NewSubscriptionMaxGroupTieredPackagePrice,
7122
+ type NewSubscriptionMinimumCompositePrice as NewSubscriptionMinimumCompositePrice,
5414
7123
  type NewSubscriptionPackagePrice as NewSubscriptionPackagePrice,
5415
7124
  type NewSubscriptionPackageWithAllocationPrice as NewSubscriptionPackageWithAllocationPrice,
5416
7125
  type NewSubscriptionScalableMatrixWithTieredPricingPrice as NewSubscriptionScalableMatrixWithTieredPricingPrice,
5417
7126
  type NewSubscriptionScalableMatrixWithUnitPricingPrice as NewSubscriptionScalableMatrixWithUnitPricingPrice,
5418
7127
  type NewSubscriptionThresholdTotalAmountPrice as NewSubscriptionThresholdTotalAmountPrice,
5419
- type NewSubscriptionTierWithProrationPrice as NewSubscriptionTierWithProrationPrice,
5420
- type NewSubscriptionTieredBPSPrice as NewSubscriptionTieredBPSPrice,
5421
7128
  type NewSubscriptionTieredPackagePrice as NewSubscriptionTieredPackagePrice,
5422
7129
  type NewSubscriptionTieredPackageWithMinimumPrice as NewSubscriptionTieredPackageWithMinimumPrice,
5423
7130
  type NewSubscriptionTieredPrice as NewSubscriptionTieredPrice,