orb-billing 1.4.0 → 1.5.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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/orb/models/credit_note.rb +17 -1
  5. data/lib/orb/models/credit_note_create_params.rb +53 -2
  6. data/lib/orb/models/events/backfill_create_params.rb +2 -2
  7. data/lib/orb/models/mutated_subscription.rb +9 -6
  8. data/lib/orb/models/price_evaluate_multiple_params.rb +9 -1
  9. data/lib/orb/models/price_evaluate_multiple_response.rb +9 -1
  10. data/lib/orb/models/price_evaluate_preview_events_params.rb +9 -1
  11. data/lib/orb/models/price_evaluate_preview_events_response.rb +9 -1
  12. data/lib/orb/models/subscription.rb +9 -6
  13. data/lib/orb/models/subscription_price_intervals_params.rb +10 -10
  14. data/lib/orb/resources/credit_notes.rb +33 -1
  15. data/lib/orb/resources/customers/costs.rb +16 -16
  16. data/lib/orb/resources/customers/credits/ledger.rb +4 -4
  17. data/lib/orb/resources/invoices.rb +1 -1
  18. data/lib/orb/resources/subscriptions.rb +1 -1
  19. data/lib/orb/version.rb +1 -1
  20. data/rbi/orb/models/credit_note.rbi +19 -3
  21. data/rbi/orb/models/credit_note_create_params.rbi +69 -5
  22. data/rbi/orb/models/events/backfill_create_params.rbi +4 -4
  23. data/rbi/orb/models/mutated_subscription.rbi +12 -6
  24. data/rbi/orb/models/price_evaluate_multiple_params.rbi +8 -0
  25. data/rbi/orb/models/price_evaluate_multiple_response.rbi +8 -0
  26. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +8 -0
  27. data/rbi/orb/models/price_evaluate_preview_events_response.rbi +8 -0
  28. data/rbi/orb/models/subscription.rbi +12 -6
  29. data/rbi/orb/models/subscription_price_intervals_params.rbi +12 -12
  30. data/rbi/orb/resources/credit_notes.rbi +37 -0
  31. data/rbi/orb/resources/customers/costs.rbi +16 -16
  32. data/rbi/orb/resources/customers/credits/ledger.rbi +4 -4
  33. data/rbi/orb/resources/events/backfills.rbi +2 -2
  34. data/rbi/orb/resources/invoices.rbi +1 -1
  35. data/rbi/orb/resources/subscriptions.rbi +1 -1
  36. data/sig/orb/models/credit_note.rbs +13 -3
  37. data/sig/orb/models/credit_note_create_params.rbs +34 -4
  38. data/sig/orb/models/price_evaluate_multiple_params.rbs +5 -0
  39. data/sig/orb/models/price_evaluate_multiple_response.rbs +5 -0
  40. data/sig/orb/models/price_evaluate_preview_events_params.rbs +5 -0
  41. data/sig/orb/models/price_evaluate_preview_events_response.rbs +5 -0
  42. data/sig/orb/resources/credit_notes.rbs +2 -0
  43. metadata +2 -2
@@ -55,11 +55,11 @@ module Orb
55
55
  end
56
56
  def create(
57
57
  # The (exclusive) end of the usage timeframe affected by this backfill. By
58
- # default, Orb allows backfills up to 10 days in duration at a time. Reach out to
58
+ # default, Orb allows backfills up to 31 days in duration at a time. Reach out to
59
59
  # discuss extending this limit and your use case.
60
60
  timeframe_end:,
61
61
  # The (inclusive) start of the usage timeframe affected by this backfill. By
62
- # default, Orb allows backfills up to 10 days in duration at a time. Reach out to
62
+ # default, Orb allows backfills up to 31 days in duration at a time. Reach out to
63
63
  # discuss extending this limit and your use case.
64
64
  timeframe_start:,
65
65
  # The time at which no more events will be accepted for this backfill. The
@@ -239,7 +239,7 @@ module Orb
239
239
  #
240
240
  # If the associated invoice has used the customer balance to change the amount
241
241
  # due, the customer balance operation will be reverted. For example, if the
242
- # invoice used $10 of customer balance, that amount will be added back to the
242
+ # invoice used \$10 of customer balance, that amount will be added back to the
243
243
  # customer balance upon voiding.
244
244
  #
245
245
  # If the invoice was used to purchase a credit block, but the invoice is not yet
@@ -258,7 +258,7 @@ module Orb
258
258
  # is hit. To enable threshold billing, pass in an `invoicing_threshold`, which is
259
259
  # specified in the subscription's invoicing currency, when creating a
260
260
  # subscription. E.g. pass in `10.00` to issue an invoice when usage amounts hit
261
- # $10.00 for a subscription that invoices in USD.
261
+ # \$10.00 for a subscription that invoices in USD.
262
262
  sig do
263
263
  params(
264
264
  add_adjustments:
@@ -104,7 +104,9 @@ module Orb
104
104
  quantity: Float?,
105
105
  subtotal: String,
106
106
  tax_amounts: ::Array[Orb::TaxAmount],
107
- discounts: ::Array[Orb::CreditNote::LineItem::Discount]
107
+ discounts: ::Array[Orb::CreditNote::LineItem::Discount],
108
+ end_time_exclusive: Time?,
109
+ start_time_inclusive: Time?
108
110
  }
109
111
 
110
112
  class LineItem < Orb::Internal::Type::BaseModel
@@ -128,6 +130,10 @@ module Orb
128
130
  ::Array[Orb::CreditNote::LineItem::Discount]
129
131
  ) -> ::Array[Orb::CreditNote::LineItem::Discount]
130
132
 
133
+ attr_accessor end_time_exclusive: Time?
134
+
135
+ attr_accessor start_time_inclusive: Time?
136
+
131
137
  def initialize: (
132
138
  id: String,
133
139
  amount: String,
@@ -136,7 +142,9 @@ module Orb
136
142
  quantity: Float?,
137
143
  subtotal: String,
138
144
  tax_amounts: ::Array[Orb::TaxAmount],
139
- ?discounts: ::Array[Orb::CreditNote::LineItem::Discount]
145
+ ?discounts: ::Array[Orb::CreditNote::LineItem::Discount],
146
+ ?end_time_exclusive: Time?,
147
+ ?start_time_inclusive: Time?
140
148
  ) -> void
141
149
 
142
150
  def to_hash: -> {
@@ -147,7 +155,9 @@ module Orb
147
155
  quantity: Float?,
148
156
  subtotal: String,
149
157
  tax_amounts: ::Array[Orb::TaxAmount],
150
- discounts: ::Array[Orb::CreditNote::LineItem::Discount]
158
+ discounts: ::Array[Orb::CreditNote::LineItem::Discount],
159
+ end_time_exclusive: Time?,
160
+ start_time_inclusive: Time?
151
161
  }
152
162
 
153
163
  type discount =
@@ -4,7 +4,9 @@ module Orb
4
4
  {
5
5
  line_items: ::Array[Orb::CreditNoteCreateParams::LineItem],
6
6
  reason: Orb::Models::CreditNoteCreateParams::reason,
7
- memo: String?
7
+ end_date: Date?,
8
+ memo: String?,
9
+ start_date: Date?
8
10
  }
9
11
  & Orb::Internal::Type::request_parameters
10
12
 
@@ -16,32 +18,60 @@ module Orb
16
18
 
17
19
  attr_accessor reason: Orb::Models::CreditNoteCreateParams::reason
18
20
 
21
+ attr_accessor end_date: Date?
22
+
19
23
  attr_accessor memo: String?
20
24
 
25
+ attr_accessor start_date: Date?
26
+
21
27
  def initialize: (
22
28
  line_items: ::Array[Orb::CreditNoteCreateParams::LineItem],
23
29
  reason: Orb::Models::CreditNoteCreateParams::reason,
30
+ ?end_date: Date?,
24
31
  ?memo: String?,
32
+ ?start_date: Date?,
25
33
  ?request_options: Orb::request_opts
26
34
  ) -> void
27
35
 
28
36
  def to_hash: -> {
29
37
  line_items: ::Array[Orb::CreditNoteCreateParams::LineItem],
30
38
  reason: Orb::Models::CreditNoteCreateParams::reason,
39
+ end_date: Date?,
31
40
  memo: String?,
41
+ start_date: Date?,
32
42
  request_options: Orb::RequestOptions
33
43
  }
34
44
 
35
- type line_item = { amount: String, invoice_line_item_id: String }
45
+ type line_item =
46
+ {
47
+ amount: String,
48
+ invoice_line_item_id: String,
49
+ end_date: Date?,
50
+ start_date: Date?
51
+ }
36
52
 
37
53
  class LineItem < Orb::Internal::Type::BaseModel
38
54
  attr_accessor amount: String
39
55
 
40
56
  attr_accessor invoice_line_item_id: String
41
57
 
42
- def initialize: (amount: String, invoice_line_item_id: String) -> void
58
+ attr_accessor end_date: Date?
59
+
60
+ attr_accessor start_date: Date?
61
+
62
+ def initialize: (
63
+ amount: String,
64
+ invoice_line_item_id: String,
65
+ ?end_date: Date?,
66
+ ?start_date: Date?
67
+ ) -> void
43
68
 
44
- def to_hash: -> { amount: String, invoice_line_item_id: String }
69
+ def to_hash: -> {
70
+ amount: String,
71
+ invoice_line_item_id: String,
72
+ end_date: Date?,
73
+ start_date: Date?
74
+ }
45
75
  end
46
76
 
47
77
  type reason =
@@ -48,6 +48,7 @@ module Orb
48
48
 
49
49
  type price_evaluation =
50
50
  {
51
+ external_price_id: String?,
51
52
  filter: String?,
52
53
  grouping_keys: ::Array[String],
53
54
  price: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::price?,
@@ -55,6 +56,8 @@ module Orb
55
56
  }
56
57
 
57
58
  class PriceEvaluation < Orb::Internal::Type::BaseModel
59
+ attr_accessor external_price_id: String?
60
+
58
61
  attr_accessor filter: String?
59
62
 
60
63
  attr_reader grouping_keys: ::Array[String]?
@@ -66,6 +69,7 @@ module Orb
66
69
  attr_accessor price_id: String?
67
70
 
68
71
  def initialize: (
72
+ ?external_price_id: String?,
69
73
  ?filter: String?,
70
74
  ?grouping_keys: ::Array[String],
71
75
  ?price: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::price?,
@@ -73,6 +77,7 @@ module Orb
73
77
  ) -> void
74
78
 
75
79
  def to_hash: -> {
80
+ external_price_id: String?,
76
81
  filter: String?,
77
82
  grouping_keys: ::Array[String],
78
83
  price: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::price?,
@@ -18,6 +18,7 @@ module Orb
18
18
  {
19
19
  currency: String,
20
20
  price_groups: ::Array[Orb::EvaluatePriceGroup],
21
+ external_price_id: String?,
21
22
  inline_price_index: Integer?,
22
23
  price_id: String?
23
24
  }
@@ -27,6 +28,8 @@ module Orb
27
28
 
28
29
  attr_accessor price_groups: ::Array[Orb::EvaluatePriceGroup]
29
30
 
31
+ attr_accessor external_price_id: String?
32
+
30
33
  attr_accessor inline_price_index: Integer?
31
34
 
32
35
  attr_accessor price_id: String?
@@ -34,6 +37,7 @@ module Orb
34
37
  def initialize: (
35
38
  currency: String,
36
39
  price_groups: ::Array[Orb::EvaluatePriceGroup],
40
+ ?external_price_id: String?,
37
41
  ?inline_price_index: Integer?,
38
42
  ?price_id: String?
39
43
  ) -> void
@@ -41,6 +45,7 @@ module Orb
41
45
  def to_hash: -> {
42
46
  currency: String,
43
47
  price_groups: ::Array[Orb::EvaluatePriceGroup],
48
+ external_price_id: String?,
44
49
  inline_price_index: Integer?,
45
50
  price_id: String?
46
51
  }
@@ -94,6 +94,7 @@ module Orb
94
94
 
95
95
  type price_evaluation =
96
96
  {
97
+ external_price_id: String?,
97
98
  filter: String?,
98
99
  grouping_keys: ::Array[String],
99
100
  price: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::price?,
@@ -101,6 +102,8 @@ module Orb
101
102
  }
102
103
 
103
104
  class PriceEvaluation < Orb::Internal::Type::BaseModel
105
+ attr_accessor external_price_id: String?
106
+
104
107
  attr_accessor filter: String?
105
108
 
106
109
  attr_reader grouping_keys: ::Array[String]?
@@ -112,6 +115,7 @@ module Orb
112
115
  attr_accessor price_id: String?
113
116
 
114
117
  def initialize: (
118
+ ?external_price_id: String?,
115
119
  ?filter: String?,
116
120
  ?grouping_keys: ::Array[String],
117
121
  ?price: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::price?,
@@ -119,6 +123,7 @@ module Orb
119
123
  ) -> void
120
124
 
121
125
  def to_hash: -> {
126
+ external_price_id: String?,
122
127
  filter: String?,
123
128
  grouping_keys: ::Array[String],
124
129
  price: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::price?,
@@ -18,6 +18,7 @@ module Orb
18
18
  {
19
19
  currency: String,
20
20
  price_groups: ::Array[Orb::EvaluatePriceGroup],
21
+ external_price_id: String?,
21
22
  inline_price_index: Integer?,
22
23
  price_id: String?
23
24
  }
@@ -27,6 +28,8 @@ module Orb
27
28
 
28
29
  attr_accessor price_groups: ::Array[Orb::EvaluatePriceGroup]
29
30
 
31
+ attr_accessor external_price_id: String?
32
+
30
33
  attr_accessor inline_price_index: Integer?
31
34
 
32
35
  attr_accessor price_id: String?
@@ -34,6 +37,7 @@ module Orb
34
37
  def initialize: (
35
38
  currency: String,
36
39
  price_groups: ::Array[Orb::EvaluatePriceGroup],
40
+ ?external_price_id: String?,
37
41
  ?inline_price_index: Integer?,
38
42
  ?price_id: String?
39
43
  ) -> void
@@ -41,6 +45,7 @@ module Orb
41
45
  def to_hash: -> {
42
46
  currency: String,
43
47
  price_groups: ::Array[Orb::EvaluatePriceGroup],
48
+ external_price_id: String?,
44
49
  inline_price_index: Integer?,
45
50
  price_id: String?
46
51
  }
@@ -4,7 +4,9 @@ module Orb
4
4
  def create: (
5
5
  line_items: ::Array[Orb::CreditNoteCreateParams::LineItem],
6
6
  reason: Orb::Models::CreditNoteCreateParams::reason,
7
+ ?end_date: Date?,
7
8
  ?memo: String?,
9
+ ?start_date: Date?,
8
10
  ?request_options: Orb::request_opts
9
11
  ) -> Orb::CreditNote
10
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orb-billing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-08 00:00:00.000000000 Z
11
+ date: 2025-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool