orb-billing 1.58.0 → 1.59.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/orb/models/invoice_list_params.rb +12 -11
  5. data/lib/orb/models/invoice_list_summary_params.rb +12 -11
  6. data/lib/orb/models/invoice_status_filter.rb +18 -0
  7. data/lib/orb/models/subscription_list_params.rb +52 -15
  8. data/lib/orb/models/subscription_list_summary_params.rb +50 -15
  9. data/lib/orb/models/subscription_status_filter.rb +16 -0
  10. data/lib/orb/models.rb +4 -0
  11. data/lib/orb/resources/customers/credits/ledger.rb +56 -0
  12. data/lib/orb/resources/invoices.rb +16 -2
  13. data/lib/orb/resources/subscriptions.rb +6 -6
  14. data/lib/orb/version.rb +1 -1
  15. data/lib/orb.rb +2 -0
  16. data/rbi/orb/models/invoice_list_params.rbi +37 -17
  17. data/rbi/orb/models/invoice_list_summary_params.rbi +38 -18
  18. data/rbi/orb/models/invoice_status_filter.rbi +22 -0
  19. data/rbi/orb/models/subscription_list_params.rbi +100 -21
  20. data/rbi/orb/models/subscription_list_summary_params.rbi +99 -28
  21. data/rbi/orb/models/subscription_status_filter.rbi +23 -0
  22. data/rbi/orb/models.rbi +4 -0
  23. data/rbi/orb/resources/customers/credits/ledger.rbi +56 -0
  24. data/rbi/orb/resources/invoices.rbi +28 -2
  25. data/rbi/orb/resources/subscriptions.rbi +25 -6
  26. data/sig/orb/models/invoice_list_params.rbs +10 -12
  27. data/sig/orb/models/invoice_list_summary_params.rbs +6 -8
  28. data/sig/orb/models/invoice_status_filter.rbs +17 -0
  29. data/sig/orb/models/subscription_list_params.rbs +34 -14
  30. data/sig/orb/models/subscription_list_summary_params.rbs +34 -14
  31. data/sig/orb/models/subscription_status_filter.rbs +15 -0
  32. data/sig/orb/models.rbs +4 -0
  33. data/sig/orb/resources/invoices.rbs +1 -1
  34. data/sig/orb/resources/subscriptions.rbs +4 -4
  35. metadata +7 -1
@@ -75,7 +75,14 @@ module Orb
75
75
  attr_writer :limit
76
76
 
77
77
  sig do
78
- returns(T.nilable(Orb::InvoiceListSummaryParams::Status::OrSymbol))
78
+ returns(
79
+ T.nilable(
80
+ T.any(
81
+ Orb::InvoiceStatusFilter::OrSymbol,
82
+ T::Array[Orb::InvoiceStatusFilter::OrSymbol]
83
+ )
84
+ )
85
+ )
79
86
  end
80
87
  attr_accessor :status
81
88
 
@@ -102,7 +109,13 @@ module Orb
102
109
  invoice_date_lte: T.nilable(Time),
103
110
  is_recurring: T.nilable(T::Boolean),
104
111
  limit: Integer,
105
- status: T.nilable(Orb::InvoiceListSummaryParams::Status::OrSymbol),
112
+ status:
113
+ T.nilable(
114
+ T.any(
115
+ Orb::InvoiceStatusFilter::OrSymbol,
116
+ T::Array[Orb::InvoiceStatusFilter::OrSymbol]
117
+ )
118
+ ),
106
119
  subscription_id: T.nilable(String),
107
120
  request_options: Orb::RequestOptions::OrHash
108
121
  ).returns(T.attached_class)
@@ -159,7 +172,13 @@ module Orb
159
172
  invoice_date_lte: T.nilable(Time),
160
173
  is_recurring: T.nilable(T::Boolean),
161
174
  limit: Integer,
162
- status: T.nilable(Orb::InvoiceListSummaryParams::Status::OrSymbol),
175
+ status:
176
+ T.nilable(
177
+ T.any(
178
+ Orb::InvoiceStatusFilter::OrSymbol,
179
+ T::Array[Orb::InvoiceStatusFilter::OrSymbol]
180
+ )
181
+ ),
163
182
  subscription_id: T.nilable(String),
164
183
  request_options: Orb::RequestOptions
165
184
  }
@@ -198,28 +217,29 @@ module Orb
198
217
  end
199
218
 
200
219
  module Status
201
- extend Orb::Internal::Type::Enum
202
-
203
- TaggedSymbol =
204
- T.type_alias { T.all(Symbol, Orb::InvoiceListSummaryParams::Status) }
205
- OrSymbol = T.type_alias { T.any(Symbol, String) }
220
+ extend Orb::Internal::Type::Union
206
221
 
207
- DRAFT =
208
- T.let(:draft, Orb::InvoiceListSummaryParams::Status::TaggedSymbol)
209
- ISSUED =
210
- T.let(:issued, Orb::InvoiceListSummaryParams::Status::TaggedSymbol)
211
- PAID = T.let(:paid, Orb::InvoiceListSummaryParams::Status::TaggedSymbol)
212
- SYNCED =
213
- T.let(:synced, Orb::InvoiceListSummaryParams::Status::TaggedSymbol)
214
- VOID = T.let(:void, Orb::InvoiceListSummaryParams::Status::TaggedSymbol)
222
+ Variants =
223
+ T.type_alias do
224
+ T.any(
225
+ Orb::InvoiceStatusFilter::TaggedSymbol,
226
+ T::Array[Orb::InvoiceStatusFilter::TaggedSymbol]
227
+ )
228
+ end
215
229
 
216
230
  sig do
217
231
  override.returns(
218
- T::Array[Orb::InvoiceListSummaryParams::Status::TaggedSymbol]
232
+ T::Array[Orb::InvoiceListSummaryParams::Status::Variants]
219
233
  )
220
234
  end
221
- def self.values
235
+ def self.variants
222
236
  end
237
+
238
+ InvoiceStatusFilterArray =
239
+ T.let(
240
+ Orb::Internal::Type::ArrayOf[enum: Orb::InvoiceStatusFilter],
241
+ Orb::Internal::Type::Converter
242
+ )
223
243
  end
224
244
  end
225
245
  end
@@ -0,0 +1,22 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ module InvoiceStatusFilter
6
+ extend Orb::Internal::Type::Enum
7
+
8
+ TaggedSymbol = T.type_alias { T.all(Symbol, Orb::InvoiceStatusFilter) }
9
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
10
+
11
+ DRAFT = T.let(:draft, Orb::InvoiceStatusFilter::TaggedSymbol)
12
+ ISSUED = T.let(:issued, Orb::InvoiceStatusFilter::TaggedSymbol)
13
+ PAID = T.let(:paid, Orb::InvoiceStatusFilter::TaggedSymbol)
14
+ SYNCED = T.let(:synced, Orb::InvoiceStatusFilter::TaggedSymbol)
15
+ VOID = T.let(:void, Orb::InvoiceStatusFilter::TaggedSymbol)
16
+
17
+ sig { override.returns(T::Array[Orb::InvoiceStatusFilter::TaggedSymbol]) }
18
+ def self.values
19
+ end
20
+ end
21
+ end
22
+ end
@@ -28,10 +28,16 @@ module Orb
28
28
  sig { returns(T.nilable(String)) }
29
29
  attr_accessor :cursor
30
30
 
31
- sig { returns(T.nilable(T::Array[String])) }
31
+ sig do
32
+ returns(T.nilable(Orb::SubscriptionListParams::CustomerID::Variants))
33
+ end
32
34
  attr_accessor :customer_id
33
35
 
34
- sig { returns(T.nilable(T::Array[String])) }
36
+ sig do
37
+ returns(
38
+ T.nilable(Orb::SubscriptionListParams::ExternalCustomerID::Variants)
39
+ )
40
+ end
35
41
  attr_accessor :external_customer_id
36
42
 
37
43
  sig { returns(T.nilable(String)) }
@@ -47,7 +53,16 @@ module Orb
47
53
  sig { returns(T.nilable(String)) }
48
54
  attr_accessor :plan_id
49
55
 
50
- sig { returns(T.nilable(Orb::SubscriptionListParams::Status::OrSymbol)) }
56
+ sig do
57
+ returns(
58
+ T.nilable(
59
+ T.any(
60
+ Orb::SubscriptionStatusFilter::OrSymbol,
61
+ T::Array[Orb::SubscriptionStatusFilter::OrSymbol]
62
+ )
63
+ )
64
+ )
65
+ end
51
66
  attr_accessor :status
52
67
 
53
68
  sig do
@@ -57,12 +72,22 @@ module Orb
57
72
  created_at_lt: T.nilable(Time),
58
73
  created_at_lte: T.nilable(Time),
59
74
  cursor: T.nilable(String),
60
- customer_id: T.nilable(T::Array[String]),
61
- external_customer_id: T.nilable(T::Array[String]),
75
+ customer_id:
76
+ T.nilable(Orb::SubscriptionListParams::CustomerID::Variants),
77
+ external_customer_id:
78
+ T.nilable(
79
+ Orb::SubscriptionListParams::ExternalCustomerID::Variants
80
+ ),
62
81
  external_plan_id: T.nilable(String),
63
82
  limit: Integer,
64
83
  plan_id: T.nilable(String),
65
- status: T.nilable(Orb::SubscriptionListParams::Status::OrSymbol),
84
+ status:
85
+ T.nilable(
86
+ T.any(
87
+ Orb::SubscriptionStatusFilter::OrSymbol,
88
+ T::Array[Orb::SubscriptionStatusFilter::OrSymbol]
89
+ )
90
+ ),
66
91
  request_options: Orb::RequestOptions::OrHash
67
92
  ).returns(T.attached_class)
68
93
  end
@@ -93,12 +118,22 @@ module Orb
93
118
  created_at_lt: T.nilable(Time),
94
119
  created_at_lte: T.nilable(Time),
95
120
  cursor: T.nilable(String),
96
- customer_id: T.nilable(T::Array[String]),
97
- external_customer_id: T.nilable(T::Array[String]),
121
+ customer_id:
122
+ T.nilable(Orb::SubscriptionListParams::CustomerID::Variants),
123
+ external_customer_id:
124
+ T.nilable(
125
+ Orb::SubscriptionListParams::ExternalCustomerID::Variants
126
+ ),
98
127
  external_plan_id: T.nilable(String),
99
128
  limit: Integer,
100
129
  plan_id: T.nilable(String),
101
- status: T.nilable(Orb::SubscriptionListParams::Status::OrSymbol),
130
+ status:
131
+ T.nilable(
132
+ T.any(
133
+ Orb::SubscriptionStatusFilter::OrSymbol,
134
+ T::Array[Orb::SubscriptionStatusFilter::OrSymbol]
135
+ )
136
+ ),
102
137
  request_options: Orb::RequestOptions
103
138
  }
104
139
  )
@@ -106,26 +141,70 @@ module Orb
106
141
  def to_hash
107
142
  end
108
143
 
109
- module Status
110
- extend Orb::Internal::Type::Enum
144
+ module CustomerID
145
+ extend Orb::Internal::Type::Union
146
+
147
+ Variants = T.type_alias { T.any(String, T::Array[String]) }
148
+
149
+ sig do
150
+ override.returns(
151
+ T::Array[Orb::SubscriptionListParams::CustomerID::Variants]
152
+ )
153
+ end
154
+ def self.variants
155
+ end
111
156
 
112
- TaggedSymbol =
113
- T.type_alias { T.all(Symbol, Orb::SubscriptionListParams::Status) }
114
- OrSymbol = T.type_alias { T.any(Symbol, String) }
157
+ StringArray =
158
+ T.let(
159
+ Orb::Internal::Type::ArrayOf[String],
160
+ Orb::Internal::Type::Converter
161
+ )
162
+ end
163
+
164
+ module ExternalCustomerID
165
+ extend Orb::Internal::Type::Union
115
166
 
116
- ACTIVE =
117
- T.let(:active, Orb::SubscriptionListParams::Status::TaggedSymbol)
118
- ENDED = T.let(:ended, Orb::SubscriptionListParams::Status::TaggedSymbol)
119
- UPCOMING =
120
- T.let(:upcoming, Orb::SubscriptionListParams::Status::TaggedSymbol)
167
+ Variants = T.type_alias { T.any(String, T::Array[String]) }
121
168
 
