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,5 +1,5 @@
1
- import * as Core from "../core.js";
2
1
  import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
3
  import * as SubscriptionsAPI from "./subscriptions.js";
4
4
  import * as Shared from "./shared.js";
5
5
  import * as CustomersAPI from "./customers/customers.js";
@@ -735,6 +735,21 @@ export declare class Subscriptions extends APIResource {
735
735
  * interval. This will only apply to this price interval, not any other price
736
736
  * intervals on the subscription.
737
737
  *
738
+ * ## Adjustment intervals
739
+ *
740
+ * An adjustment interval represents the time period that a particular adjustment
741
+ * (a discount, minimum, or maximum) applies to the prices on a subscription.
742
+ * Adjustment intervals can be added to a subscription by specifying them in the
743
+ * `add_adjustments` array, or modified via the `edit_adjustments` array. When
744
+ * creating an adjustment interval, you'll need to provide the definition of the
745
+ * new adjustment (the type of adjustment, and which prices it applies to), as well
746
+ * as the start and end dates for the adjustment interval. The start and end dates
747
+ * of an existing adjustment interval can be edited via the `edit_adjustments`
748
+ * field (just like price intervals). (To "change" the amount of a discount,
749
+ * minimum, or maximum, then, you'll need to end the existing interval, and create
750
+ * a new adjustment interval with the new amount and a start date that matches the
751
+ * end date of the previous interval.)
752
+ *
738
753
  * ## Editing price intervals
739
754
  *
740
755
  * Price intervals can be adjusted by specifying edits to make in the `edit` array.
@@ -2960,10 +2975,18 @@ export interface SubscriptionPriceIntervalsParams {
2960
2975
  * A list of price intervals to add to the subscription.
2961
2976
  */
2962
2977
  add?: Array<SubscriptionPriceIntervalsParams.Add>;
2978
+ /**
2979
+ * A list of adjustments to add to the subscription.
2980
+ */
2981
+ add_adjustments?: Array<SubscriptionPriceIntervalsParams.AddAdjustment>;
2963
2982
  /**
2964
2983
  * A list of price intervals to edit on the subscription.
2965
2984
  */
2966
2985
  edit?: Array<SubscriptionPriceIntervalsParams.Edit>;
2986
+ /**
2987
+ * A list of adjustments to edit on the subscription.
2988
+ */
2989
+ edit_adjustments?: Array<SubscriptionPriceIntervalsParams.EditAdjustment>;
2967
2990
  }
2968
2991
  export declare namespace SubscriptionPriceIntervalsParams {
2969
2992
  interface Add {
@@ -2972,6 +2995,10 @@ export declare namespace SubscriptionPriceIntervalsParams {
2972
2995
  * billing on the subscription.
2973
2996
  */
2974
2997
  start_date: (string & {}) | Shared.BillingCycleRelativeDate;
2998
+ /**
2999
+ * The definition of a new allocation price to create and add to the subscription.
3000
+ */
3001
+ allocation_price?: Add.AllocationPrice | null;
2975
3002
  /**
2976
3003
  * A list of discounts to initialize on the price interval.
2977
3004
  */
@@ -3009,6 +3036,29 @@ export declare namespace SubscriptionPriceIntervalsParams {
3009
3036
  price_id?: string | null;
3010
3037
  }
3011
3038
  namespace Add {
3039
+ /**
3040
+ * The definition of a new allocation price to create and add to the subscription.
3041
+ */
3042
+ interface AllocationPrice {
3043
+ /**
3044
+ * An amount of the currency to allocate to the customer at the specified cadence.
3045
+ */
3046
+ amount: string;
3047
+ /**
3048
+ * The cadence at which to allocate the amount to the customer.
3049
+ */
3050
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';
3051
+ /**
3052
+ * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
3053
+ * this price.
3054
+ */
3055
+ currency: string;
3056
+ /**
3057
+ * Whether the allocated amount should expire at the end of the cadence or roll
3058
+ * over to the next period.
3059
+ */
3060
+ expires_at_end_of_cadence: boolean;
3061
+ }
3012
3062
  interface AmountDiscountCreationParams {
3013
3063
  /**
3014
3064
  * Only available if discount_type is `amount`.
@@ -3046,7 +3096,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3046
3096
  /**
3047
3097
  * The cadence to bill for this price on.
3048
3098
  */
3049
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3099
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3050
3100
  /**
3051
3101
  * An ISO 4217 currency string for which this price is billed in.
3052
3102
  */
@@ -3088,6 +3138,12 @@ export declare namespace SubscriptionPriceIntervalsParams {
3088
3138
  * The property used to group this price on an invoice
3089
3139
  */
3090
3140
  invoice_grouping_key?: string | null;
3141
+ /**
3142
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3143
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3144
+ * by setting `metadata` to `null`.
3145
+ */
3146
+ metadata?: Record<string, string | null> | null;
3091
3147
  }
3092
3148
  namespace NewFloatingUnitPrice {
3093
3149
  interface UnitConfig {
@@ -3101,7 +3157,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3101
3157
  /**
3102
3158
  * The cadence to bill for this price on.
3103
3159
  */
3104
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3160
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3105
3161
  /**
3106
3162
  * An ISO 4217 currency string for which this price is billed in.
3107
3163
  */
@@ -3143,6 +3199,12 @@ export declare namespace SubscriptionPriceIntervalsParams {
3143
3199
  * The property used to group this price on an invoice
3144
3200
  */
3145
3201
  invoice_grouping_key?: string | null;
3202
+ /**
3203
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3204
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3205
+ * by setting `metadata` to `null`.
3206
+ */
3207
+ metadata?: Record<string, string | null> | null;
3146
3208
  }
3147
3209
  namespace NewFloatingPackagePrice {
3148
3210
  interface PackageConfig {
@@ -3161,7 +3223,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3161
3223
  /**
3162
3224
  * The cadence to bill for this price on.
3163
3225
  */
3164
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3226
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3165
3227
  /**
3166
3228
  * An ISO 4217 currency string for which this price is billed in.
3167
3229
  */
@@ -3203,6 +3265,12 @@ export declare namespace SubscriptionPriceIntervalsParams {
3203
3265
  * The property used to group this price on an invoice
3204
3266
  */
3205
3267
  invoice_grouping_key?: string | null;
3268
+ /**
3269
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3270
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3271
+ * by setting `metadata` to `null`.
3272
+ */
3273
+ metadata?: Record<string, string | null> | null;
3206
3274
  }
3207
3275
  namespace NewFloatingMatrixPrice {
3208
3276
  interface MatrixConfig {
@@ -3238,7 +3306,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3238
3306
  /**
3239
3307
  * The cadence to bill for this price on.
3240
3308
  */
3241
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3309
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3242
3310
  /**
3243
3311
  * An ISO 4217 currency string for which this price is billed in.
3244
3312
  */
@@ -3280,6 +3348,12 @@ export declare namespace SubscriptionPriceIntervalsParams {
3280
3348
  * The property used to group this price on an invoice
3281
3349
  */
3282
3350
  invoice_grouping_key?: string | null;
3351
+ /**
3352
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3353
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3354
+ * by setting `metadata` to `null`.
3355
+ */
3356
+ metadata?: Record<string, string | null> | null;
3283
3357
  }
3284
3358
  namespace NewFloatingMatrixWithAllocationPrice {
3285
3359
  interface MatrixWithAllocationConfig {
@@ -3319,7 +3393,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3319
3393
  /**
3320
3394
  * The cadence to bill for this price on.
3321
3395
  */
3322
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3396
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3323
3397
  /**
3324
3398
  * An ISO 4217 currency string for which this price is billed in.
3325
3399
  */
@@ -3361,6 +3435,12 @@ export declare namespace SubscriptionPriceIntervalsParams {
3361
3435
  * The property used to group this price on an invoice
3362
3436
  */
3363
3437
  invoice_grouping_key?: string | null;
3438
+ /**
3439
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3440
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3441
+ * by setting `metadata` to `null`.
3442
+ */
3443
+ metadata?: Record<string, string | null> | null;
3364
3444
  }
3365
3445
  namespace NewFloatingTieredPrice {
3366
3446
  interface TieredConfig {
@@ -3390,7 +3470,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3390
3470
  /**
3391
3471
  * The cadence to bill for this price on.
3392
3472
  */
3393
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3473
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3394
3474
  /**
3395
3475
  * An ISO 4217 currency string for which this price is billed in.
3396
3476
  */
@@ -3432,6 +3512,12 @@ export declare namespace SubscriptionPriceIntervalsParams {
3432
3512
  * The property used to group this price on an invoice
3433
3513
  */
3434
3514
  invoice_grouping_key?: string | null;
3515
+ /**
3516
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3517
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3518
+ * by setting `metadata` to `null`.
3519
+ */
3520
+ metadata?: Record<string, string | null> | null;
3435
3521
  }
3436
3522
  namespace NewFloatingTieredBpsPrice {
3437
3523
  interface TieredBpsConfig {
@@ -3467,7 +3553,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3467
3553
  /**
3468
3554
  * The cadence to bill for this price on.
3469
3555
  */
3470
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3556
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3471
3557
  /**
3472
3558
  * An ISO 4217 currency string for which this price is billed in.
3473
3559
  */
@@ -3508,6 +3594,12 @@ export declare namespace SubscriptionPriceIntervalsParams {
3508
3594
  * The property used to group this price on an invoice
3509
3595
  */
3510
3596
  invoice_grouping_key?: string | null;
3597
+ /**
3598
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3599
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3600
+ * by setting `metadata` to `null`.
3601
+ */
3602
+ metadata?: Record<string, string | null> | null;
3511
3603
  }
3512
3604
  namespace NewFloatingBpsPrice {
3513
3605
  interface BpsConfig {
@@ -3526,7 +3618,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3526
3618
  /**
3527
3619
  * The cadence to bill for this price on.
3528
3620
  */
3529
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3621
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3530
3622
  /**
3531
3623
  * An ISO 4217 currency string for which this price is billed in.
3532
3624
  */
@@ -3567,6 +3659,12 @@ export declare namespace SubscriptionPriceIntervalsParams {
3567
3659
  * The property used to group this price on an invoice
3568
3660
  */
3569
3661
  invoice_grouping_key?: string | null;
3662
+ /**
3663
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3664
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3665
+ * by setting `metadata` to `null`.
3666
+ */
3667
+ metadata?: Record<string, string | null> | null;
3570
3668
  }
3571
3669
  namespace NewFloatingBulkBpsPrice {
3572
3670
  interface BulkBpsConfig {
@@ -3598,7 +3696,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3598
3696
  /**
3599
3697
  * The cadence to bill for this price on.
3600
3698
  */
3601
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3699
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3602
3700
  /**
3603
3701
  * An ISO 4217 currency string for which this price is billed in.
3604
3702
  */
@@ -3639,6 +3737,12 @@ export declare namespace SubscriptionPriceIntervalsParams {
3639
3737
  * The property used to group this price on an invoice
3640
3738
  */
3641
3739
  invoice_grouping_key?: string | null;
3740
+ /**
3741
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3742
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3743
+ * by setting `metadata` to `null`.
3744
+ */
3745
+ metadata?: Record<string, string | null> | null;
3642
3746
  }
3643
3747
  namespace NewFloatingBulkPrice {
3644
3748
  interface BulkConfig {
@@ -3664,7 +3768,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
3664
3768
  /**
3665
3769
  * The cadence to bill for this price on.
3666
3770
  */
3667
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3771
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3668
3772
  /**
3669
3773
  * An ISO 4217 currency string for which this price is billed in.
3670
3774
  */
@@ -3706,12 +3810,18 @@ export declare namespace SubscriptionPriceIntervalsParams {
3706
3810
  * The property used to group this price on an invoice
3707
3811
  */
3708
3812
  invoice_grouping_key?: string | null;
3813
+ /**
3814
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3815
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3816
+ * by setting `metadata` to `null`.
3817
+ */
3818
+ metadata?: Record<string, string | null> | null;
3709
3819
  }
3710
3820
  interface NewFloatingTieredPackagePrice {
3711
3821
  /**
3712
3822
  * The cadence to bill for this price on.
3713
3823
  */
3714
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3824
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3715
3825
  /**
3716
3826
  * An ISO 4217 currency string for which this price is billed in.
3717
3827
  */
@@ -3753,12 +3863,18 @@ export declare namespace SubscriptionPriceIntervalsParams {
3753
3863
  * The property used to group this price on an invoice
3754
3864
  */
3755
3865
  invoice_grouping_key?: string | null;
3866
+ /**
3867
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3868
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3869
+ * by setting `metadata` to `null`.
3870
+ */
3871
+ metadata?: Record<string, string | null> | null;
3756
3872
  }
3757
3873
  interface NewFloatingGroupedTieredPrice {
3758
3874
  /**
3759
3875
  * The cadence to bill for this price on.
3760
3876
  */
3761
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3877
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3762
3878
  /**
3763
3879
  * An ISO 4217 currency string for which this price is billed in.
3764
3880
  */
@@ -3800,12 +3916,18 @@ export declare namespace SubscriptionPriceIntervalsParams {
3800
3916
  * The property used to group this price on an invoice
3801
3917
  */
3802
3918
  invoice_grouping_key?: string | null;
3919
+ /**
3920
+ * User-specified key/value pairs for the resource. Individual keys can be removed
3921
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
3922
+ * by setting `metadata` to `null`.
3923
+ */
3924
+ metadata?: Record<string, string | null> | null;
3803
3925
  }
3804
3926
  interface NewFloatingTieredWithMinimumPrice {
3805
3927
  /**
3806
3928
  * The cadence to bill for this price on.
3807
3929
  */
3808
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3930
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3809
3931
  /**
3810
3932
  * An ISO 4217 currency string for which this price is billed in.
3811
3933
  */
@@ -3847,12 +3969,18 @@ export declare namespace SubscriptionPriceIntervalsParams {
3847
3969
  * The property used to group this price on an invoice
3848
3970
  */
3849
3971
  invoice_grouping_key?: string | null;
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;
3850
3978
  }
3851
3979
  interface NewFloatingPackageWithAllocationPrice {
3852
3980
  /**
3853
3981
  * The cadence to bill for this price on.
3854
3982
  */
3855
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
3983
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3856
3984
  /**
3857
3985
  * An ISO 4217 currency string for which this price is billed in.
3858
3986
  */
@@ -3894,12 +4022,18 @@ export declare namespace SubscriptionPriceIntervalsParams {
3894
4022
  * The property used to group this price on an invoice
3895
4023
  */
3896
4024
  invoice_grouping_key?: string | null;
4025
+ /**
4026
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4027
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4028
+ * by setting `metadata` to `null`.
4029
+ */
4030
+ metadata?: Record<string, string | null> | null;
3897
4031
  }
3898
4032
  interface NewFloatingTieredPackageWithMinimumPrice {
3899
4033
  /**
3900
4034
  * The cadence to bill for this price on.
3901
4035
  */
3902
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4036
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3903
4037
  /**
3904
4038
  * An ISO 4217 currency string for which this price is billed in.
3905
4039
  */
@@ -3941,12 +4075,18 @@ export declare namespace SubscriptionPriceIntervalsParams {
3941
4075
  * The property used to group this price on an invoice
3942
4076
  */
3943
4077
  invoice_grouping_key?: string | null;
4078
+ /**
4079
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4080
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4081
+ * by setting `metadata` to `null`.
4082
+ */
4083
+ metadata?: Record<string, string | null> | null;
3944
4084
  }
3945
4085
  interface NewFloatingUnitWithPercentPrice {
3946
4086
  /**
3947
4087
  * The cadence to bill for this price on.
3948
4088
  */
3949
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4089
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3950
4090
  /**
3951
4091
  * An ISO 4217 currency string for which this price is billed in.
3952
4092
  */
@@ -3988,12 +4128,18 @@ export declare namespace SubscriptionPriceIntervalsParams {
3988
4128
  * The property used to group this price on an invoice
3989
4129
  */
3990
4130
  invoice_grouping_key?: string | null;
4131
+ /**
4132
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4133
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4134
+ * by setting `metadata` to `null`.
4135
+ */
4136
+ metadata?: Record<string, string | null> | null;
3991
4137
  }
3992
4138
  interface NewFloatingTieredWithProrationPrice {
3993
4139
  /**
3994
4140
  * The cadence to bill for this price on.
3995
4141
  */
3996
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4142
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
3997
4143
  /**
3998
4144
  * An ISO 4217 currency string for which this price is billed in.
3999
4145
  */
@@ -4035,12 +4181,18 @@ export declare namespace SubscriptionPriceIntervalsParams {
4035
4181
  * The property used to group this price on an invoice
4036
4182
  */
4037
4183
  invoice_grouping_key?: string | null;
4184
+ /**
4185
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4186
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4187
+ * by setting `metadata` to `null`.
4188
+ */
4189
+ metadata?: Record<string, string | null> | null;
4038
4190
  }
4039
4191
  interface NewFloatingUnitWithProrationPrice {
4040
4192
  /**
4041
4193
  * The cadence to bill for this price on.
4042
4194
  */
4043
- cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
4195
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';
4044
4196
  /**
4045
4197
  * An ISO 4217 currency string for which this price is billed in.
4046
4198
  */
@@ -4082,6 +4234,66 @@ export declare namespace SubscriptionPriceIntervalsParams {
4082
4234
  * The property used to group this price on an invoice
4083
4235
  */
4084
4236
  invoice_grouping_key?: string | null;
4237
+ /**
4238
+ * User-specified key/value pairs for the resource. Individual keys can be removed
4239
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
4240
+ * by setting `metadata` to `null`.
4241
+ */
4242
+ metadata?: Record<string, string | null> | null;
4243
+ }
4244
+ }
4245
+ interface AddAdjustment {
4246
+ /**
4247
+ * The definition of a new adjustment to create and add to the subscription.
4248
+ */
4249
+ adjustment: AddAdjustment.NewPercentageDiscount | AddAdjustment.NewAmountDiscount | AddAdjustment.NewMinimum | AddAdjustment.NewMaximum;
4250
+ /**
4251
+ * The start date of the adjustment interval. This is the date that the adjustment
4252
+ * will start affecting prices on the subscription.
4253
+ */
4254
+ start_date: (string & {}) | Shared.BillingCycleRelativeDate;
4255
+ /**
4256
+ * The end date of the adjustment interval. This is the date that the adjustment
4257
+ * will stop affecting prices on the subscription.
4258
+ */
4259
+ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
4260
+ }
4261
+ namespace AddAdjustment {
4262
+ interface NewPercentageDiscount {
4263
+ adjustment_type: 'percentage_discount';
4264
+ /**
4265
+ * The set of price IDs to which this adjustment applies.
4266
+ */
4267
+ applies_to_price_ids: Array<string>;
4268
+ percentage_discount: number;
4269
+ }
4270
+ interface NewAmountDiscount {
4271
+ adjustment_type: 'amount_discount';
4272
+ amount_discount: string;
4273
+ /**
4274
+ * The set of price IDs to which this adjustment applies.
4275
+ */
4276
+ applies_to_price_ids: Array<string>;
4277
+ }
4278
+ interface NewMinimum {
4279
+ adjustment_type: 'minimum';
4280
+ /**
4281
+ * The set of price IDs to which this adjustment applies.
4282
+ */
4283
+ applies_to_price_ids: Array<string>;
4284
+ /**
4285
+ * The item ID that revenue from this minimum will be attributed to.
4286
+ */
4287
+ item_id: string;
4288
+ minimum_amount: string;
4289
+ }
4290
+ interface NewMaximum {
4291
+ adjustment_type: 'maximum';
4292
+ /**
4293
+ * The set of price IDs to which this adjustment applies.
4294
+ */
4295
+ applies_to_price_ids: Array<string>;
4296
+ maximum_amount: string;
4085
4297
  }
4086
4298
  }
4087
4299
  interface Edit {
@@ -4124,6 +4336,22 @@ export declare namespace SubscriptionPriceIntervalsParams {
4124
4336
  quantity: number;
4125
4337
  }
4126
4338
  }
4339
+ interface EditAdjustment {
4340
+ /**
4341
+ * The id of the adjustment interval to edit.
4342
+ */
4343
+ adjustment_interval_id: string;
4344
+ /**
4345
+ * The updated end date of this adjustment interval. If not specified, the start
4346
+ * date will not be updated.
4347
+ */
4348
+ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
4349
+ /**
4350
+ * The updated start date of this adjustment interval. If not specified, the start
4351
+ * date will not be updated.
4352
+ */
4353
+ start_date?: (string & {}) | Shared.BillingCycleRelativeDate;
4354
+ }
4127
4355
  }
4128
4356
  export interface SubscriptionSchedulePlanChangeParams {
4129
4357
  change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate';