orb-billing 1.3.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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -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/customers/credits/ledger_create_entry_by_external_id_params.rb +31 -1
  7. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +31 -1
  8. data/lib/orb/models/events/backfill_create_params.rb +2 -2
  9. data/lib/orb/models/mutated_subscription.rb +9 -6
  10. data/lib/orb/models/price_evaluate_multiple_params.rb +9 -1
  11. data/lib/orb/models/price_evaluate_multiple_response.rb +9 -1
  12. data/lib/orb/models/price_evaluate_preview_events_params.rb +9 -1
  13. data/lib/orb/models/price_evaluate_preview_events_response.rb +9 -1
  14. data/lib/orb/models/subscription.rb +9 -6
  15. data/lib/orb/models/subscription_price_intervals_params.rb +10 -10
  16. data/lib/orb/resources/credit_notes.rb +33 -1
  17. data/lib/orb/resources/customers/costs.rb +16 -16
  18. data/lib/orb/resources/customers/credits/ledger.rb +4 -4
  19. data/lib/orb/resources/invoices.rb +1 -1
  20. data/lib/orb/resources/subscriptions.rb +1 -1
  21. data/lib/orb/version.rb +1 -1
  22. data/rbi/orb/models/credit_note.rbi +19 -3
  23. data/rbi/orb/models/credit_note_create_params.rbi +69 -5
  24. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +43 -0
  25. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +43 -0
  26. data/rbi/orb/models/events/backfill_create_params.rbi +4 -4
  27. data/rbi/orb/models/mutated_subscription.rbi +12 -6
  28. data/rbi/orb/models/price_evaluate_multiple_params.rbi +8 -0
  29. data/rbi/orb/models/price_evaluate_multiple_response.rbi +8 -0
  30. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +8 -0
  31. data/rbi/orb/models/price_evaluate_preview_events_response.rbi +8 -0
  32. data/rbi/orb/models/subscription.rbi +12 -6
  33. data/rbi/orb/models/subscription_price_intervals_params.rbi +12 -12
  34. data/rbi/orb/resources/credit_notes.rbi +37 -0
  35. data/rbi/orb/resources/customers/costs.rbi +16 -16
  36. data/rbi/orb/resources/customers/credits/ledger.rbi +4 -4
  37. data/rbi/orb/resources/events/backfills.rbi +2 -2
  38. data/rbi/orb/resources/invoices.rbi +1 -1
  39. data/rbi/orb/resources/subscriptions.rbi +1 -1
  40. data/sig/orb/models/credit_note.rbs +13 -3
  41. data/sig/orb/models/credit_note_create_params.rbs +34 -4
  42. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +13 -0
  43. data/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +13 -0
  44. data/sig/orb/models/price_evaluate_multiple_params.rbs +5 -0
  45. data/sig/orb/models/price_evaluate_multiple_response.rbs +5 -0
  46. data/sig/orb/models/price_evaluate_preview_events_params.rbs +5 -0
  47. data/sig/orb/models/price_evaluate_preview_events_response.rbs +5 -0
  48. data/sig/orb/resources/credit_notes.rbs +2 -0
  49. metadata +2 -2
@@ -86,7 +86,8 @@ module Orb
86
86
  sig { returns(T.nilable(String)) }
87
87
  attr_accessor :default_invoice_memo
88
88
 
89
- # The discount intervals for this subscription sorted by the start_date.
89
+ # The discount intervals for this subscription sorted by the start_date. This
90
+ # field is deprecated in favor of `adjustment_intervals`.
90
91
  sig { returns(T::Array[Orb::Subscription::DiscountInterval::Variants]) }
91
92
  attr_accessor :discount_intervals
92
93
 
@@ -100,7 +101,8 @@ module Orb
100
101
  sig { returns(T.nilable(String)) }
101
102
  attr_accessor :invoicing_threshold
102
103
 