122
169
  sig do
123
170
  override.returns(
124
- T::Array[Orb::SubscriptionListParams::Status::TaggedSymbol]
171
+ T::Array[Orb::SubscriptionListParams::ExternalCustomerID::Variants]
125
172
  )
126
173
  end
127
- def self.values
174
+ def self.variants
128
175
  end
176
+
177
+ StringArray =
178
+ T.let(
179
+ Orb::Internal::Type::ArrayOf[String],
180
+ Orb::Internal::Type::Converter
181
+ )
182
+ end
183
+
184
+ module Status
185
+ extend Orb::Internal::Type::Union
186
+
187
+ Variants =
188
+ T.type_alias do
189
+ T.any(
190
+ Orb::SubscriptionStatusFilter::TaggedSymbol,
191
+ T::Array[Orb::SubscriptionStatusFilter::TaggedSymbol]
192
+ )
193
+ end
194
+
195
+ sig do
196
+ override.returns(
197
+ T::Array[Orb::SubscriptionListParams::Status::Variants]
198
+ )
199
+ end
200
+ def self.variants
201
+ end
202
+
203
+ SubscriptionStatusFilterArray =
204
+ T.let(
205
+ Orb::Internal::Type::ArrayOf[enum: Orb::SubscriptionStatusFilter],
206
+ Orb::Internal::Type::Converter
207
+ )
129
208
  end
130
209
  end
131
210
  end
@@ -28,10 +28,20 @@ module Orb
28
28
  sig { returns(T.nilable(String)) }
29
29
  attr_accessor :cursor
30
30
 
31
- sig { returns(T.nilable(String)) }
31
+ sig do
32
+ returns(
33
+ T.nilable(Orb::SubscriptionListSummaryParams::CustomerID::Variants)
34
+ )
35
+ end
32
36
  attr_accessor :customer_id
33
37
 
34
- sig { returns(T.nilable(String)) }
38
+ sig do
39
+ returns(
40
+ T.nilable(
41
+ Orb::SubscriptionListSummaryParams::ExternalCustomerID::Variants
42
+ )
43
+ )
44
+ end
35
45
  attr_accessor :external_customer_id
36
46
 
37
47
  sig { returns(T.nilable(String)) }
@@ -48,7 +58,14 @@ module Orb
48
58
  attr_accessor :plan_id
49
59
 
50
60
  sig do
51
- returns(T.nilable(Orb::SubscriptionListSummaryParams::Status::OrSymbol))
61
+ returns(
62
+ T.nilable(
63
+ T.any(
64
+ Orb::SubscriptionStatusFilter::OrSymbol,
65
+ T::Array[Orb::SubscriptionStatusFilter::OrSymbol]
66
+ )
67
+ )
68
+ )
52
69
  end
53
70
  attr_accessor :status
54
71
 
@@ -59,13 +76,22 @@ module Orb
59
76
  created_at_lt: T.nilable(Time),
60
77
  created_at_lte: T.nilable(Time),
61
78
  cursor: T.nilable(String),
62
- customer_id: T.nilable(String),
63
- external_customer_id: T.nilable(String),
79
+ customer_id:
80
+ T.nilable(Orb::SubscriptionListSummaryParams::CustomerID::Variants),
81
+ external_customer_id:
82
+ T.nilable(
83
+ Orb::SubscriptionListSummaryParams::ExternalCustomerID::Variants
84
+ ),
64
85
  external_plan_id: T.nilable(String),
65
86
  limit: Integer,
66
87
  plan_id: T.nilable(String),
67
88
  status:
68
- T.nilable(Orb::SubscriptionListSummaryParams::Status::OrSymbol),
89
+ T.nilable(
90
+ T.any(
91
+ Orb::SubscriptionStatusFilter::OrSymbol,
92
+ T::Array[Orb::SubscriptionStatusFilter::OrSymbol]
93
+ )
94
+ ),
69
95
  request_options: Orb::RequestOptions::OrHash
70
96
  ).returns(T.attached_class)
71
97
  end
@@ -96,13 +122,24 @@ module Orb
96
122
  created_at_lt: T.nilable(Time),
97
123
  created_at_lte: T.nilable(Time),
98
124
  cursor: T.nilable(String),
99
- customer_id: T.nilable(String),
100
- external_customer_id: T.nilable(String),
125
+ customer_id:
126
+ T.nilable(
127
+ Orb::SubscriptionListSummaryParams::CustomerID::Variants
128
+ ),
129
+ external_customer_id:
130
+ T.nilable(
131
+ Orb::SubscriptionListSummaryParams::ExternalCustomerID::Variants
132
+ ),
101
133
  external_plan_id: T.nilable(String),
102
134
  limit: Integer,
103
135
  plan_id: T.nilable(String),
104
136
  status:
105
- T.nilable(Orb::SubscriptionListSummaryParams::Status::OrSymbol),
137
+ T.nilable(
138
+ T.any(
139
+ Orb::SubscriptionStatusFilter::OrSymbol,
140
+ T::Array[Orb::SubscriptionStatusFilter::OrSymbol]
141
+ )
142
+ ),
106
143
  request_options: Orb::RequestOptions
107
144
  }
108
145
  )
@@ -110,38 +147,72 @@ module Orb
110
147
  def to_hash
111
148
  end
112
149
 
113
- module Status
114
- extend Orb::Internal::Type::Enum
150
+ module CustomerID
151
+ extend Orb::Internal::Type::Union
115
152
 
116
- TaggedSymbol =
117
- T.type_alias do
118
- T.all(Symbol, Orb::SubscriptionListSummaryParams::Status)
119
- end
120
- OrSymbol = T.type_alias { T.any(Symbol, String) }
153
+ Variants = T.type_alias { T.any(String, T::Array[String]) }
121
154
 
