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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b601ed5d994e78179694f51ebc0ba0b5311d69b34f79b2e7892c58041578856f
4
- data.tar.gz: a9b90fc941c06f7d73fd7ef1f4d14da454f565141f810477578fe12734c49149
3
+ metadata.gz: ee6b80e95c43c4a91835db318552bc9cf30795f853bb35d18a7a47f4b2bc4b98
4
+ data.tar.gz: c32cd239fd0486f158503b5228a38bd78fa7f75feca50955436e71205bdca207
5
5
  SHA512:
6
- metadata.gz: c17d93b30ccf78c9470d9afcf4b17c1e50e28eea2fb0e185ef9cd6096fbfffcb46f87f851e4df7e7917e3d15bc46f88f9809dadd980e1ac75a330c3000b4109a
7
- data.tar.gz: 14c41428f656ba2549fc47c7f0d726abaa5650d659f06360e21a17116ce4a408b2a93b16c823182e8e323ac165b3b281e08971cf8f570fc51fed2feed3552afd
6
+ metadata.gz: e7d87f338f886d159c571a2ce196fd2ab85f9f1a6e43c24f17f16f809f7de3c0e8784e7ff72cab0415b50f55e8f13529d2409742836d3381e5626ee86034a322
7
+ data.tar.gz: 0fbd5eb4c79d4b8e5f98b10cb310dbaf1c90ff4e5b1ec6d9a31867156d536b3c0a20dc1505027e7f668e0a177cfca1048225c86022b92f723c14d91482605a8d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.0 (2025-07-16)
4
+
5
+ Full Changelog: [v1.4.0...v1.5.0](https://github.com/orbcorp/orb-ruby/compare/v1.4.0...v1.5.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([6babc11](https://github.com/orbcorp/orb-ruby/commit/6babc11fcfb50389ab5139351ef28d14a5a08cab))
10
+
11
+
12
+ ### Chores
13
+
14
+ * **internal:** version bump ([acea921](https://github.com/orbcorp/orb-ruby/commit/acea9216388dc9412559385cd17ab64787780568))
15
+
16
+ ## 1.4.0 (2025-07-08)
17
+
18
+ Full Changelog: [v1.3.0...v1.4.0](https://github.com/orbcorp/orb-ruby/compare/v1.3.0...v1.4.0)
19
+
20
+ ### Features
21
+
22
+ * **api:** api update ([91c8454](https://github.com/orbcorp/orb-ruby/commit/91c8454800efbd06d7a4c4c3e6ded006c838dc57))
23
+
24
+
25
+ ### Chores
26
+
27
+ * **internal:** version bump ([be85139](https://github.com/orbcorp/orb-ruby/commit/be85139284c0f58aec01dd53cad4c11e4644171c))
28
+
3
29
  ## 1.3.0 (2025-07-04)
4
30
 
5
31
  Full Changelog: [v1.2.2...v1.3.0](https://github.com/orbcorp/orb-ruby/compare/v1.2.2...v1.3.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "orb-billing", "~> 1.3.0"
18
+ gem "orb-billing", "~> 1.5.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -181,7 +181,19 @@ module Orb
181
181
  # @return [Array<Orb::Models::CreditNote::LineItem::Discount>, nil]
182
182
  optional :discounts, -> { Orb::Internal::Type::ArrayOf[Orb::CreditNote::LineItem::Discount] }
183
183
 
184
- # @!method initialize(id:, amount:, item_id:, name:, quantity:, subtotal:, tax_amounts:, discounts: nil)
184
+ # @!attribute end_time_exclusive
185
+ # The end time of the service period for this credit note line item.
186
+ #
187
+ # @return [Time, nil]
188
+ optional :end_time_exclusive, Time, nil?: true
189
+
190
+ # @!attribute start_time_inclusive
191
+ # The start time of the service period for this credit note line item.
192
+ #
193
+ # @return [Time, nil]
194
+ optional :start_time_inclusive, Time, nil?: true
195
+
196
+ # @!method initialize(id:, amount:, item_id:, name:, quantity:, subtotal:, tax_amounts:, discounts: nil, end_time_exclusive: nil, start_time_inclusive: nil)
185
197
  # @param id [String] The Orb id of this resource.
186
198
  #
187
199
  # @param amount [String] The amount of the line item, including any line item minimums and discounts.
@@ -197,6 +209,10 @@ module Orb
197
209
  # @param tax_amounts [Array<Orb::Models::TaxAmount>] Any tax amounts applied onto the line item.
198
210
  #
199
211
  # @param discounts [Array<Orb::Models::CreditNote::LineItem::Discount>] Any line item discounts from the invoice's line item.
212
+ #
213
+ # @param end_time_exclusive [Time, nil] The end time of the service period for this credit note line item.
214
+ #
215
+ # @param start_time_inclusive [Time, nil] The start time of the service period for this credit note line item.
200
216
 
201
217
  class Discount < Orb::Internal::Type::BaseModel
202
218
  # @!attribute id
@@ -18,19 +18,44 @@ module Orb
18
18
  # @return [Symbol, Orb::Models::CreditNoteCreateParams::Reason]
19
19
  required :reason, enum: -> { Orb::CreditNoteCreateParams::Reason }
20
20
 
21
+ # @!attribute end_date
22
+ # A date string to specify the global credit note service period end date in the
23
+ # customer's timezone. This will be applied to all line items that don't have
24
+ # their own individual service periods specified. If not provided, line items will
25
+ # use their original invoice line item service periods. This date is inclusive.
26
+ #
27
+ # @return [Date, nil]
28
+ optional :end_date, Date, nil?: true
29
+
21
30
  # @!attribute memo
22
31
  # An optional memo to attach to the credit note.
23
32
  #
24
33
  # @return [String, nil]
25
34
  optional :memo, String, nil?: true
26
35
 
27
- # @!method initialize(line_items:, reason:, memo: nil, request_options: {})
36
+ # @!attribute start_date
37
+ # A date string to specify the global credit note service period start date in the
38
+ # customer's timezone. This will be applied to all line items that don't have
39
+ # their own individual service periods specified. If not provided, line items will
40
+ # use their original invoice line item service periods. This date is inclusive.
41
+ #
42
+ # @return [Date, nil]
43
+ optional :start_date, Date, nil?: true
44
+
45
+ # @!method initialize(line_items:, reason:, end_date: nil, memo: nil, start_date: nil, request_options: {})
46
+ # Some parameter documentations has been truncated, see
47
+ # {Orb::Models::CreditNoteCreateParams} for more details.
48
+ #
28
49
  # @param line_items [Array<Orb::Models::CreditNoteCreateParams::LineItem>]
29
50
  #
30
51
  # @param reason [Symbol, Orb::Models::CreditNoteCreateParams::Reason] An optional reason for the credit note.
31
52
  #
53
+ # @param end_date [Date, nil] A date string to specify the global credit note service period end date in the c
54
+ #
32
55
  # @param memo [String, nil] An optional memo to attach to the credit note.
33
56
  #
57
+ # @param start_date [Date, nil] A date string to specify the global credit note service period start date in the
58
+ #
34
59
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
35
60
 
36
61
  class LineItem < Orb::Internal::Type::BaseModel
@@ -46,10 +71,36 @@ module Orb
46
71
  # @return [String]
47
72
  required :invoice_line_item_id, String
48
73
 
49
- # @!method initialize(amount:, invoice_line_item_id:)
74
+ # @!attribute end_date
75
+ # A date string to specify this line item's credit note service period end date in
76
+ # the customer's timezone. If provided, this will be used for this specific line
77
+ # item. If not provided, will use the global end_date if available, otherwise
78
+ # defaults to the original invoice line item's end date. This date is inclusive.
79
+ #
80
+ # @return [Date, nil]
81
+ optional :end_date, Date, nil?: true
82
+
83
+ # @!attribute start_date
84
+ # A date string to specify this line item's credit note service period start date
85
+ # in the customer's timezone. If provided, this will be used for this specific
86
+ # line item. If not provided, will use the global start_date if available,
87
+ # otherwise defaults to the original invoice line item's start date. This date is
88
+ # inclusive.
89
+ #
90
+ # @return [Date, nil]
91
+ optional :start_date, Date, nil?: true
92
+
93
+ # @!method initialize(amount:, invoice_line_item_id:, end_date: nil, start_date: nil)
94
+ # Some parameter documentations has been truncated, see
95
+ # {Orb::Models::CreditNoteCreateParams::LineItem} for more details.
96
+ #
50
97
  # @param amount [String] The total amount in the invoice's currency to credit this line item.
51
98
  #
52
99
  # @param invoice_line_item_id [String] The ID of the line item to credit.
100
+ #
101
+ # @param end_date [Date, nil] A date string to specify this line item's credit note service period end date in
102
+ #
103
+ # @param start_date [Date, nil] A date string to specify this line item's credit note service period start date
53
104
  end
54
105
 
55
106
  # An optional reason for the credit note.
@@ -156,6 +156,18 @@ module Orb
156
156
  # @return [Integer]
157
157
  required :net_terms, Integer
158
158
 
159
+ # @!attribute invoice_date
160
+ # An ISO 8601 format date that denotes when this invoice should be dated in the
161
+ # customer's timezone. If not provided, the invoice date will default to the
162
+ # credit block's effective date.
163
+ #
164
+ # @return [Date, Time, nil]
165
+ optional :invoice_date,
166
+ union: -> {
167
+ Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::InvoiceDate
168
+ },
169
+ nil?: true
170
+
159
171
  # @!attribute memo
160
172
  # An optional memo to display on the invoice.
161
173
  #
@@ -169,7 +181,7 @@ module Orb
169
181
  # @return [Boolean, nil]
170
182
  optional :require_successful_payment, Orb::Internal::Type::Boolean
171
183
 
172
- # @!method initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil)
184
+ # @!method initialize(auto_collection:, net_terms:, invoice_date: nil, memo: nil, require_successful_payment: nil)
173
185
  # Some parameter documentations has been truncated, see
174
186
  # {Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings}
175
187
  # for more details.
@@ -183,9 +195,27 @@ module Orb
183
195
  #
184
196
  # @param net_terms [Integer] The net terms determines the difference between the invoice date and the issue d
185
197
  #
198
+ # @param invoice_date [Date, Time, nil] An ISO 8601 format date that denotes when this invoice should be dated in the cu
199
+ #
186
200
  # @param memo [String, nil] An optional memo to display on the invoice.
187
201
  #
188
202
  # @param require_successful_payment [Boolean] If true, the new credit block will require that the corresponding invoice is pai
203
+
204
+ # An ISO 8601 format date that denotes when this invoice should be dated in the
205
+ # customer's timezone. If not provided, the invoice date will default to the
206
+ # credit block's effective date.
207
+ #
208
+ # @see Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings#invoice_date
209
+ module InvoiceDate
210
+ extend Orb::Internal::Type::Union
211
+
212
+ variant Date
213
+
214
+ variant Time
215
+
216
+ # @!method self.variants
217
+ # @return [Array(Date, Time)]
218
+ end
189
219
  end
190
220
 
191
221
  # Can only be specified when `entry_type=void`. The reason for the void.
@@ -152,6 +152,18 @@ module Orb
152
152
  # @return [Integer]
153
153
  required :net_terms, Integer
154
154
 
155
+ # @!attribute invoice_date
156
+ # An ISO 8601 format date that denotes when this invoice should be dated in the
157
+ # customer's timezone. If not provided, the invoice date will default to the
158
+ # credit block's effective date.
159
+ #
160
+ # @return [Date, Time, nil]
161
+ optional :invoice_date,
162
+ union: -> {
163
+ Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::InvoiceDate
164
+ },
165
+ nil?: true
166
+
155
167
  # @!attribute memo
156
168
  # An optional memo to display on the invoice.
157
169
  #
@@ -165,7 +177,7 @@ module Orb
165
177
  # @return [Boolean, nil]
166
178
  optional :require_successful_payment, Orb::Internal::Type::Boolean
167
179
 
168
- # @!method initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil)
180
+ # @!method initialize(auto_collection:, net_terms:, invoice_date: nil, memo: nil, require_successful_payment: nil)
169
181
  # Some parameter documentations has been truncated, see
170
182
  # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings} for
171
183
  # more details.
@@ -179,9 +191,27 @@ module Orb
179
191
  #
180
192
  # @param net_terms [Integer] The net terms determines the difference between the invoice date and the issue d
181
193
  #
194
+ # @param invoice_date [Date, Time, nil] An ISO 8601 format date that denotes when this invoice should be dated in the cu
195
+ #
182
196
  # @param memo [String, nil] An optional memo to display on the invoice.
183
197
  #
184
198
  # @param require_successful_payment [Boolean] If true, the new credit block will require that the corresponding invoice is pai
199
+
200
+ # An ISO 8601 format date that denotes when this invoice should be dated in the
201
+ # customer's timezone. If not provided, the invoice date will default to the
202
+ # credit block's effective date.
203
+ #
204
+ # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings#invoice_date
205
+ module InvoiceDate
206
+ extend Orb::Internal::Type::Union
207
+
208
+ variant Date
209
+
210
+ variant Time
211
+
212
+ # @!method self.variants
213
+ # @return [Array(Date, Time)]
214
+ end
185
215
  end
186
216
 
187
217
  # Can only be specified when `entry_type=void`. The reason for the void.
@@ -10,7 +10,7 @@ module Orb
10
10
 
11
11
  # @!attribute timeframe_end
12
12
  # The (exclusive) end of the usage timeframe affected by this backfill. By
13
- # default, Orb allows backfills up to 10 days in duration at a time. Reach out to
13
+ # default, Orb allows backfills up to 31 days in duration at a time. Reach out to
14
14
  # discuss extending this limit and your use case.
15
15
  #
16
16
  # @return [Time]
@@ -18,7 +18,7 @@ module Orb
18
18
 
19
19
  # @!attribute timeframe_start
20
20
  # The (inclusive) start of the usage timeframe affected by this backfill. By
21
- # default, Orb allows backfills up to 10 days in duration at a time. Reach out to
21
+ # default, Orb allows backfills up to 31 days in duration at a time. Reach out to
22
22
  # discuss extending this limit and your use case.
23
23
  #
24
24
  # @return [Time]
@@ -98,7 +98,8 @@ module Orb
98
98
  # @!attribute discount_intervals
99
99
  # @deprecated
100
100
  #
101
- # The discount intervals for this subscription sorted by the start_date.
101
+ # The discount intervals for this subscription sorted by the start_date. This
102
+ # field is deprecated in favor of `adjustment_intervals`.
102
103
  #
103
104
  # @return [Array<Orb::Models::AmountDiscountInterval, Orb::Models::PercentageDiscountInterval, Orb::Models::UsageDiscountInterval>]
104
105
  required :discount_intervals,
@@ -124,7 +125,8 @@ module Orb
124
125
  # @!attribute maximum_intervals
125
126
  # @deprecated
126
127
  #
127
- # The maximum intervals for this subscription sorted by the start_date.
128
+ # The maximum intervals for this subscription sorted by the start_date. This field
129
+ # is deprecated in favor of `adjustment_intervals`.
128
130
  #
129
131
  # @return [Array<Orb::Models::MaximumInterval>]
130
132
  required :maximum_intervals, -> { Orb::Internal::Type::ArrayOf[Orb::MaximumInterval] }
@@ -141,7 +143,8 @@ module Orb
141
143
  # @!attribute minimum_intervals
142
144
  # @deprecated
143
145
  #
144
- # The minimum intervals for this subscription sorted by the start_date.
146
+ # The minimum intervals for this subscription sorted by the start_date. This field
147
+ # is deprecated in favor of `adjustment_intervals`.
145
148
  #
146
149
  # @return [Array<Orb::Models::MinimumInterval>]
147
150
  required :minimum_intervals, -> { Orb::Internal::Type::ArrayOf[Orb::MinimumInterval] }
@@ -237,7 +240,7 @@ module Orb
237
240
  #
238
241
  # @param default_invoice_memo [String, nil] Determines the default memo on this subscriptions' invoices. Note that if this i
239
242
  #
240
- # @param discount_intervals [Array<Orb::Models::AmountDiscountInterval, Orb::Models::PercentageDiscountInterval, Orb::Models::UsageDiscountInterval>] The discount intervals for this subscription sorted by the start_date.
243
+ # @param discount_intervals [Array<Orb::Models::AmountDiscountInterval, Orb::Models::PercentageDiscountInterval, Orb::Models::UsageDiscountInterval>] The discount intervals for this subscription sorted by the start_date. This fiel
241
244
  #
242
245
  # @param end_date [Time, nil] The date Orb stops billing for this subscription.
243
246
  #
@@ -245,11 +248,11 @@ module Orb
245
248
  #
246
249
  # @param invoicing_threshold [String, nil]
247
250
  #
248
- # @param maximum_intervals [Array<Orb::Models::MaximumInterval>] The maximum intervals for this subscription sorted by the start_date.
251
+ # @param maximum_intervals [Array<Orb::Models::MaximumInterval>] The maximum intervals for this subscription sorted by the start_date. This field
249
252
  #
250
253
  # @param metadata [Hash{Symbol=>String}] User specified key-value pairs for the resource. If not present, this defaults t
251
254
  #
252
- # @param minimum_intervals [Array<Orb::Models::MinimumInterval>] The minimum intervals for this subscription sorted by the start_date.
255
+ # @param minimum_intervals [Array<Orb::Models::MinimumInterval>] The minimum intervals for this subscription sorted by the start_date. This field
253
256
  #
254
257
  # @param name [String] The name of the subscription.
255
258
  #
@@ -52,6 +52,12 @@ module Orb
52
52
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
53
53
 
54
54
  class PriceEvaluation < Orb::Internal::Type::BaseModel
55
+ # @!attribute external_price_id
56
+ # The external ID of a price to evaluate that exists in your Orb account.
57
+ #
58
+ # @return [String, nil]
59
+ optional :external_price_id, String, nil?: true
60
+
55
61
  # @!attribute filter
56
62
  # A boolean
57
63
  # [computed property](/extensibility/advanced-metrics#computed-properties) used to
@@ -81,10 +87,12 @@ module Orb
81
87
  # @return [String, nil]
82
88
  optional :price_id, String, nil?: true
83
89
 
84
- # @!method initialize(filter: nil, grouping_keys: nil, price: nil, price_id: nil)
90
+ # @!method initialize(external_price_id: nil, filter: nil, grouping_keys: nil, price: nil, price_id: nil)
85
91
  # Some parameter documentations has been truncated, see
86
92
  # {Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation} for more details.
87
93
  #
94
+ # @param external_price_id [String, nil] The external ID of a price to evaluate that exists in your Orb account.
95
+ #
88
96
  # @param filter [String, nil] A boolean [computed property](/extensibility/advanced-metrics#computed-propertie
89
97
  #
90
98
  # @param grouping_keys [Array<String>] Properties (or [computed properties](/extensibility/advanced-metrics#computed-pr
@@ -25,6 +25,12 @@ module Orb
25
25
  # @return [Array<Orb::Models::EvaluatePriceGroup>]
26
26
  required :price_groups, -> { Orb::Internal::Type::ArrayOf[Orb::EvaluatePriceGroup] }
27
27
 
28
+ # @!attribute external_price_id
29
+ # The external ID of the price
30
+ #
31
+ # @return [String, nil]
32
+ optional :external_price_id, String, nil?: true
33
+
28
34
  # @!attribute inline_price_index
29
35
  # The index of the inline price
30
36
  #
@@ -37,11 +43,13 @@ module Orb
37
43
  # @return [String, nil]
38
44
  optional :price_id, String, nil?: true
39
45
 
40
- # @!method initialize(currency:, price_groups:, inline_price_index: nil, price_id: nil)
46
+ # @!method initialize(currency:, price_groups:, external_price_id: nil, inline_price_index: nil, price_id: nil)
41
47
  # @param currency [String] The currency of the price
42
48
  #
43
49
  # @param price_groups [Array<Orb::Models::EvaluatePriceGroup>] The computed price groups associated with input price.
44
50
  #
51
+ # @param external_price_id [String, nil] The external ID of the price
52
+ #
45
53
  # @param inline_price_index [Integer, nil] The index of the inline price
46
54
  #
47
55
  # @param price_id [String, nil] The ID of the price
@@ -110,6 +110,12 @@ module Orb
110
110
  end
111
111
 
112
112
  class PriceEvaluation < Orb::Internal::Type::BaseModel
113
+ # @!attribute external_price_id
114
+ # The external ID of a price to evaluate that exists in your Orb account.
115
+ #
116
+ # @return [String, nil]
117
+ optional :external_price_id, String, nil?: true
118
+
113
119
  # @!attribute filter
114
120
  # A boolean
115
121
  # [computed property](/extensibility/advanced-metrics#computed-properties) used to
@@ -143,11 +149,13 @@ module Orb
143
149
  # @return [String, nil]
144
150
  optional :price_id, String, nil?: true
145
151
 
146
- # @!method initialize(filter: nil, grouping_keys: nil, price: nil, price_id: nil)
152
+ # @!method initialize(external_price_id: nil, filter: nil, grouping_keys: nil, price: nil, price_id: nil)
147
153
  # Some parameter documentations has been truncated, see
148
154
  # {Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation} for more
149
155
  # details.
150
156
  #
157
+ # @param external_price_id [String, nil] The external ID of a price to evaluate that exists in your Orb account.
158
+ #
151
159
  # @param filter [String, nil] A boolean [computed property](/extensibility/advanced-metrics#computed-propertie
152
160
  #
153
161
  # @param grouping_keys [Array<String>] Properties (or [computed properties](/extensibility/advanced-metrics#computed-pr
@@ -25,6 +25,12 @@ module Orb
25
25
  # @return [Array<Orb::Models::EvaluatePriceGroup>]
26
26
  required :price_groups, -> { Orb::Internal::Type::ArrayOf[Orb::EvaluatePriceGroup] }
27
27
 
28
+ # @!attribute external_price_id
29
+ # The external ID of the price
30
+ #
31
+ # @return [String, nil]
32
+ optional :external_price_id, String, nil?: true
33
+
28
34
  # @!attribute inline_price_index
29
35
  # The index of the inline price
30
36
  #
@@ -37,11 +43,13 @@ module Orb
37
43
  # @return [String, nil]
38
44
  optional :price_id, String, nil?: true
39
45
 
40
- # @!method initialize(currency:, price_groups:, inline_price_index: nil, price_id: nil)
46
+ # @!method initialize(currency:, price_groups:, external_price_id: nil, inline_price_index: nil, price_id: nil)
41
47
  # @param currency [String] The currency of the price
42
48
  #
43
49
  # @param price_groups [Array<Orb::Models::EvaluatePriceGroup>] The computed price groups associated with input price.
44
50
  #
51
+ # @param external_price_id [String, nil] The external ID of the price
52
+ #
45
53
  # @param inline_price_index [Integer, nil] The index of the inline price
46
54
  #
47
55
  # @param price_id [String, nil] The ID of the price
@@ -99,7 +99,8 @@ module Orb
99
99
  # @!attribute discount_intervals
100
100
  # @deprecated
101
101
  #
102
- # The discount intervals for this subscription sorted by the start_date.
102
+ # The discount intervals for this subscription sorted by the start_date. This
103
+ # field is deprecated in favor of `adjustment_intervals`.
103
104
  #
104
105
  # @return [Array<Orb::Models::AmountDiscountInterval, Orb::Models::PercentageDiscountInterval, Orb::Models::UsageDiscountInterval>]
105
106
  required :discount_intervals,
@@ -125,7 +126,8 @@ module Orb
125
126
  # @!attribute maximum_intervals
126
127
  # @deprecated
127
128
  #
128
- # The maximum intervals for this subscription sorted by the start_date.
129
+ # The maximum intervals for this subscription sorted by the start_date. This field
130
+ # is deprecated in favor of `adjustment_intervals`.
129
131
  #
130
132
  # @return [Array<Orb::Models::MaximumInterval>]
131
133
  required :maximum_intervals, -> { Orb::Internal::Type::ArrayOf[Orb::MaximumInterval] }
@@ -142,7 +144,8 @@ module Orb
142
144
  # @!attribute minimum_intervals
143
145
  # @deprecated
144
146
  #
145
- # The minimum intervals for this subscription sorted by the start_date.
147
+ # The minimum intervals for this subscription sorted by the start_date. This field
148
+ # is deprecated in favor of `adjustment_intervals`.
146
149
  #
147
150
  # @return [Array<Orb::Models::MinimumInterval>]
148
151
  required :minimum_intervals, -> { Orb::Internal::Type::ArrayOf[Orb::MinimumInterval] }
@@ -250,7 +253,7 @@ module Orb
250
253
  #
251
254
  # @param default_invoice_memo [String, nil] Determines the default memo on this subscriptions' invoices. Note that if this i
252
255
  #
253
- # @param discount_intervals [Array<Orb::Models::AmountDiscountInterval, Orb::Models::PercentageDiscountInterval, Orb::Models::UsageDiscountInterval>] The discount intervals for this subscription sorted by the start_date.
256
+ # @param discount_intervals [Array<Orb::Models::AmountDiscountInterval, Orb::Models::PercentageDiscountInterval, Orb::Models::UsageDiscountInterval>] The discount intervals for this subscription sorted by the start_date. This fiel
254
257
  #
255
258
  # @param end_date [Time, nil] The date Orb stops billing for this subscription.
256
259
  #
@@ -258,11 +261,11 @@ module Orb
258
261
  #
259
262
  # @param invoicing_threshold [String, nil]
260
263
  #
261
- # @param maximum_intervals [Array<Orb::Models::MaximumInterval>] The maximum intervals for this subscription sorted by the start_date.
264
+ # @param maximum_intervals [Array<Orb::Models::MaximumInterval>] The maximum intervals for this subscription sorted by the start_date. This field
262
265
  #
263
266
  # @param metadata [Hash{Symbol=>String}] User specified key-value pairs for the resource. If not present, this defaults t
264
267
  #
265
- # @param minimum_intervals [Array<Orb::Models::MinimumInterval>] The minimum intervals for this subscription sorted by the start_date.
268
+ # @param minimum_intervals [Array<Orb::Models::MinimumInterval>] The minimum intervals for this subscription sorted by the start_date. This field
266
269
  #
267
270
  # @param name [String] The name of the subscription.
268
271
  #
@@ -491,8 +491,8 @@ module Orb
491
491
  optional :billing_cycle_day, Integer, nil?: true
492
492
 
493
493
  # @!attribute end_date
494
- # The updated end date of this price interval. If not specified, the start date
495
- # will not be updated.
494
+ # The updated end date of this price interval. If not specified, the end date will
495
+ # not be updated.
496
496
  #
497
497
  # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil]
498
498
  optional :end_date, union: -> { Orb::SubscriptionPriceIntervalsParams::Edit::EndDate }, nil?: true
@@ -544,7 +544,7 @@ module Orb
544
544
  #
545
545
  # @param billing_cycle_day [Integer, nil] The updated billing cycle day for this price interval. If not specified, the bil
546
546
  #
547
- # @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] The updated end date of this price interval. If not specified, the start date wi
547
+ # @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] The updated end date of this price interval. If not specified, the end date will
548
548
  #
549
549
  # @param filter [String, nil] An additional filter to apply to usage queries. This filter must be expressed as
550
550
  #
@@ -554,8 +554,8 @@ module Orb
554
554
  #
555
555
  # @param usage_customer_ids [Array<String>, nil] A list of customer IDs whose usage events will be aggregated and billed under th
556
556
 
557
- # The updated end date of this price interval. If not specified, the start date
558
- # will not be updated.
557
+ # The updated end date of this price interval. If not specified, the end date will
558
+ # not be updated.
559
559
  #
560
560
  # @see Orb::Models::SubscriptionPriceIntervalsParams::Edit#end_date
561
561
  module EndDate
@@ -612,8 +612,8 @@ module Orb
612
612
  required :adjustment_interval_id, String
613
613
 
614
614
  # @!attribute end_date
615
- # The updated end date of this adjustment interval. If not specified, the start
616
- # date will not be updated.
615
+ # The updated end date of this adjustment interval. If not specified, the end date
616
+ # will not be updated.
617
617
  #
618
618
  # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil]
619
619
  optional :end_date,
@@ -634,12 +634,12 @@ module Orb
634
634
  #
635
635
  # @param adjustment_interval_id [String] The id of the adjustment interval to edit.
636
636
  #
637
- # @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] The updated end date of this adjustment interval. If not specified, the start da
637
+ # @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] The updated end date of this adjustment interval. If not specified, the end date
638
638
  #
639
639
  # @param start_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate] The updated start date of this adjustment interval. If not specified, the start
640
640
 
641
- # The updated end date of this adjustment interval. If not specified, the start
642
- # date will not be updated.
641
+ # The updated end date of this adjustment interval. If not specified, the end date
642
+ # will not be updated.
643
643
  #
644
644
  # @see Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment#end_date
645
645
  module EndDate
@@ -3,17 +3,49 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class CreditNotes
6
+ # Some parameter documentations has been truncated, see
7
+ # {Orb::Models::CreditNoteCreateParams} for more details.
8
+ #
6
9
  # This endpoint is used to create a single
7
10
  # [`Credit Note`](/invoicing/credit-notes).
8
11
  #
9
- # @overload create(line_items:, reason:, memo: nil, request_options: {})
12
+ # The credit note service period configuration supports two explicit modes:
13
+ #
14
+ # 1. Global service periods: Specify start_date and end_date at the credit note
15
+ # level. These dates will be applied to all line items uniformly.
16
+ #
17
+ # 2. Individual service periods: Specify start_date and end_date for each line
18
+ # item. When using this mode, ALL line items must have individual periods
19
+ # specified.
20
+ #
21
+ # 3. Default behavior: If no service periods are specified (neither global nor
22
+ # individual), the original invoice line item service periods will be used.
23
+ #
24
+ # Note: Mixing global and individual service periods in the same request is not
25
+ # allowed to prevent confusion.
26
+ #
27
+ # Service period dates are normalized to the start of the day in the customer's
28
+ # timezone to ensure consistent handling across different timezones.
29
+ #
30
+ # Date Format: Use start_date and end_date with format "YYYY-MM-DD" (e.g.,
31
+ # "2023-09-22") to match other Orb APIs like /v1/invoice_line_items.
32
+ #
33
+ # Note: Both start_date and end_date are inclusive - the service period will cover
34
+ # both the start date and end date completely (from start of start_date to end of
35
+ # end_date).
36
+ #
37
+ # @overload create(line_items:, reason:, end_date: nil, memo: nil, start_date: nil, request_options: {})
10
38
  #
11
39
  # @param line_items [Array<Orb::Models::CreditNoteCreateParams::LineItem>]
12
40
  #
13
41
  # @param reason [Symbol, Orb::Models::CreditNoteCreateParams::Reason] An optional reason for the credit note.
14
42
  #
43
+ # @param end_date [Date, nil] A date string to specify the global credit note service period end date in the c
44
+ #
15
45
  # @param memo [String, nil] An optional memo to attach to the credit note.
16
46
  #
47
+ # @param start_date [Date, nil] A date string to specify the global credit note service period start date in the
48
+ #
17
49
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
18
50
  #
19
51
  # @return [Orb::Models::CreditNote]