orb-billing 1.12.0 → 1.13.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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +72 -0
  5. data/lib/orb/internal/util.rb +31 -0
  6. data/lib/orb/models/billable_metric.rb +10 -1
  7. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +11 -2
  8. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +11 -2
  9. data/lib/orb/models/invoice_create_params.rb +11 -1
  10. data/lib/orb/models/invoice_update_params.rb +11 -1
  11. data/lib/orb/models/item.rb +1 -0
  12. data/lib/orb/models/item_update_params.rb +1 -0
  13. data/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +9 -1
  14. data/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +9 -1
  15. data/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +9 -1
  16. data/lib/orb/models/price.rb +9 -1
  17. data/lib/orb/models/price_create_params.rb +9 -1
  18. data/lib/orb/models/price_evaluate_multiple_params.rb +12 -1
  19. data/lib/orb/models/price_evaluate_params.rb +12 -1
  20. data/lib/orb/models/price_evaluate_preview_events_params.rb +12 -1
  21. data/lib/orb/models/price_interval.rb +12 -1
  22. data/lib/orb/models/subscription_create_params.rb +24 -2
  23. data/lib/orb/models/subscription_price_intervals_params.rb +24 -2
  24. data/lib/orb/models/subscription_schedule_plan_change_params.rb +24 -2
  25. data/lib/orb/resources/alerts.rb +11 -3
  26. data/lib/orb/resources/beta/external_plan_id.rb +4 -0
  27. data/lib/orb/resources/beta.rb +8 -0
  28. data/lib/orb/resources/coupons/subscriptions.rb +7 -1
  29. data/lib/orb/resources/coupons.rb +12 -1
  30. data/lib/orb/resources/credit_blocks.rb +2 -0
  31. data/lib/orb/resources/credit_notes.rb +4 -1
  32. data/lib/orb/resources/customers/balance_transactions.rb +20 -1
  33. data/lib/orb/resources/customers/costs.rb +22 -2
  34. data/lib/orb/resources/customers/credits/ledger.rb +18 -6
  35. data/lib/orb/resources/customers/credits/top_ups.rb +6 -2
  36. data/lib/orb/resources/customers/credits.rb +10 -2
  37. data/lib/orb/resources/customers.rb +58 -1
  38. data/lib/orb/resources/dimensional_price_groups.rb +2 -1
  39. data/lib/orb/resources/events/backfills.rb +5 -1
  40. data/lib/orb/resources/events/volume.rb +5 -1
  41. data/lib/orb/resources/events.rb +12 -2
  42. data/lib/orb/resources/invoice_line_items.rb +5 -0
  43. data/lib/orb/resources/invoices.rb +23 -10
  44. data/lib/orb/resources/items.rb +5 -1
  45. data/lib/orb/resources/license_types.rb +5 -1
  46. data/lib/orb/resources/licenses/external_licenses.rb +2 -1
  47. data/lib/orb/resources/licenses/usage.rb +4 -2
  48. data/lib/orb/resources/licenses.rb +4 -2
  49. data/lib/orb/resources/metrics.rb +5 -1
  50. data/lib/orb/resources/plans/external_plan_id.rb +4 -0
  51. data/lib/orb/resources/plans/migrations.rb +6 -1
  52. data/lib/orb/resources/plans.rb +14 -1
  53. data/lib/orb/resources/prices/external_price_id.rb +10 -0
  54. data/lib/orb/resources/prices.rb +25 -2
  55. data/lib/orb/resources/subscription_changes.rb +2 -1
  56. data/lib/orb/resources/subscriptions.rb +8 -4
  57. data/lib/orb/version.rb +1 -1
  58. data/rbi/orb/client.rbi +72 -0
  59. data/rbi/orb/internal/util.rbi +18 -0
  60. data/rbi/orb/models/billable_metric.rbi +11 -3
  61. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +15 -2
  62. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +15 -2
  63. data/rbi/orb/models/invoice_create_params.rbi +12 -0
  64. data/rbi/orb/models/invoice_update_params.rbi +12 -0
  65. data/rbi/orb/models/item.rbi +5 -0
  66. data/rbi/orb/models/item_update_params.rbi +5 -0
  67. data/rbi/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbi +8 -0
  68. data/rbi/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbi +8 -0
  69. data/rbi/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbi +8 -0
  70. data/rbi/orb/models/price.rbi +8 -0
  71. data/rbi/orb/models/price_create_params.rbi +8 -0
  72. data/rbi/orb/models/price_evaluate_multiple_params.rbi +11 -0
  73. data/rbi/orb/models/price_evaluate_params.rbi +10 -0
  74. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +11 -0
  75. data/rbi/orb/models/price_interval.rbi +13 -3
  76. data/rbi/orb/models/subscription_create_params.rbi +22 -0
  77. data/rbi/orb/models/subscription_price_intervals_params.rbi +22 -0
  78. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +22 -0
  79. data/rbi/orb/resources/alerts.rbi +5 -0
  80. data/rbi/orb/resources/beta/external_plan_id.rbi +4 -0
  81. data/rbi/orb/resources/beta.rbi +8 -0
  82. data/rbi/orb/resources/coupons/subscriptions.rbi +5 -0
  83. data/rbi/orb/resources/coupons.rbi +10 -0
  84. data/rbi/orb/resources/credit_blocks.rbi +2 -0
  85. data/rbi/orb/resources/credit_notes.rbi +2 -0
  86. data/rbi/orb/resources/customers/balance_transactions.rbi +18 -0
  87. data/rbi/orb/resources/customers/costs.rbi +18 -0
  88. data/rbi/orb/resources/customers/credits/ledger.rbi +14 -4
  89. data/rbi/orb/resources/customers/credits/top_ups.rbi +2 -0
  90. data/rbi/orb/resources/customers/credits.rbi +6 -0
  91. data/rbi/orb/resources/customers.rbi +56 -0
  92. data/rbi/orb/resources/events/backfills.rbi +3 -0
  93. data/rbi/orb/resources/events/volume.rbi +3 -0
  94. data/rbi/orb/resources/events.rbi +9 -0
  95. data/rbi/orb/resources/invoice_line_items.rbi +5 -0
  96. data/rbi/orb/resources/invoices.rbi +21 -5
  97. data/rbi/orb/resources/items.rbi +3 -0
  98. data/rbi/orb/resources/license_types.rbi +3 -0
  99. data/rbi/orb/resources/metrics.rbi +3 -0
  100. data/rbi/orb/resources/plans/external_plan_id.rbi +4 -0
  101. data/rbi/orb/resources/plans/migrations.rbi +4 -0
  102. data/rbi/orb/resources/plans.rbi +12 -0
  103. data/rbi/orb/resources/prices/external_price_id.rbi +10 -0
  104. data/rbi/orb/resources/prices.rbi +24 -0
  105. data/sig/orb/internal/util.rbs +10 -0
  106. data/sig/orb/models/billable_metric.rbs +8 -3
  107. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +7 -0
  108. data/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +7 -0
  109. data/sig/orb/models/invoice_create_params.rbs +5 -0
  110. data/sig/orb/models/invoice_update_params.rbs +5 -0
  111. data/sig/orb/models/item.rbs +2 -0
  112. data/sig/orb/models/item_update_params.rbs +2 -0
  113. data/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs +5 -0
  114. data/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs +5 -0
  115. data/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs +5 -0
  116. data/sig/orb/models/price.rbs +5 -0
  117. data/sig/orb/models/price_create_params.rbs +5 -0
  118. data/sig/orb/models/price_evaluate_multiple_params.rbs +5 -0
  119. data/sig/orb/models/price_evaluate_params.rbs +6 -1
  120. data/sig/orb/models/price_evaluate_preview_events_params.rbs +5 -0
  121. data/sig/orb/models/price_interval.rbs +8 -3
  122. data/sig/orb/models/subscription_create_params.rbs +10 -0
  123. data/sig/orb/models/subscription_price_intervals_params.rbs +10 -0
  124. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +10 -0
  125. data/sig/orb/resources/invoices.rbs +2 -0
  126. data/sig/orb/resources/prices.rbs +1 -0
  127. metadata +2 -2
