orb-billing 2.11.2 → 3.0.1

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 (166) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +7 -15
  3. package/_shims/node-runtime.d.ts.map +1 -1
  4. package/_shims/node-runtime.js +2 -3
  5. package/_shims/node-runtime.js.map +1 -1
  6. package/_shims/node-runtime.mjs +1 -1
  7. package/_shims/node-runtime.mjs.map +1 -1
  8. package/core.d.ts +4 -2
  9. package/core.d.ts.map +1 -1
  10. package/core.js +17 -4
  11. package/core.js.map +1 -1
  12. package/core.mjs +18 -5
  13. package/core.mjs.map +1 -1
  14. package/index.d.mts +7 -3
  15. package/index.d.ts +7 -3
  16. package/index.d.ts.map +1 -1
  17. package/index.js +4 -2
  18. package/index.js.map +1 -1
  19. package/index.mjs +4 -2
  20. package/index.mjs.map +1 -1
  21. package/package.json +2 -3
  22. package/resources/alerts.d.ts +1 -1
  23. package/resources/alerts.d.ts.map +1 -1
  24. package/resources/alerts.js.map +1 -1
  25. package/resources/alerts.mjs.map +1 -1
  26. package/resources/coupons/coupons.d.ts +25 -8
  27. package/resources/coupons/coupons.d.ts.map +1 -1
  28. package/resources/coupons/coupons.js.map +1 -1
  29. package/resources/coupons/coupons.mjs.map +1 -1
  30. package/resources/coupons/subscriptions.d.ts +1 -1
  31. package/resources/coupons/subscriptions.d.ts.map +1 -1
  32. package/resources/coupons/subscriptions.js.map +1 -1
  33. package/resources/coupons/subscriptions.mjs.map +1 -1
  34. package/resources/credit-notes.d.ts +1 -1
  35. package/resources/credit-notes.d.ts.map +1 -1
  36. package/resources/credit-notes.js.map +1 -1
  37. package/resources/credit-notes.mjs.map +1 -1
  38. package/resources/customers/balance-transactions.d.ts +1 -1
  39. package/resources/customers/balance-transactions.d.ts.map +1 -1
  40. package/resources/customers/balance-transactions.js.map +1 -1
  41. package/resources/customers/balance-transactions.mjs.map +1 -1
  42. package/resources/customers/costs.d.ts +1 -1
  43. package/resources/customers/costs.d.ts.map +1 -1
  44. package/resources/customers/costs.js.map +1 -1
  45. package/resources/customers/costs.mjs.map +1 -1
  46. package/resources/customers/credits/credits.d.ts +11 -1
  47. package/resources/customers/credits/credits.d.ts.map +1 -1
  48. package/resources/customers/credits/credits.js.map +1 -1
  49. package/resources/customers/credits/credits.mjs.map +1 -1
  50. package/resources/customers/credits/ledger.d.ts +1 -1
  51. package/resources/customers/credits/ledger.d.ts.map +1 -1
  52. package/resources/customers/credits/ledger.js.map +1 -1
  53. package/resources/customers/credits/ledger.mjs.map +1 -1
  54. package/resources/customers/credits/top-ups.d.ts +1 -1
  55. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  56. package/resources/customers/credits/top-ups.js.map +1 -1
  57. package/resources/customers/credits/top-ups.mjs.map +1 -1
  58. package/resources/customers/customers.d.ts +1 -1
  59. package/resources/customers/customers.d.ts.map +1 -1
  60. package/resources/customers/customers.js.map +1 -1
  61. package/resources/customers/customers.mjs.map +1 -1
  62. package/resources/customers/usage.d.ts +1 -1
  63. package/resources/customers/usage.d.ts.map +1 -1
  64. package/resources/customers/usage.js.map +1 -1
  65. package/resources/customers/usage.mjs.map +1 -1
  66. package/resources/events/backfills.d.ts +1 -1
  67. package/resources/events/backfills.d.ts.map +1 -1
  68. package/resources/events/backfills.js.map +1 -1
  69. package/resources/events/backfills.mjs.map +1 -1
  70. package/resources/events/events.d.ts +1 -1
  71. package/resources/events/events.d.ts.map +1 -1
  72. package/resources/events/events.js.map +1 -1
  73. package/resources/events/events.mjs.map +1 -1
  74. package/resources/index.d.ts +2 -2
  75. package/resources/index.d.ts.map +1 -1
  76. package/resources/index.js.map +1 -1
  77. package/resources/index.mjs.map +1 -1
  78. package/resources/invoice-line-items.d.ts +1 -1
  79. package/resources/invoice-line-items.d.ts.map +1 -1
  80. package/resources/invoice-line-items.js.map +1 -1
  81. package/resources/invoice-line-items.mjs.map +1 -1
  82. package/resources/invoices.d.ts +31 -1
  83. package/resources/invoices.d.ts.map +1 -1
  84. package/resources/invoices.js +6 -0
  85. package/resources/invoices.js.map +1 -1
  86. package/resources/invoices.mjs +6 -0
  87. package/resources/invoices.mjs.map +1 -1
  88. package/resources/items.d.ts +6 -10
  89. package/resources/items.d.ts.map +1 -1
  90. package/resources/items.js +4 -4
  91. package/resources/items.js.map +1 -1
  92. package/resources/items.mjs +4 -4
  93. package/resources/items.mjs.map +1 -1
  94. package/resources/metrics.d.ts +1 -1
  95. package/resources/metrics.d.ts.map +1 -1
  96. package/resources/metrics.js.map +1 -1
  97. package/resources/metrics.mjs.map +1 -1
  98. package/resources/plans/external-plan-id.d.ts +8 -12
  99. package/resources/plans/external-plan-id.d.ts.map +1 -1
  100. package/resources/plans/external-plan-id.js +4 -0
  101. package/resources/plans/external-plan-id.js.map +1 -1
  102. package/resources/plans/external-plan-id.mjs +4 -0
  103. package/resources/plans/external-plan-id.mjs.map +1 -1
  104. package/resources/plans/plans.d.ts +112 -17
  105. package/resources/plans/plans.d.ts.map +1 -1
  106. package/resources/plans/plans.js.map +1 -1
  107. package/resources/plans/plans.mjs.map +1 -1
  108. package/resources/prices/external-price-id.d.ts +20 -1
  109. package/resources/prices/external-price-id.d.ts.map +1 -1
  110. package/resources/prices/external-price-id.js +9 -0
  111. package/resources/prices/external-price-id.js.map +1 -1
  112. package/resources/prices/external-price-id.mjs +9 -0
  113. package/resources/prices/external-price-id.mjs.map +1 -1
  114. package/resources/prices/index.d.ts +2 -2
  115. package/resources/prices/index.d.ts.map +1 -1
  116. package/resources/prices/index.js.map +1 -1
  117. package/resources/prices/index.mjs.map +1 -1
  118. package/resources/prices/prices.d.ts +288 -37
  119. package/resources/prices/prices.d.ts.map +1 -1
  120. package/resources/prices/prices.js +6 -0
  121. package/resources/prices/prices.js.map +1 -1
  122. package/resources/prices/prices.mjs +6 -0
  123. package/resources/prices/prices.mjs.map +1 -1
  124. package/resources/subscriptions.d.ts +247 -19
  125. package/resources/subscriptions.d.ts.map +1 -1
  126. package/resources/subscriptions.js.map +1 -1
  127. package/resources/subscriptions.mjs.map +1 -1
  128. package/resources/top-level.d.ts +1 -1
  129. package/resources/top-level.d.ts.map +1 -1
  130. package/resources/top-level.js.map +1 -1
  131. package/resources/top-level.mjs.map +1 -1
  132. package/src/_shims/node-runtime.ts +1 -3
  133. package/src/core.ts +27 -8
  134. package/src/index.ts +8 -3
  135. package/src/resources/alerts.ts +1 -1
  136. package/src/resources/coupons/coupons.ts +25 -8
  137. package/src/resources/coupons/subscriptions.ts +1 -1
  138. package/src/resources/credit-notes.ts +1 -1
  139. package/src/resources/customers/balance-transactions.ts +1 -1
  140. package/src/resources/customers/costs.ts +1 -1
  141. package/src/resources/customers/credits/credits.ts +15 -1
  142. package/src/resources/customers/credits/ledger.ts +1 -1
  143. package/src/resources/customers/credits/top-ups.ts +1 -1
  144. package/src/resources/customers/customers.ts +1 -1
  145. package/src/resources/customers/usage.ts +1 -1
  146. package/src/resources/events/backfills.ts +1 -1
  147. package/src/resources/events/events.ts +1 -1
  148. package/src/resources/index.ts +2 -0
  149. package/src/resources/invoice-line-items.ts +1 -1
  150. package/src/resources/invoices.ts +50 -1
  151. package/src/resources/items.ts +14 -10
  152. package/src/resources/metrics.ts +1 -1
  153. package/src/resources/plans/external-plan-id.ts +8 -12
  154. package/src/resources/plans/plans.ts +128 -17
  155. package/src/resources/prices/external-price-id.ts +38 -1
  156. package/src/resources/prices/index.ts +2 -1
  157. package/src/resources/prices/prices.ts +336 -37
  158. package/src/resources/subscriptions.ts +295 -19
  159. package/src/resources/top-level.ts +1 -1
  160. package/src/version.ts +1 -1
  161. package/version.d.ts +1 -1
  162. package/version.d.ts.map +1 -1
  163. package/version.js +1 -1
  164. package/version.js.map +1 -1
  165. package/version.mjs +1 -1
  166. package/version.mjs.map +1 -1
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as Core from '../core';
4
3
  import { APIResource } from '../resource';