122
- ACTIVE =
123
- T.let(
124
- :active,
125
- Orb::SubscriptionListSummaryParams::Status::TaggedSymbol
155
+ sig do
156
+ override.returns(
157
+ T::Array[Orb::SubscriptionListSummaryParams::CustomerID::Variants]
126
158
  )
127
- ENDED =
159
+ end
160
+ def self.variants
161
+ end
162
+
163
+ StringArray =
128
164
  T.let(
129
- :ended,
130
- Orb::SubscriptionListSummaryParams::Status::TaggedSymbol
165
+ Orb::Internal::Type::ArrayOf[String],
166
+ Orb::Internal::Type::Converter
131
167
  )
132
- UPCOMING =
168
+ end
169
+
170
+ module ExternalCustomerID
171
+ extend Orb::Internal::Type::Union
172
+
173
+ Variants = T.type_alias { T.any(String, T::Array[String]) }
174
+
175
+ sig do
176
+ override.returns(
177
+ T::Array[
178
+ Orb::SubscriptionListSummaryParams::ExternalCustomerID::Variants
179
+ ]
180
+ )
181
+ end
182
+ def self.variants
183
+ end
184
+
185
+ StringArray =
133
186
  T.let(
134
- :upcoming,
135
- Orb::SubscriptionListSummaryParams::Status::TaggedSymbol
187
+ Orb::Internal::Type::ArrayOf[String],
188
+ Orb::Internal::Type::Converter
136
189
  )
190
+ end
191
+
192
+ module Status
193
+ extend Orb::Internal::Type::Union
194
+
195
+ Variants =
196
+ T.type_alias do
197
+ T.any(
198
+ Orb::SubscriptionStatusFilter::TaggedSymbol,
199
+ T::Array[Orb::SubscriptionStatusFilter::TaggedSymbol]
200
+ )
201
+ end
137
202
 
138
203
  sig do
139
204
  override.returns(
140
- T::Array[Orb::SubscriptionListSummaryParams::Status::TaggedSymbol]
205
+ T::Array[Orb::SubscriptionListSummaryParams::Status::Variants]
141
206
  )
142
207
  end
143
- def self.values
208
+ def self.variants
144
209
  end
210
+
211
+ SubscriptionStatusFilterArray =
212
+ T.let(
213
+ Orb::Internal::Type::ArrayOf[enum: Orb::SubscriptionStatusFilter],
214
+ Orb::Internal::Type::Converter
215
+ )
145
216
  end
146
217
  end
147
218
  end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ module SubscriptionStatusFilter
6
+ extend Orb::Internal::Type::Enum
7
+
8
+ TaggedSymbol =
9
+ T.type_alias { T.all(Symbol, Orb::SubscriptionStatusFilter) }
10
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11
+
12
+ ACTIVE = T.let(:active, Orb::SubscriptionStatusFilter::TaggedSymbol)
13
+ ENDED = T.let(:ended, Orb::SubscriptionStatusFilter::TaggedSymbol)
14
+ UPCOMING = T.let(:upcoming, Orb::SubscriptionStatusFilter::TaggedSymbol)
15
+
16
+ sig do
17
+ override.returns(T::Array[Orb::SubscriptionStatusFilter::TaggedSymbol])
18
+ end
19
+ def self.values
20
+ end
21
+ end
22
+ end
23
+ end
data/rbi/orb/models.rbi CHANGED
@@ -327,6 +327,8 @@ module Orb
327
327
  InvoiceRegenerateReceiptPdfParams =
328
328
  Orb::Models::InvoiceRegenerateReceiptPdfParams
329
329
 
330
+ InvoiceStatusFilter = Orb::Models::InvoiceStatusFilter
331
+
330
332
  InvoiceSyncFailedWebhookEvent = Orb::Models::InvoiceSyncFailedWebhookEvent
331
333
 
332
334
  InvoiceSyncSucceededWebhookEvent =
@@ -856,6 +858,8 @@ module Orb
856
858
 
857
859
  SubscriptionStartedWebhookEvent = Orb::Models::SubscriptionStartedWebhookEvent
858
860
 
861
+ SubscriptionStatusFilter = Orb::Models::SubscriptionStatusFilter
862
+
859
863
  SubscriptionTrialEndedWebhookEvent =
860
864
  Orb::Models::SubscriptionTrialEndedWebhookEvent
861
865
 
@@ -150,6 +150,17 @@ module Orb
150
150
  # 3. If `invoice_settings` is specified, an invoice will be created that reflects
151
151
  # the cost of the credits (based on `amount` and `per_unit_cost_basis`).
152
152
  #
153
+ # ## Currency
154
+ #
155
+ # `currency` sets which currency or custom pricing unit ledger the entry applies
156
+ # to. It is optional: if it is omitted, Orb uses the customer's default ledger
157
+ # pricing unit, which may not be the one you intend. We recommend passing
158
+ # `currency` explicitly on every ledger entry.
159
+ #
160
+ # For entries that act on an existing block (`void`, `amendment`, and
161
+ # `expiration_change`), `currency` must match the block's pricing unit. Otherwise
162
+ # the request fails with a currency mismatch error.
163
+ #
153
164
  # ## Adding credits
154
165
  #
155
166
  # Adding credits is done by creating an entry of type `increment`. This requires
@@ -250,6 +261,23 @@ module Orb
250
261
  # how many credits to void, up to the block's initial balance. Pass in a
251
262
  # `void_reason` of `refund` if the void is due to a refund.
252
263
  #
264
+ # Pass `currency` set to the block's currency or custom pricing unit. If it is
265
+ # omitted and the block is not in the customer's default ledger pricing unit, the
266
+ # request fails with a currency mismatch error.
267
+ #
268
+ # The following snippet illustrates a sample request body to void 50 credits from
269
+ # a block that uses a custom pricing unit named `tokens`:
270
+ #
271
+ # ```json
272
+ # {
273
+ # "entry_type": "void",
274
+ # "block_id": "UiUhFWeLHPrBY4Ad",
275
+ # "amount": 50,
276
+ # "currency": "tokens",
277
+ # "void_reason": "refund"
278
+ # }
279
+ # ```
280
+ #
253
281
  # ## Amendment
254
282
  #
255
283
  # If you'd like to undo a decrement on a credit block, create a ledger entry of
@@ -293,6 +321,17 @@ module Orb
293
321
  # 3. If `invoice_settings` is specified, an invoice will be created that reflects
294
322
  # the cost of the credits (based on `amount` and `per_unit_cost_basis`).
295
323
  #
324
+ # ## Currency
325
+ #
326
+ # `currency` sets which currency or custom pricing unit ledger the entry applies
327
+ # to. It is optional: if it is omitted, Orb uses the customer's default ledger
328
+ # pricing unit, which may not be the one you intend. We recommend passing
329
+ # `currency` explicitly on every ledger entry.
330
+ #
331
+ # For entries that act on an existing block (`void`, `amendment`, and
332
+ # `expiration_change`), `currency` must match the block's pricing unit. Otherwise
333
+ # the request fails with a currency mismatch error.
334
+ #
296
335
  # ## Adding credits
297
336
  #
298
337
  # Adding credits is done by creating an entry of type `increment`. This requires
@@ -393,6 +432,23 @@ module Orb
393
432
  # how many credits to void, up to the block's initial balance. Pass in a
394
433
  # `void_reason` of `refund` if the void is due to a refund.
395
434
  #
435
+ # Pass `currency` set to the block's currency or custom pricing unit. If it is
436
+ # omitted and the block is not in the customer's default ledger pricing unit, the
437
+ # request fails with a currency mismatch error.
438
+ #
439
+ # The following snippet illustrates a sample request body to void 50 credits from
440
+ # a block that uses a custom pricing unit named `tokens`:
441
+ #
442
+ # ```json
443
+ # {
444
+ # "entry_type": "void",
445
+ # "block_id": "UiUhFWeLHPrBY4Ad",
446
+ # "amount": 50,
447
+ # "currency": "tokens",
448
+ # "void_reason": "refund"
449
+ # }
450
+ # ```
451
+ #
396
452
  # ## Amendment
397
453
  #
398
454
  # If you'd like to undo a decrement on a credit block, create a ledger entry of
@@ -163,7 +163,13 @@ module Orb
163
163
  invoice_date_lte: T.nilable(Time),
164
164
  is_recurring: T.nilable(T::Boolean),
165
165
  limit: Integer,
166
- status: T.nilable(T::Array[Orb::InvoiceListParams::Status::OrSymbol]),
166
+ status:
167
+ T.nilable(
168
+ T.any(
169
+ Orb::InvoiceStatusFilter::OrSymbol,
170
+ T::Array[Orb::InvoiceStatusFilter::OrSymbol]
171
+ )
172
+ ),
167
173
  subscription_id: T.nilable(String),
168
174
  request_options: Orb::RequestOptions::OrHash
169
175
  ).returns(Orb::Internal::Page[Orb::Invoice])