@@ -113,6 +113,11 @@ module Orb
113
113
  sig { params(grouping_keys: T::Array[String]).void }
114
114
  attr_writer :grouping_keys
115
115
 
116
+ # Optional overrides for parameterized billable metric parameters. If the metric
117
+ # has parameter definitions and no overrides are provided, defaults will be used.
118
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
119
+ attr_accessor :metric_parameter_overrides
120
+
116
121
  # New floating price request body params.
117
122
  sig do
118
123
  returns(
@@ -164,6 +169,7 @@ module Orb
164
169
  external_price_id: T.nilable(String),
165
170
  filter: T.nilable(String),
166
171
  grouping_keys: T::Array[String],
172
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
167
173
  price:
168
174
  T.nilable(
169
175
  T.any(
@@ -214,6 +220,9 @@ module Orb
214
220
  # [computed properties](/extensibility/advanced-metrics#computed-properties)) used
215
221
  # to group the underlying billable metric
216
222
  grouping_keys: nil,
223
+ # Optional overrides for parameterized billable metric parameters. If the metric
224
+ # has parameter definitions and no overrides are provided, defaults will be used.
225
+ metric_parameter_overrides: nil,
217
226
  # New floating price request body params.
218
227
  price: nil,
219
228
  # The ID of a price to evaluate that exists in your Orb account.
@@ -227,6 +236,8 @@ module Orb
227
236
  external_price_id: T.nilable(String),
228
237
  filter: T.nilable(String),
229
238
  grouping_keys: T::Array[String],
239
+ metric_parameter_overrides:
240
+ T.nilable(T::Hash[Symbol, T.anything]),
230
241
  price:
231
242
  T.nilable(
232
243
  T.any(
@@ -40,6 +40,11 @@ module Orb
40
40
  sig { params(grouping_keys: T::Array[String]).void }
41
41
  attr_writer :grouping_keys
42
42
 
43
+ # Optional overrides for parameterized billable metric parameters. If the metric
44
+ # has parameter definitions and no overrides are provided, defaults will be used.
45
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
46
+ attr_accessor :metric_parameter_overrides
47
+
43
48
  sig do
44
49
  params(
45
50
  timeframe_end: Time,
@@ -48,6 +53,7 @@ module Orb
48
53
  external_customer_id: T.nilable(String),
49
54
  filter: T.nilable(String),
50
55
  grouping_keys: T::Array[String],
56
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
51
57
  request_options: Orb::RequestOptions::OrHash
52
58
  ).returns(T.attached_class)
53
59
  end
@@ -68,6 +74,9 @@ module Orb
68
74
  # [computed properties](/extensibility/advanced-metrics#computed-properties)) used
69
75
  # to group the underlying billable metric
70
76
  grouping_keys: nil,
77
+ # Optional overrides for parameterized billable metric parameters. If the metric
78
+ # has parameter definitions and no overrides are provided, defaults will be used.
79
+ metric_parameter_overrides: nil,
71
80
  request_options: {}
72
81
  )
73
82
  end
@@ -81,6 +90,7 @@ module Orb
81
90
  external_customer_id: T.nilable(String),
82
91
  filter: T.nilable(String),
83
92
  grouping_keys: T::Array[String],
93
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
84
94
  request_options: Orb::RequestOptions
85
95
  }
86
96
  )
@@ -214,6 +214,11 @@ module Orb
214
214
  sig { params(grouping_keys: T::Array[String]).void }
215
215
  attr_writer :grouping_keys
216
216
 
217
+ # Optional overrides for parameterized billable metric parameters. If the metric
218
+ # has parameter definitions and no overrides are provided, defaults will be used.
219
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
220
+ attr_accessor :metric_parameter_overrides
221
+
217
222
  # New floating price request body params.
218
223
  sig do
219
224
  returns(
@@ -265,6 +270,7 @@ module Orb
265
270
  external_price_id: T.nilable(String),
266
271
  filter: T.nilable(String),
267
272
  grouping_keys: T::Array[String],
273
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
268
274
  price:
269
275
  T.nilable(
270
276
  T.any(
@@ -315,6 +321,9 @@ module Orb
315
321
  # [computed properties](/extensibility/advanced-metrics#computed-properties)) used
316
322
  # to group the underlying billable metric
317
323
  grouping_keys: nil,
324
+ # Optional overrides for parameterized billable metric parameters. If the metric
325
+ # has parameter definitions and no overrides are provided, defaults will be used.
326
+ metric_parameter_overrides: nil,
318
327
  # New floating price request body params.
319
328
  price: nil,
320
329
  # The ID of a price to evaluate that exists in your Orb account.
@@ -328,6 +337,8 @@ module Orb
328
337
  external_price_id: T.nilable(String),
329
338
  filter: T.nilable(String),
330
339
  grouping_keys: T::Array[String],
340
+ metric_parameter_overrides:
341
+ T.nilable(T::Hash[Symbol, T.anything]),
331
342
  price:
332
343
  T.nilable(
333
344
  T.any(
@@ -68,6 +68,11 @@ module Orb
68
68
  sig { returns(T.nilable(T::Array[String])) }
69
69
  attr_accessor :usage_customer_ids
70
70
 
71
+ # Override values for parameterized billable metric variables. Keys are parameter
72
+ # names, values are the override values.
73
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
74
+ attr_accessor :metric_parameter_overrides
75
+
71
76
  # The Price Interval resource represents a period of time for which a price will
72
77
  # bill on a subscription. A subscription’s price intervals define its billing
73
78
  # behavior.
@@ -117,7 +122,8 @@ module Orb
117
122
  Orb::Price::EventOutput::OrHash
118
123
  ),
119
124
  start_date: Time,
120
- usage_customer_ids: T.nilable(T::Array[String])
125
+ usage_customer_ids: T.nilable(T::Array[String]),
126
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything])
121
127
  ).returns(T.attached_class)
122
128
  end
123
129
  def self.new(
@@ -160,7 +166,10 @@ module Orb
160
166
  start_date:,
161
167
  # A list of customer IDs whose usage events will be aggregated and billed under
162
168
  # this price interval.
163
- usage_customer_ids:
169
+ usage_customer_ids:,
170
+ # Override values for parameterized billable metric variables. Keys are parameter
171
+ # names, values are the override values.
172
+ metric_parameter_overrides: nil
164
173
  )
165
174
  end
166
175
 
@@ -178,7 +187,8 @@ module Orb
178
187
  T.nilable(T::Array[Orb::FixedFeeQuantityTransition]),
179
188
  price: Orb::Price::Variants,
180
189
  start_date: Time,
181
- usage_customer_ids: T.nilable(T::Array[String])
190
+ usage_customer_ids: T.nilable(T::Array[String]),
191
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything])
182
192
  }
183
193
  )
184
194
  end
@@ -569,6 +569,11 @@ module Orb
569
569
  sig { returns(T.nilable(String)) }
570
570
  attr_accessor :maximum_amount
571
571
 
572
+ # Override values for parameterized billable metric variables. Keys are parameter
573
+ # names, values are the override values.
574
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
575
+ attr_accessor :metric_parameter_overrides
576
+
572
577
  # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
573
578
  # this price.
574
579
  sig { returns(T.nilable(String)) }
@@ -637,6 +642,7 @@ module Orb
637
642
  end_date: T.nilable(Time),
638
643
  external_price_id: T.nilable(String),
639
644
  maximum_amount: T.nilable(String),
645
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
640
646
  minimum_amount: T.nilable(String),
641
647
  plan_phase_order: T.nilable(Integer),
642
648
  price:
@@ -694,6 +700,9 @@ module Orb
694
700
  # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for
695
701
  # this price.
696
702
  maximum_amount: nil,
703
+ # Override values for parameterized billable metric variables. Keys are parameter
704
+ # names, values are the override values.
705
+ metric_parameter_overrides: nil,
697
706
  # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
698
707
  # this price.
699
708
  minimum_amount: nil,
@@ -718,6 +727,8 @@ module Orb
718
727
  end_date: T.nilable(Time),
719
728
  external_price_id: T.nilable(String),
720
729
  maximum_amount: T.nilable(String),
730
+ metric_parameter_overrides:
731
+ T.nilable(T::Hash[Symbol, T.anything]),
721
732
  minimum_amount: T.nilable(String),
722
733
  plan_phase_order: T.nilable(Integer),
723
734
  price:
@@ -3435,6 +3446,11 @@ module Orb
3435
3446
  sig { returns(T.nilable(String)) }
3436
3447
  attr_accessor :maximum_amount
3437
3448
 
3449
+ # Override values for parameterized billable metric variables. Keys are parameter
3450
+ # names, values are the override values.
3451
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
3452
+ attr_accessor :metric_parameter_overrides
3453
+
3438
3454
  # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
3439
3455
  # the replacement price.
3440
3456
  sig { returns(T.nilable(String)) }
@@ -3494,6 +3510,7 @@ module Orb
3494
3510
  external_price_id: T.nilable(String),
3495
3511
  fixed_price_quantity: T.nilable(Float),
3496
3512
  maximum_amount: T.nilable(String),
3513
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
3497
3514
  minimum_amount: T.nilable(String),
3498
3515
  price:
3499
3516
  T.nilable(
@@ -3549,6 +3566,9 @@ module Orb
3549
3566
  # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for
3550
3567
  # the replacement price.
3551
3568
  maximum_amount: nil,
3569
+ # Override values for parameterized billable metric variables. Keys are parameter
3570
+ # names, values are the override values.
3571
+ metric_parameter_overrides: nil,
3552
3572
  # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
3553
3573
  # the replacement price.
3554
3574
  minimum_amount: nil,
@@ -3568,6 +3588,8 @@ module Orb
3568
3588
  external_price_id: T.nilable(String),
3569
3589
  fixed_price_quantity: T.nilable(Float),
3570
3590
  maximum_amount: T.nilable(String),
3591
+ metric_parameter_overrides:
3592
+ T.nilable(T::Hash[Symbol, T.anything]),
3571
3593
  minimum_amount: T.nilable(String),
3572
3594
  price:
3573
3595
  T.nilable(
@@ -229,6 +229,11 @@ module Orb
229
229
  sig { returns(T.nilable(Float)) }
230
230
  attr_accessor :maximum_amount
231
231
 
232
+ # Override values for parameterized billable metric variables. Keys are parameter
233
+ # names, values are the override values (number or string).
234
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
235
+ attr_accessor :metric_parameter_overrides
236
+
232
237
  # The minimum amount that will be billed for this price interval for a given
233
238
  # billing period.
234
239
  sig { returns(T.nilable(Float)) }
@@ -315,6 +320,7 @@ module Orb
315
320
  ]
316
321
  ),