5
4
  import { isRequestOptions } from '../core';
5
+ import * as Core from '../core';
6
6
  import * as SubscriptionsAPI from './subscriptions';
7
7
  import * as Shared from './shared';
8
8
  import * as CustomersAPI from './customers/customers';
@@ -842,6 +842,21 @@ export class Subscriptions extends APIResource {
842
842
  * interval. This will only apply to this price interval, not any other price
843
843
  * intervals on the subscription.
844
844
  *
845
+ * ## Adjustment intervals
846
+ *
847
+ * An adjustment interval represents the time period that a particular adjustment
848
+ * (a discount, minimum, or maximum) applies to the prices on a subscription.
849
+ * Adjustment intervals can be added to a subscription by specifying them in the
850
+ * `add_adjustments` array, or modified via the `edit_adjustments` array. When
851
+ * creating an adjustment interval, you'll need to provide the definition of the
852
+ * new adjustment (the type of adjustment, and which prices it applies to), as well
853
+ * as the start and end dates for the adjustment interval. The start and end dates
854
+ * of an existing adjustment interval can be edited via the `edit_adjustments`
855
+ * field (just like price intervals). (To "change" the amount of a discount,
856
+ * minimum, or maximum, then, you'll need to end the existing interval, and create
857
+ * a new adjustment interval with the new amount and a start date that matches the
858
+ * end date of the previous interval.)
859
+ *
845
860
  * ## Editing price intervals
846
861
  *
847
862
  * Price intervals can be adjusted by specifying edits to make in the `edit` array.
@@ -3575,10 +3590,20 @@ export interface SubscriptionPriceIntervalsParams {
3575
3590
  */
3576
3591
  add?: Array<SubscriptionPriceIntervalsParams.Add>;
3577
3592
 
3593
+ /**
3594
+ * A list of adjustments to add to the subscription.
3595
+ */
3596
+ add_adjustments?: Array<SubscriptionPriceIntervalsParams.AddAdjustment>;
3597
+
3578
3598
  /**
3579
3599
  * A list of price intervals to edit on the subscription.
3580
3600
  */
3581
3601
  edit?: Array<SubscriptionPriceIntervalsParams.Edit>;
3602
+
3603
+ /**
3604
+ * A list of adjustments to edit on the subscription.
3605
+ */
3606
+ edit_adjustments?: Array<SubscriptionPriceIntervalsParams.EditAdjustment>;
3582
3607
  }
3583
3608
 
3584
3609
  export namespace SubscriptionPriceIntervalsParams {
@@ -3589,6 +3614,11 @@ export namespace SubscriptionPriceIntervalsParams {
3589
3614
  */
3590
3615
  start_date: (string & {}) | Shared.BillingCycleRelativeDate;
3591
3616
 
3617
+ /**
3618
+ * The definition of a new allocation price to create and add to the subscription.
3619
+ */
3620
+ allocation_price?: Add.AllocationPrice | null;
3621
+
3592
3622
  /**
3593
3623
  * A list of discounts to initialize on the price interval.
3594
3624
  */
@@ -3657,6 +3687,33 @@ export namespace SubscriptionPriceIntervalsParams {
3657
3687
  }
3658
3688
 
3659
3689
  export namespace Add {
3690
+ /**
3691
+ * The definition of a new allocation price to create and add to the subscription.
3692
+ */
3693
+ export interface AllocationPrice {
3694
+ /**
3695
+ * An amount of the currency to allocate to the customer at the specified cadence.
3696
+ */
3697
+ amount: string;
3698
+
3699
+ /**
3700
+ * The cadence at which to allocate the amount to the customer.
3701
+ */
3702
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';
3703
+
3704
+ /**
3705
+ * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
3706
+ * this price.
3707
+ */
3708
+ currency: string;
3709
+
3710
+ /**
3711
+ * Whether the allocated amount should expire at the end of the cadence or roll
3712
+ * over to the next period.
3713
+ */
3714
+ expires_at_end_of_cadence: boolean;
3715
+ }
3716
+
3660
3717
  export interface AmountDiscountCreationParams {
3661
3718
  /**
3662
3719
  * Only available if discount_type is `amount`.
@@ -3702,7 +3759,7 @@ export namespace SubscriptionPriceIntervalsParams {
3702
3759
  /**
3703
3760
  * The cadence to bill for this price on.
3704
3761
  */
3705
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3762
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3706
3763
 
3707
3764
  /**
3708
3765
  * An ISO 4217 currency string for which this price is billed in.
@@ -3755,6 +3812,13 @@ export namespace SubscriptionPriceIntervalsParams {
3755
3812
  * The property used to group this price on an invoice
3756
3813
  */
3757
3814
  invoice_grouping_key?: string | null;
3815
+
3816
+ /**
3817
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3818
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3819
+ * by setting `metadata` to `null`.
3820
+ */
3821
+ metadata?: Record<string, string | null> | null;
3758
3822
  }
3759
3823
 
3760
3824
  export namespace NewFloatingUnitPrice {
@@ -3770,7 +3834,7 @@ export namespace SubscriptionPriceIntervalsParams {
3770
3834
  /**
3771
3835
  * The cadence to bill for this price on.
3772
3836
  */
3773
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3837
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3774
3838
 
3775
3839
  /**
3776
3840
  * An ISO 4217 currency string for which this price is billed in.
@@ -3823,6 +3887,13 @@ export namespace SubscriptionPriceIntervalsParams {
3823
3887
  * The property used to group this price on an invoice
3824
3888
  */
3825
3889
  invoice_grouping_key?: string | null;
3890
+
3891
+ /**
3892
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3893
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3894
+ * by setting `metadata` to `null`.
3895
+ */
3896
+ metadata?: Record<string, string | null> | null;
3826
3897
  }
3827
3898
 
3828
3899
  export namespace NewFloatingPackagePrice {
@@ -3844,7 +3915,7 @@ export namespace SubscriptionPriceIntervalsParams {
3844
3915
  /**
3845
3916
  * The cadence to bill for this price on.
3846
3917
  */
3847
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3918
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3848
3919
 
3849
3920
  /**
3850
3921
  * An ISO 4217 currency string for which this price is billed in.
@@ -3897,6 +3968,13 @@ export namespace SubscriptionPriceIntervalsParams {
3897
3968
  * The property used to group this price on an invoice
3898
3969
  */
3899
3970
  invoice_grouping_key?: string | null;
3971
+
3972
+ /**
3973
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3974
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3975
+ * by setting `metadata` to `null`.
3976
+ */
3977
+ metadata?: Record<string, string | null> | null;
3900
3978
  }
3901
3979
 
3902
3980
  export namespace NewFloatingMatrixPrice {
@@ -3938,7 +4016,7 @@ export namespace SubscriptionPriceIntervalsParams {
3938
4016
  /**
3939
4017
  * The cadence to bill for this price on.
3940
4018
  */
3941
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4019
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3942
4020
 
3943
4021
  /**
3944
4022
  * An ISO 4217 currency string for which this price is billed in.
@@ -3991,6 +4069,13 @@ export namespace SubscriptionPriceIntervalsParams {
3991
4069
  * The property used to group this price on an invoice
3992
4070
  */
3993
4071
  invoice_grouping_key?: string | null;
4072
+
4073
+ /**
4074
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4075
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4076
+ * by setting `metadata` to `null`.
4077
+ */
4078
+ metadata?: Record<string, string | null> | null;
3994
4079
  }
3995
4080
 
3996
4081
  export namespace NewFloatingMatrixWithAllocationPrice {
@@ -4037,7 +4122,7 @@ export namespace SubscriptionPriceIntervalsParams {
4037
4122
  /**
4038
4123
  * The cadence to bill for this price on.
4039
4124
  */
4040
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4125
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4041
4126
 
4042
4127
  /**
4043
4128
  * An ISO 4217 currency string for which this price is billed in.
@@ -4090,6 +4175,13 @@ export namespace SubscriptionPriceIntervalsParams {
4090
4175
  * The property used to group this price on an invoice
4091
4176
  */
4092
4177
  invoice_grouping_key?: string | null;
4178
+
4179
+ /**
4180
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4181
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4182
+ * by setting `metadata` to `null`.
4183
+ */
4184
+ metadata?: Record<string, string | null> | null;
4093
4185
  }
4094
4186
 
4095
4187
  export namespace NewFloatingTieredPrice {
@@ -4124,7 +4216,7 @@ export namespace SubscriptionPriceIntervalsParams {
4124
4216
  /**
4125
4217
  * The cadence to bill for this price on.
4126
4218
  */
4127
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4219
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4128
4220
 
4129
4221
  /**
4130
4222
  * An ISO 4217 currency string for which this price is billed in.
@@ -4177,6 +4269,13 @@ export namespace SubscriptionPriceIntervalsParams {
4177
4269
  * The property used to group this price on an invoice
4178
4270
  */
4179
4271
  invoice_grouping_key?: string | null;
4272
+
4273
+ /**
4274
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4275
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4276
+ * by setting `metadata` to `null`.
4277
+ */
4278
+ metadata?: Record<string, string | null> | null;
4180
4279
  }
4181
4280
 
4182
4281
  export namespace NewFloatingTieredBpsPrice {
@@ -4219,7 +4318,7 @@ export namespace SubscriptionPriceIntervalsParams {
4219
4318
  /**
4220
4319
  * The cadence to bill for this price on.
4221
4320
  */
4222
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4321
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4223
4322
 
4224
4323
  /**
4225
4324
  * An ISO 4217 currency string for which this price is billed in.
@@ -4270,6 +4369,13 @@ export namespace SubscriptionPriceIntervalsParams {
4270
4369
  * The property used to group this price on an invoice
4271
4370
  */
4272
4371
  invoice_grouping_key?: string | null;
4372
+
4373
+ /**
4374
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4375
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4376
+ * by setting `metadata` to `null`.
4377
+ */
4378
+ metadata?: Record<string, string | null> | null;
4273
4379
  }
4274
4380
 
4275
4381
  export namespace NewFloatingBpsPrice {
@@ -4292,7 +4398,7 @@ export namespace SubscriptionPriceIntervalsParams {
4292
4398
  /**
4293
4399
  * The cadence to bill for this price on.
4294
4400
  */
4295
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4401
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4296
4402
 
4297
4403
  /**
4298
4404
  * An ISO 4217 currency string for which this price is billed in.
@@ -4343,6 +4449,13 @@ export namespace SubscriptionPriceIntervalsParams {
4343
4449
  * The property used to group this price on an invoice
4344
4450
  */
4345
4451
  invoice_grouping_key?: string | null;
4452
+
4453
+ /**
4454
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4455
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4456
+ * by setting `metadata` to `null`.
4457
+ */
4458
+ metadata?: Record<string, string | null> | null;
4346
4459
  }
4347
4460
 
4348
4461
  export namespace NewFloatingBulkBpsPrice {
@@ -4380,7 +4493,7 @@ export namespace SubscriptionPriceIntervalsParams {
4380
4493
  /**
4381
4494
  * The cadence to bill for this price on.
4382
4495
  */
4383
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4496
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4384
4497
 
4385
4498
  /**
4386
4499
  * An ISO 4217 currency string for which this price is billed in.
@@ -4431,6 +4544,13 @@ export namespace SubscriptionPriceIntervalsParams {
4431
4544
  * The property used to group this price on an invoice
4432
4545
  */
4433
4546
  invoice_grouping_key?: string | null;
4547
+
4548
+ /**
4549
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4550
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4551
+ * by setting `metadata` to `null`.
4552
+ */
4553
+ metadata?: Record<string, string | null> | null;
4434
4554
  }
4435
4555
 
4436
4556
  export namespace NewFloatingBulkPrice {
@@ -4460,7 +4580,7 @@ export namespace SubscriptionPriceIntervalsParams {
4460
4580
  /**
4461
4581
  * The cadence to bill for this price on.
4462
4582
  */
4463
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4583
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4464
4584
 
4465
4585
  /**
4466
4586
  * An ISO 4217 currency string for which this price is billed in.
@@ -4513,13 +4633,20 @@ export namespace SubscriptionPriceIntervalsParams {
4513
4633
  * The property used to group this price on an invoice
4514
4634
  */
4515
4635
  invoice_grouping_key?: string | null;
4636
+
4637
+ /**
4638
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4639
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4640
+ * by setting `metadata` to `null`.
4641
+ */
4642
+ metadata?: Record<string, string | null> | null;
4516
4643
  }
4517
4644
 
4518
4645
  export interface NewFloatingTieredPackagePrice {
4519
4646
  /**
4520
4647
  * The cadence to bill for this price on.
4521
4648
  */
4522
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4649
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4523
4650
 
4524
4651
  /**
4525
4652
  * An ISO 4217 currency string for which this price is billed in.
@@ -4572,13 +4699,20 @@ export namespace SubscriptionPriceIntervalsParams {
4572
4699
  * The property used to group this price on an invoice
4573
4700
  */
4574
4701
  invoice_grouping_key?: string | null;
4702
+
4703
+ /**
4704
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4705
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4706
+ * by setting `metadata` to `null`.
4707
+ */
4708
+ metadata?: Record<string, string | null> | null;
4575
4709
  }
4576
4710
 
4577
4711
  export interface NewFloatingGroupedTieredPrice {
4578
4712
  /**
4579
4713
  * The cadence to bill for this price on.
4580
4714
  */
4581
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4715
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4582
4716
 
4583
4717
  /**
4584
4718
  * An ISO 4217 currency string for which this price is billed in.
@@ -4631,13 +4765,20 @@ export namespace SubscriptionPriceIntervalsParams {
4631
4765
  * The property used to group this price on an invoice
4632
4766
  */
4633
4767
  invoice_grouping_key?: string | null;
4768
+
4769
+ /**
4770
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4771
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4772
+ * by setting `metadata` to `null`.
4773
+ */
4774
+ metadata?: Record<string, string | null> | null;
4634
4775
  }
4635
4776
 
4636
4777
  export interface NewFloatingTieredWithMinimumPrice {
4637
4778
  /**
4638
4779
  * The cadence to bill for this price on.
4639
4780
  */
4640
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4781
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4641
4782
 
4642
4783
  /**
4643
4784
  * An ISO 4217 currency string for which this price is billed in.
@@ -4690,13 +4831,20 @@ export namespace SubscriptionPriceIntervalsParams {
4690
4831
  * The property used to group this price on an invoice
4691
4832
  */
4692
4833
  invoice_grouping_key?: string | null;
4834
+
4835
+ /**
4836
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4837
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4838
+ * by setting `metadata` to `null`.
4839
+ */
4840
+ metadata?: Record<string, string | null> | null;
4693
4841
  }
4694
4842
 
4695
4843
  export interface NewFloatingPackageWithAllocationPrice {
4696
4844
  /**
4697
4845
  * The cadence to bill for this price on.
4698
4846
  */
4699
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4847
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4700
4848
 
4701
4849
  /**
4702
4850
  * An ISO 4217 currency string for which this price is billed in.
@@ -4749,13 +4897,20 @@ export namespace SubscriptionPriceIntervalsParams {
4749
4897
  * The property used to group this price on an invoice
4750
4898
  */
4751
4899
  invoice_grouping_key?: string | null;
4900
+
4901
+ /**
4902
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4903
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4904
+ * by setting `metadata` to `null`.
4905
+ */
4906
+ metadata?: Record<string, string | null> | null;
4752
4907
  }
4753
4908
 
4754
4909
  export interface NewFloatingTieredPackageWithMinimumPrice {
4755
4910
  /**
4756
4911
  * The cadence to bill for this price on.
4757
4912
  */
4758
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4913
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4759
4914
 
4760
4915
  /**
4761
4916
  * An ISO 4217 currency string for which this price is billed in.
@@ -4808,13 +4963,20 @@ export namespace SubscriptionPriceIntervalsParams {
4808
4963
  * The property used to group this price on an invoice
4809
4964
  */
4810
4965
  invoice_grouping_key?: string | null;
4966
+
4967
+ /**
4968
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4969
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4970
+ * by setting `metadata` to `null`.
4971
+ */
4972
+ metadata?: Record<string, string | null> | null;
4811
4973
  }
4812
4974
 
4813
4975
  export interface NewFloatingUnitWithPercentPrice {
4814
4976
  /**
4815
4977
  * The cadence to bill for this price on.
4816
4978
  */
4817
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4979
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4818
4980
 
4819
4981
  /**
4820
4982
  * An ISO 4217 currency string for which this price is billed in.
@@ -4867,13 +5029,20 @@ export namespace SubscriptionPriceIntervalsParams {
4867
5029
  * The property used to group this price on an invoice
4868
5030
  */
4869
5031
  invoice_grouping_key?: string | null;
5032
+
5033
+ /**
5034
+ * User-specified key/value pairs for the resource. Individual keys can be removed
5035
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
5036
+ * by setting `metadata` to `null`.
5037
+ */
5038
+ metadata?: Record<string, string | null> | null;
4870
5039
  }
4871
5040
 
4872
5041
  export interface NewFloatingTieredWithProrationPrice {
4873
5042
  /**
4874
5043
  * The cadence to bill for this price on.
4875
5044
  */
4876
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
5045
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4877
5046
 
4878
5047
  /**
4879
5048
  * An ISO 4217 currency string for which this price is billed in.
@@ -4926,13 +5095,20 @@ export namespace SubscriptionPriceIntervalsParams {
4926
5095
  * The property used to group this price on an invoice
4927
5096
  */
4928
5097
  invoice_grouping_key?: string | null;
5098
+
5099
+ /**
5100
+ * User-specified key/value pairs for the resource. Individual keys can be removed
5101
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
5102
+ * by setting `metadata` to `null`.
5103
+ */
5104
+ metadata?: Record<string, string | null> | null;
4929
5105
  }
4930
5106
 
4931
5107
  export interface NewFloatingUnitWithProrationPrice {
4932
5108
  /**
4933
5109
  * The cadence to bill for this price on.
4934
5110
  */
4935
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
5111
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4936
5112
 
4937
5113
  /**
4938
5114
  * An ISO 4217 currency string for which this price is billed in.
@@ -4985,6 +5161,87 @@ export namespace SubscriptionPriceIntervalsParams {
4985
5161
  * The property used to group this price on an invoice
4986
5162
  */
4987
5163
  invoice_grouping_key?: string | null;
5164
+
5165
+ /**
5166
+ * User-specified key/value pairs for the resource. Individual keys can be removed
5167
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
5168
+ * by setting `metadata` to `null`.
5169
+ */
5170
+ metadata?: Record<string, string | null> | null;
5171
+ }
5172
+ }
5173
+
5174
+ export interface AddAdjustment {
5175
+ /**
5176
+ * The definition of a new adjustment to create and add to the subscription.
5177
+ */
5178
+ adjustment:
5179
+ | AddAdjustment.NewPercentageDiscount
5180
+ | AddAdjustment.NewAmountDiscount
5181
+ | AddAdjustment.NewMinimum
5182
+ | AddAdjustment.NewMaximum;
5183
+
5184
+ /**
5185
+ * The start date of the adjustment interval. This is the date that the adjustment
5186
+ * will start affecting prices on the subscription.
5187
+ */
5188
+ start_date: (string & {}) | Shared.BillingCycleRelativeDate;
5189
+
5190
+ /**
5191
+ * The end date of the adjustment interval. This is the date that the adjustment
5192
+ * will stop affecting prices on the subscription.
5193
+ */
5194
+ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
5195
+ }
5196
+
5197
+ export namespace AddAdjustment {
5198
+ export interface NewPercentageDiscount {
5199
+ adjustment_type: 'percentage_discount';
5200
+
5201
+ /**
5202
+ * The set of price IDs to which this adjustment applies.
5203
+ */
5204
+ applies_to_price_ids: Array<string>;
5205
+
5206
+ percentage_discount: number;
5207
+ }
5208
+
5209
+ export interface NewAmountDiscount {
5210
+ adjustment_type: 'amount_discount';
5211
+
5212
+ amount_discount: string;
5213
+
5214
+ /**
5215
+ * The set of price IDs to which this adjustment applies.
5216
+ */
5217
+ applies_to_price_ids: Array<string>;
5218
+ }
5219
+
5220
+ export interface NewMinimum {
5221
+ adjustment_type: 'minimum';
5222
+
5223
+ /**
5224
+ * The set of price IDs to which this adjustment applies.
5225
+ */
5226
+ applies_to_price_ids: Array<string>;
5227
+
5228
+ /**
5229
+ * The item ID that revenue from this minimum will be attributed to.
5230
+ */
5231
+ item_id: string;
5232
+
5233
+ minimum_amount: string;
5234
+ }
5235
+
5236
+ export interface NewMaximum {
5237
+ adjustment_type: 'maximum';
5238
+
5239
+ /**
5240
+ * The set of price IDs to which this adjustment applies.
5241
+ */
5242
+ applies_to_price_ids: Array<string>;
5243
+
5244
+ maximum_amount: string;
4988
5245
  }
4989
5246
  }
4990
5247
 
@@ -5034,6 +5291,25 @@ export namespace SubscriptionPriceIntervalsParams {
5034
5291
  quantity: number;
5035
5292
  }
5036
5293
  }
5294
+
5295
+ export interface EditAdjustment {
5296
+ /**
5297
+ * The id of the adjustment interval to edit.
5298
+ */
5299
+ adjustment_interval_id: string;
5300
+
5301
+ /**
5302
+ * The updated end date of this adjustment interval. If not specified, the start
5303
+ * date will not be updated.
5304
+ */
5305
+ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
5306
+
5307
+ /**
5308
+ * The updated start date of this adjustment interval. If not specified, the start
5309
+ * date will not be updated.
5310
+ */
5311
+ start_date?: (string & {}) | Shared.BillingCycleRelativeDate;
5312
+ }
5037
5313
  }
5038
5314
 
5039
5315
  export interface SubscriptionSchedulePlanChangeParams {
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as Core from '../core';
4
3
  import { APIResource } from '../resource';
4
+ import * as Core from '../core';
5
5
  import * as TopLevelAPI from './top-level';
6
6
 
7
7
  export class TopLevel extends APIResource {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.11.2'; // x-release-please-version
1
+ export const VERSION = '3.0.1'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.11.2";
1
+ export declare const VERSION = "3.0.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.11.2'; // x-release-please-version
4
+ exports.VERSION = '3.0.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.11.2'; // x-release-please-version
1
+ export const VERSION = '3.0.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}