@@ -346,7 +352,13 @@ module Orb
346
352
  invoice_date_lte: T.nilable(Time),
347
353
  is_recurring: T.nilable(T::Boolean),
348
354
  limit: Integer,
349
- status: T.nilable(Orb::InvoiceListSummaryParams::Status::OrSymbol),
355
+ status:
356
+ T.nilable(
357
+ T.any(
358
+ Orb::InvoiceStatusFilter::OrSymbol,
359
+ T::Array[Orb::InvoiceStatusFilter::OrSymbol]
360
+ )
361
+ ),
350
362
  subscription_id: T.nilable(String),
351
363
  request_options: Orb::RequestOptions::OrHash
352
364
  ).returns(Orb::Internal::Page[Orb::Models::InvoiceListSummaryResponse])
@@ -409,6 +421,20 @@ module Orb
409
421
  # customer's default payment method. Optionally, a shared payment token (SPT) can
410
422
  # be provided to pay using agent-granted credentials instead. This action can only
411
423
  # be taken on invoices with status "issued".
424
+ #
425
+ # A `200` response means Orb attempted the charge, not that the payment succeeded.
426
+ # A declined card still returns `200`. To check the outcome, read the returned
427
+ # invoice:
428
+ #
429
+ # - `status` is `paid` if the payment succeeded. It stays `issued` if the payment
430
+ # failed or is still processing.
431
+ # - The newest entry in `payment_attempts` has `succeeded: true` only if the
432
+ # charge went through.
433
+ #
434
+ # Some payment methods (such as ACH debits) settle asynchronously, so the outcome
435
+ # may not be known when this endpoint returns. Listen for the
436
+ # `invoice.payment_succeeded` and `invoice.payment_failed` webhooks to get the
437
+ # final result.
412
438
  sig do
413
439
  params(
414
440
  invoice_id: String,