317
322
  maximum_amount: T.nilable(Float),
323
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
318
324
  minimum_amount: T.nilable(Float),
319
325
  price:
320
326
  T.nilable(
@@ -383,6 +389,9 @@ module Orb
383
389
  # The maximum amount that will be billed for this price interval for a given
384
390
  # billing period.
385
391
  maximum_amount: nil,
392
+ # Override values for parameterized billable metric variables. Keys are parameter
393
+ # names, values are the override values (number or string).
394
+ metric_parameter_overrides: nil,
386
395
  # The minimum amount that will be billed for this price interval for a given
387
396
  # billing period.
388
397
  minimum_amount: nil,
@@ -427,6 +436,8 @@ module Orb
427
436
  ]
428
437
  ),
429
438
  maximum_amount: T.nilable(Float),
439
+ metric_parameter_overrides:
440
+ T.nilable(T::Hash[Symbol, T.anything]),
430
441
  minimum_amount: T.nilable(Float),
431
442
  price:
432
443
  T.nilable(
@@ -2884,6 +2895,11 @@ module Orb
2884
2895
  end
2885
2896
  attr_accessor :fixed_fee_quantity_transitions
2886
2897
 
2898
+ # Override values for parameterized billable metric variables. Keys are parameter
2899
+ # names, values are the override values (number or string).
2900
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
2901
+ attr_accessor :metric_parameter_overrides
2902
+
2887
2903
  # The updated start date of this price interval. If not specified, the start date
2888
2904
  # will not be updated.
2889
2905
  sig do
@@ -2923,6 +2939,7 @@ module Orb
2923
2939
  Orb::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition::OrHash
2924
2940
  ]
2925
2941
  ),
2942
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
2926
2943
  start_date: T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol),
2927
2944
  usage_customer_ids: T.nilable(T::Array[String])
2928
2945
  ).returns(T.attached_class)
@@ -2950,6 +2967,9 @@ module Orb
2950
2967
  # that this list will overwrite all existing fixed fee quantity transitions on the
2951
2968
  # price interval.
2952
2969
  fixed_fee_quantity_transitions: nil,
2970
+ # Override values for parameterized billable metric variables. Keys are parameter
2971
+ # names, values are the override values (number or string).
2972
+ metric_parameter_overrides: nil,
2953
2973
  # The updated start date of this price interval. If not specified, the start date
2954
2974
  # will not be updated.
2955
2975
  start_date: nil,
@@ -2978,6 +2998,8 @@ module Orb
2978
2998
  Orb::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition
2979
2999
  ]
2980
3000
  ),
3001
+ metric_parameter_overrides:
3002
+ T.nilable(T::Hash[Symbol, T.anything]),
2981
3003
  start_date: T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol),
2982
3004
  usage_customer_ids: T.nilable(T::Array[String])
2983
3005
  }
@@ -620,6 +620,11 @@ module Orb
620
620
  sig { returns(T.nilable(String)) }
621
621
  attr_accessor :maximum_amount
622
622
 
623
+ # Override values for parameterized billable metric variables. Keys are parameter
624
+ # names, values are the override values.
625
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
626
+ attr_accessor :metric_parameter_overrides
627
+
623
628
  # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
624
629
  # this price.
625
630
  sig { returns(T.nilable(String)) }
@@ -688,6 +693,7 @@ module Orb
688
693
  end_date: T.nilable(Time),
689
694
  external_price_id: T.nilable(String),
690
695
  maximum_amount: T.nilable(String),
696
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
691
697
  minimum_amount: T.nilable(String),
692
698
  plan_phase_order: T.nilable(Integer),
693
699
  price:
@@ -745,6 +751,9 @@ module Orb
745
751
  # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for
746
752
  # this price.
747
753
  maximum_amount: nil,
754
+ # Override values for parameterized billable metric variables. Keys are parameter
755
+ # names, values are the override values.
756
+ metric_parameter_overrides: nil,
748
757
  # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
749
758
  # this price.
750
759
  minimum_amount: nil,
@@ -769,6 +778,8 @@ module Orb
769
778
  end_date: T.nilable(Time),
770
779
  external_price_id: T.nilable(String),
771
780
  maximum_amount: T.nilable(String),
781
+ metric_parameter_overrides:
782
+ T.nilable(T::Hash[Symbol, T.anything]),
772
783
  minimum_amount: T.nilable(String),
773
784
  plan_phase_order: T.nilable(Integer),
774
785
  price:
@@ -3494,6 +3505,11 @@ module Orb
3494
3505
  sig { returns(T.nilable(String)) }
3495
3506
  attr_accessor :maximum_amount
3496
3507
 
3508
+ # Override values for parameterized billable metric variables. Keys are parameter
3509
+ # names, values are the override values.
3510
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
3511
+ attr_accessor :metric_parameter_overrides
3512
+
3497
3513
  # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
3498
3514
  # the replacement price.
3499
3515
  sig { returns(T.nilable(String)) }
@@ -3553,6 +3569,7 @@ module Orb
3553
3569
  external_price_id: T.nilable(String),
3554
3570
  fixed_price_quantity: T.nilable(Float),
3555
3571
  maximum_amount: T.nilable(String),
3572
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
3556
3573
  minimum_amount: T.nilable(String),
3557
3574
  price:
3558
3575
  T.nilable(
@@ -3608,6 +3625,9 @@ module Orb
3608
3625
  # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for
3609
3626
  # the replacement price.
3610
3627
  maximum_amount: nil,
3628
+ # Override values for parameterized billable metric variables. Keys are parameter
3629
+ # names, values are the override values.
3630
+ metric_parameter_overrides: nil,
3611
3631
  # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
3612
3632
  # the replacement price.
3613
3633
  minimum_amount: nil,
@@ -3627,6 +3647,8 @@ module Orb
3627
3647
  external_price_id: T.nilable(String),
3628
3648
  fixed_price_quantity: T.nilable(Float),
3629
3649
  maximum_amount: T.nilable(String),
3650
+ metric_parameter_overrides:
3651
+ T.nilable(T::Hash[Symbol, T.anything]),
3630
3652
  minimum_amount: T.nilable(String),
3631
3653
  price:
3632
3654
  T.nilable(
@@ -2,6 +2,11 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
6
+ # usage, or credit balance and trigger webhooks when a threshold is exceeded.
7
+ #
8
+ # Alerts created through the API can be scoped to either customers or
9
+ # subscriptions.
5
10
  class Alerts
6
11
  # This endpoint retrieves an alert by its ID.
7
12
  sig do
@@ -3,6 +3,10 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Beta
6
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
7
+ # subscribed to by a customer. Plans define the billing behavior of the
8
+ # subscription. You can see more about how to configure prices in the
9
+ # [Price resource](/reference/price).
6
10
  class ExternalPlanID
7
11
  # This endpoint allows the creation of a new plan version for an existing plan.
8
12
  sig do
@@ -2,7 +2,15 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
6
+ # subscribed to by a customer. Plans define the billing behavior of the
7
+ # subscription. You can see more about how to configure prices in the
8
+ # [Price resource](/reference/price).
5
9
  class Beta
10
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
11
+ # subscribed to by a customer. Plans define the billing behavior of the
12
+ # subscription. You can see more about how to configure prices in the
13
+ # [Price resource](/reference/price).
6
14
  sig { returns(Orb::Resources::Beta::ExternalPlanID) }
7
15
  attr_reader :external_plan_id
8
16
 
@@ -3,6 +3,11 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Coupons
6
+ # A coupon represents a reusable discount configuration that can be applied either
7
+ # as a fixed or percentage amount to an invoice or subscription. Coupons are
8
+ # activated using a redemption code, which applies the discount to a subscription
9
+ # or invoice. The duration of a coupon determines how long it remains available
10
+ # for use by end users.
6
11
  class Subscriptions
7
12
  # This endpoint returns a list of all subscriptions that have redeemed a given
8
13
  # coupon as a [paginated](/api-reference/pagination) list, ordered starting from
@@ -2,7 +2,17 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # A coupon represents a reusable discount configuration that can be applied either
6
+ # as a fixed or percentage amount to an invoice or subscription. Coupons are
7
+ # activated using a redemption code, which applies the discount to a subscription
8
+ # or invoice. The duration of a coupon determines how long it remains available
9
+ # for use by end users.
5
10
  class Coupons
11
+ # A coupon represents a reusable discount configuration that can be applied either
12
+ # as a fixed or percentage amount to an invoice or subscription. Coupons are
13
+ # activated using a redemption code, which applies the discount to a subscription
14
+ # or invoice. The duration of a coupon determines how long it remains available
15
+ # for use by end users.
6
16
  sig { returns(Orb::Resources::Coupons::Subscriptions) }
7
17
  attr_reader :subscriptions
8
18
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
6
+ # credits within Orb.
5
7
  class CreditBlocks
6
8
  # This endpoint returns a credit block identified by its block_id.
7
9
  sig do
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # The [Credit Note](/invoicing/credit-notes) resource represents a credit that has
6
+ # been applied to a particular invoice.
5
7
  class CreditNotes
6
8
  # This endpoint is used to create a single
7
9
  # [`Credit Note`](/invoicing/credit-notes).
@@ -3,6 +3,24 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Customers
6
+ # A customer is a buyer of your products, and the other party to the billing
7
+ # relationship.
8
+ #
9
+ # In Orb, customers are assigned system generated identifiers automatically, but
10
+ # it's often desirable to have these match existing identifiers in your system. To
11
+ # avoid having to denormalize Orb ID information, you can pass in an
12
+ # `external_customer_id` with your own identifier. See
13
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
14
+ # information about how these aliases work in Orb.
15
+ #
16
+ # In addition to having an identifier in your system, a customer may exist in a
17
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
18
+ # `payment_provider` enum field to express this mapping.
19
+ #
20
+ # A customer also has a timezone (from the standard
21
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
22
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
23
+ # information on what this timezone parameter influences within Orb.
6
24
  class BalanceTransactions
7
25
  # Creates an immutable balance transaction that updates the customer's balance and
8
26
  # returns back the newly created transaction.
@@ -3,6 +3,24 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Customers
6
+ # A customer is a buyer of your products, and the other party to the billing
7
+ # relationship.
8
+ #
9
+ # In Orb, customers are assigned system generated identifiers automatically, but
10
+ # it's often desirable to have these match existing identifiers in your system. To
11
+ # avoid having to denormalize Orb ID information, you can pass in an
12
+ # `external_customer_id` with your own identifier. See
13
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
14
+ # information about how these aliases work in Orb.
15
+ #
16
+ # In addition to having an identifier in your system, a customer may exist in a
17
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
18
+ # `payment_provider` enum field to express this mapping.
19
+ #
20
+ # A customer also has a timezone (from the standard
21
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
22
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
23
+ # information on what this timezone parameter influences within Orb.
6
24
  class Costs
7
25
  # This endpoint is used to fetch a day-by-day snapshot of a customer's costs in
8
26
  # Orb, calculated by applying pricing information to the underlying usage (see the
@@ -4,6 +4,8 @@ module Orb
4
4
  module Resources
5
5
  class Customers
6
6
  class Credits
7
+ # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
8
+ # credits within Orb.
7
9
  class Ledger
8
10
  # The credits ledger provides _auditing_ functionality over Orb's credits system
9
11
  # with a list of actions that have taken place to modify a customer's credit
@@ -180,8 +182,12 @@ module Orb
180
182
  # also generate a one-off invoice for the customer for the credits pre-purchase.
181
183
  # Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
182
184
  # on the invoice are calculated by multiplying the cost basis with the number of
183
- # credit units added. Additionally, Orb also enforces invoice generation when a
184
- # non-zero `per_unit_cost_basis` value is provided.
185
+ # credit units added.
186
+ #
187
+ # - if `per_unit_cost_basis` is greater than zero, an invoice will be generated
188
+ # and `invoice_settings` must be included
189
+ # - if `invoice_settings` is passed, one of either `custom_due_date` or
190
+ # `net_terms` is required to determine the due date
185
191
  #
186
192
  # ## Deducting Credits
187
193
  #
@@ -369,8 +375,12 @@ module Orb
369
375
  # also generate a one-off invoice for the customer for the credits pre-purchase.
370
376
  # Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
371
377
  # on the invoice are calculated by multiplying the cost basis with the number of
372
- # credit units added. Additionally, Orb also enforces invoice generation when a
373
- # non-zero `per_unit_cost_basis` value is provided.
378
+ # credit units added.
379
+ #
380
+ # - if `per_unit_cost_basis` is greater than zero, an invoice will be generated
381
+ # and `invoice_settings` must be included
382
+ # - if `invoice_settings` is passed, one of either `custom_due_date` or
383
+ # `net_terms` is required to determine the due date
374
384
  #
375
385
  # ## Deducting Credits
376
386
  #
@@ -4,6 +4,8 @@ module Orb
4
4
  module Resources
5
5
  class Customers
6
6
  class Credits
7
+ # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
8
+ # credits within Orb.
7
9
  class TopUps
8
10
  # This endpoint allows you to create a new top-up for a specified customer's
9
11
  # balance. While this top-up is active, the customer's balance will added in
@@ -3,10 +3,16 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Customers
6
+ # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
7
+ # credits within Orb.
6
8
  class Credits
9
+ # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
10
+ # credits within Orb.
7
11
  sig { returns(Orb::Resources::Customers::Credits::Ledger) }
8
12
  attr_reader :ledger
9
13
 
14
+ # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
15
+ # credits within Orb.
10
16
  sig { returns(Orb::Resources::Customers::Credits::TopUps) }
11
17
  attr_reader :top_ups
12
18