103
- # The maximum intervals for this subscription sorted by the start_date.
104
+ # The maximum intervals for this subscription sorted by the start_date. This field
105
+ # is deprecated in favor of `adjustment_intervals`.
104
106
  sig { returns(T::Array[Orb::MaximumInterval]) }
105
107
  attr_accessor :maximum_intervals
106
108
 
@@ -111,7 +113,8 @@ module Orb
111
113
  sig { returns(T::Hash[Symbol, String]) }
112
114
  attr_accessor :metadata
113
115
 
114
- # The minimum intervals for this subscription sorted by the start_date.
116
+ # The minimum intervals for this subscription sorted by the start_date. This field
117
+ # is deprecated in favor of `adjustment_intervals`.
115
118
  sig { returns(T::Array[Orb::MinimumInterval]) }
116
119
  attr_accessor :minimum_intervals
117
120
 
@@ -282,20 +285,23 @@ module Orb
282
285
  # Determines the default memo on this subscriptions' invoices. Note that if this
283
286
  # is not provided, it is determined by the plan configuration.
284
287
  default_invoice_memo:,
285
- # The discount intervals for this subscription sorted by the start_date.
288
+ # The discount intervals for this subscription sorted by the start_date. This
289
+ # field is deprecated in favor of `adjustment_intervals`.
286
290
  discount_intervals:,
287
291
  # The date Orb stops billing for this subscription.
288
292
  end_date:,
289
293
  fixed_fee_quantity_schedule:,
290
294
  invoicing_threshold:,
291
- # The maximum intervals for this subscription sorted by the start_date.
295
+ # The maximum intervals for this subscription sorted by the start_date. This field
296
+ # is deprecated in favor of `adjustment_intervals`.
292
297
  maximum_intervals:,
293
298
  # User specified key-value pairs for the resource. If not present, this defaults
294
299
  # to an empty dictionary. Individual keys can be removed by setting the value to
295
300
  # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
296
301
  # `null`.
297
302
  metadata:,
298
- # The minimum intervals for this subscription sorted by the start_date.
303
+ # The minimum intervals for this subscription sorted by the start_date. This field
304
+ # is deprecated in favor of `adjustment_intervals`.
299
305
  minimum_intervals:,
300
306
  # The name of the subscription.
301
307
  name:,
@@ -888,8 +888,8 @@ module Orb
888
888
  sig { returns(T.nilable(Integer)) }
889
889
  attr_accessor :billing_cycle_day
890
890
 
891
- # The updated end date of this price interval. If not specified, the start date
892
- # will not be updated.
891
+ # The updated end date of this price interval. If not specified, the end date will
892
+ # not be updated.
893
893
  sig do
894
894
  returns(
895
895
  T.nilable(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol))
@@ -967,8 +967,8 @@ module Orb
967
967
  # billing cycle day will not be updated. Note that overlapping price intervals
968
968
  # must have the same billing cycle day.
969
969
  billing_cycle_day: nil,
970
- # The updated end date of this price interval. If not specified, the start date
971
- # will not be updated.
970
+ # The updated end date of this price interval. If not specified, the end date will
971
+ # not be updated.
972
972
  end_date: nil,
973
973
  # An additional filter to apply to usage queries. This filter must be expressed as
974
974
  # a boolean
@@ -1014,8 +1014,8 @@ module Orb
1014
1014
  def to_hash
1015
1015
  end
1016
1016
 
1017
- # The updated end date of this price interval. If not specified, the start date
1018
- # will not be updated.
1017
+ # The updated end date of this price interval. If not specified, the end date will
1018
+ # not be updated.
1019
1019
  module EndDate
1020
1020
  extend Orb::Internal::Type::Union
1021
1021
 
@@ -1105,8 +1105,8 @@ module Orb
1105
1105
  sig { returns(String) }
1106
1106
  attr_accessor :adjustment_interval_id
1107
1107
 
1108
- # The updated end date of this adjustment interval. If not specified, the start
1109
- # date will not be updated.
1108
+ # The updated end date of this adjustment interval. If not specified, the end date
1109
+ # will not be updated.
1110
1110
  sig do
1111
1111
  returns(
1112
1112
  T.nilable(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol))
@@ -1141,8 +1141,8 @@ module Orb
1141
1141
  def self.new(
1142
1142
  # The id of the adjustment interval to edit.
1143
1143
  adjustment_interval_id:,
1144
- # The updated end date of this adjustment interval. If not specified, the start
1145
- # date will not be updated.
1144
+ # The updated end date of this adjustment interval. If not specified, the end date
1145
+ # will not be updated.
1146
1146
  end_date: nil,
1147
1147
  # The updated start date of this adjustment interval. If not specified, the start
1148
1148
  # date will not be updated.
@@ -1163,8 +1163,8 @@ module Orb
1163
1163
  def to_hash
1164
1164
  end
1165
1165
 
1166
- # The updated end date of this adjustment interval. If not specified, the start
1167
- # date will not be updated.
1166
+ # The updated end date of this adjustment interval. If not specified, the end date
1167
+ # will not be updated.
1168
1168
  module EndDate
1169
1169
  extend Orb::Internal::Type::Union
1170
1170
 
@@ -5,11 +5,38 @@ module Orb
5
5
  class CreditNotes
6
6
  # This endpoint is used to create a single
7
7
  # [`Credit Note`](/invoicing/credit-notes).
8
+ #
9
+ # The credit note service period configuration supports two explicit modes:
10
+ #
11
+ # 1. Global service periods: Specify start_date and end_date at the credit note
12
+ # level. These dates will be applied to all line items uniformly.
13
+ #
14
+ # 2. Individual service periods: Specify start_date and end_date for each line
15
+ # item. When using this mode, ALL line items must have individual periods
16
+ # specified.
17
+ #
18
+ # 3. Default behavior: If no service periods are specified (neither global nor
19
+ # individual), the original invoice line item service periods will be used.
20
+ #
21
+ # Note: Mixing global and individual service periods in the same request is not
22
+ # allowed to prevent confusion.
23
+ #
24
+ # Service period dates are normalized to the start of the day in the customer's
25
+ # timezone to ensure consistent handling across different timezones.
26
+ #
27
+ # Date Format: Use start_date and end_date with format "YYYY-MM-DD" (e.g.,
28
+ # "2023-09-22") to match other Orb APIs like /v1/invoice_line_items.
29
+ #
30
+ # Note: Both start_date and end_date are inclusive - the service period will cover
31
+ # both the start date and end date completely (from start of start_date to end of
32
+ # end_date).
8
33
  sig do
9
34
  params(
10
35
  line_items: T::Array[Orb::CreditNoteCreateParams::LineItem::OrHash],
11
36
  reason: Orb::CreditNoteCreateParams::Reason::OrSymbol,
37
+ end_date: T.nilable(Date),
12
38
  memo: T.nilable(String),
39
+ start_date: T.nilable(Date),
13
40
  request_options: Orb::RequestOptions::OrHash
14
41
  ).returns(Orb::CreditNote)
15
42
  end
@@ -17,8 +44,18 @@ module Orb
17
44
  line_items:,
18
45
  # An optional reason for the credit note.
19
46
  reason:,
47
+ # A date string to specify the global credit note service period end date in the
48
+ # customer's timezone. This will be applied to all line items that don't have
49
+ # their own individual service periods specified. If not provided, line items will
50
+ # use their original invoice line item service periods. This date is inclusive.
51
+ end_date: nil,
20
52
  # An optional memo to attach to the credit note.
21
53
  memo: nil,
54
+ # A date string to specify the global credit note service period start date in the
55
+ # customer's timezone. This will be applied to all line items that don't have
56
+ # their own individual service periods specified. If not provided, line items will
57
+ # use their original invoice line item service periods. This date is inclusive.
58
+ start_date: nil,
22
59
  request_options: {}
23
60
  )
24
61
  end
@@ -57,17 +57,17 @@ module Orb
57
57
  #
58
58
  # A customer that uses a few API calls a day but has a minimum commitment might
59
59
  # exhibit the following pattern for their subtotal and total in the first few days
60
- # of the month. Here, we assume that each API call is $2.50, the customer's plan
61
- # has a monthly minimum of $50 for this price, and that the subscription's billing
62
- # period bounds are aligned to the first of the month:
60
+ # of the month. Here, we assume that each API call is \$2.50, the customer's plan
61
+ # has a monthly minimum of \$50 for this price, and that the subscription's
62
+ # billing period bounds are aligned to the first of the month:
63
63
  #
64
64
  # | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) |
65
65
  # | --------------- | ------------- | ---------------- | -------- | ------------------------ |
66
- # | 2023-02-01 | 2023-02-02 | 9 | $22.50 | $50.00 |
67
- # | 2023-02-01 | 2023-02-03 | 19 | $47.50 | $50.00 |
68
- # | 2023-02-01 | 2023-02-04 | 20 | $50.00 | $50.00 |
69
- # | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 |
70
- # | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 |
66
+ # | 2023-02-01 | 2023-02-02 | 9 | \$22.50 | \$50.00 |
67
+ # | 2023-02-01 | 2023-02-03 | 19 | \$47.50 | \$50.00 |
68
+ # | 2023-02-01 | 2023-02-04 | 20 | \$50.00 | \$50.00 |
69
+ # | 2023-02-01 | 2023-02-05 | 28 | \$70.00 | \$70.00 |
70
+ # | 2023-02-01 | 2023-02-06 | 36 | \$90.00 | \$90.00 |
71
71
  #
72
72
  # ### Periodic values
73
73
  #
@@ -202,17 +202,17 @@ module Orb
202
202
  #
203
203
  # A customer that uses a few API calls a day but has a minimum commitment might
204
204
  # exhibit the following pattern for their subtotal and total in the first few days
205
- # of the month. Here, we assume that each API call is $2.50, the customer's plan
206
- # has a monthly minimum of $50 for this price, and that the subscription's billing
207
- # period bounds are aligned to the first of the month:
205
+ # of the month. Here, we assume that each API call is \$2.50, the customer's plan
206
+ # has a monthly minimum of \$50 for this price, and that the subscription's
207
+ # billing period bounds are aligned to the first of the month:
208
208
  #
209
209
  # | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) |
210
210
  # | --------------- | ------------- | ---------------- | -------- | ------------------------ |
211
- # | 2023-02-01 | 2023-02-02 | 9 | $22.50 | $50.00 |
212
- # | 2023-02-01 | 2023-02-03 | 19 | $47.50 | $50.00 |
213
- # | 2023-02-01 | 2023-02-04 | 20 | $50.00 | $50.00 |
214
- # | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 |
215
- # | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 |
211
+ # | 2023-02-01 | 2023-02-02 | 9 | \$22.50 | \$50.00 |
212
+ # | 2023-02-01 | 2023-02-03 | 19 | \$47.50 | \$50.00 |
213
+ # | 2023-02-01 | 2023-02-04 | 20 | \$50.00 | \$50.00 |
214
+ # | 2023-02-01 | 2023-02-05 | 28 | \$70.00 | \$70.00 |
215
+ # | 2023-02-01 | 2023-02-06 | 36 | \$90.00 | \$90.00 |
216
216
  #
217
217
  # ### Periodic values
218
218
  #
@@ -43,8 +43,8 @@ module Orb
43
43
  # deductions take place from a non-expiring credit block.
44
44
  #
45
45
  # If there are multiple blocks with the same expiration date, Orb will deduct from
46
- # the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost
47
- # basis before paid credits with a $5.00 cost basis).
46
+ # the block with the _lower cost basis_ first (e.g. trial credits with a \$0 cost
47
+ # basis before paid credits with a \$5.00 cost basis).
48
48
  #
49
49
  # It's also possible for a single usage event's deduction to _span_ credit blocks.
50
50
  # In this case, Orb will deduct from the next block, ending at the credit block
@@ -528,8 +528,8 @@ module Orb
528
528
  # deductions take place from a non-expiring credit block.
529
529
  #
530
530
  # If there are multiple blocks with the same expiration date, Orb will deduct from
531
- # the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost
532
- # basis before paid credits with a $5.00 cost basis).
531
+ # the block with the _lower cost basis_ first (e.g. trial credits with a \$0 cost
532
+ # basis before paid credits with a \$5.00 cost basis).
533
533
  #
534
534
  # It's also possible for a single usage event's deduction to _span_ credit blocks.
535
535
  # In this case, Orb will deduct from the next block, ending at the credit block
@@ -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 =
@@ -93,6 +93,7 @@ module Orb
93
93
  {
94
94
  auto_collection: bool,
95
95
  net_terms: Integer,
96
+ invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?,
96
97
  memo: String?,
97
98
  require_successful_payment: bool
98
99
  }
@@ -102,6 +103,8 @@ module Orb
102
103
 
103
104
  attr_accessor net_terms: Integer
104
105
 
106
+ attr_accessor invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?
107
+
105
108
  attr_accessor memo: String?
106
109
 
107
110
  attr_reader require_successful_payment: bool?
@@ -111,6 +114,7 @@ module Orb
111
114
  def initialize: (
112
115
  auto_collection: bool,
113
116
  net_terms: Integer,
117
+ ?invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?,
114
118
  ?memo: String?,
115
119
  ?require_successful_payment: bool
116
120
  ) -> void
@@ -118,9 +122,18 @@ module Orb
118
122
  def to_hash: -> {
119
123
  auto_collection: bool,
120
124
  net_terms: Integer,
125
+ invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?,
121
126
  memo: String?,
122
127
  require_successful_payment: bool
123
128
  }
129
+
130
+ type invoice_date = Date | Time
131
+
132
+ module InvoiceDate
133
+ extend Orb::Internal::Type::Union
134
+
135
+ def self?.variants: -> ::Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date]
136
+ end
124
137
  end
125
138
 
126
139
  type void_reason = :refund
@@ -93,6 +93,7 @@ module Orb
93
93
  {
94
94
  auto_collection: bool,
95
95
  net_terms: Integer,
96
+ invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?,
96
97
  memo: String?,
97
98
  require_successful_payment: bool
98
99
  }
@@ -102,6 +103,8 @@ module Orb
102
103
 
103
104
  attr_accessor net_terms: Integer
104
105
 
106
+ attr_accessor invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?
107
+
105
108
  attr_accessor memo: String?
106
109
 
107
110
  attr_reader require_successful_payment: bool?
@@ -111,6 +114,7 @@ module Orb
111
114
  def initialize: (
112
115
  auto_collection: bool,
113
116
  net_terms: Integer,
117
+ ?invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?,
114
118
  ?memo: String?,
115
119
  ?require_successful_payment: bool
116
120
  ) -> void
@@ -118,9 +122,18 @@ module Orb
118
122
  def to_hash: -> {
119
123
  auto_collection: bool,
120
124
  net_terms: Integer,
125
+ invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?,
121
126
  memo: String?,
122
127
  require_successful_payment: bool
123
128
  }
129
+
130
+ type invoice_date = Date | Time
131
+
132
+ module InvoiceDate
133
+ extend Orb::Internal::Type::Union
134
+
135
+ def self?.variants: -> ::Array[Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date]
136
+ end
124
137
  end
125
138
 
126
139
  type void_reason = :refund
@@ -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.3.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-04 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