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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 629a059d81d3aedec7fc98e36ec90962008b53a532ba2248bef9321e5e4c29be
4
- data.tar.gz: 9e9b6f5acf7ff206bf88da4f54e7eb51c61ede8d804690a4e863cacd1c65d3a6
3
+ metadata.gz: be523d90a6c8534cc76e0d782fc89afc7027285acd222ea20fc2f4f47b60fad2
4
+ data.tar.gz: ebef81e42f4e03646fca774c4466f5424c8fad29972eb6853754e6c01c156fc8
5
5
  SHA512:
6
- metadata.gz: 6b90de9b8aed6b595836218a746a23188f0178881c47dbac248b8e7fe2c4f9e670418fcbd469a3fd08a7a46689d4d4d419601d91de88ad3ae9f1dc0c0ef9d2e2
7
- data.tar.gz: 21f31614d8b23286c41e2741618230457178fd378d91f6223e298edfc637718ca01e1c1dafdc70203afac1e4ea2833a78f6f837426bb79697578cd09cf1df9d1
6
+ metadata.gz: 4edb010b3f75ab155d805b5abf22fc49b681efc7e19dce5b095d879a382351dcb4f79b6bff5d6c2a14766d7ccf167c8ae29d64b0edac310fcd41a485a5948894
7
+ data.tar.gz: 0ebefe242aa2d52d5e5d4497724fb7a8632431ef6b76fadc7cf696a0d8a6ca308bf7ce550d298d28eec3631b1527c63f71c4e4f943f480b79603972c15b61898
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.59.0](https://github.com/orbcorp/orb-ruby/compare/v1.58.0...v1.59.0) (2026-11-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** api update ([ce159e7](https://github.com/orbcorp/orb-ruby/commit/ce159e709eefe069a41c52a4b834668423070944))
9
+ * **api:** document currency handling and void examples for ledger entries ([99715ca](https://github.com/orbcorp/orb-ruby/commit/99715ca90a6f21c3e1af85e255cbc50cf1f7484b))
10
+
3
11
  ## [1.58.0](https://github.com/orbcorp/orb-ruby/compare/v1.57.0...v1.58.0) (2026-11-17)
4
12
 
5
13
 
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.58.0"
18
+ gem "orb-billing", "~> 1.59.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -109,8 +109,8 @@ module Orb
109
109
 
110
110
  # @!attribute status
111
111
  #
112
- # @return [Array<Symbol, Orb::Models::InvoiceListParams::Status>, nil]
113
- optional :status, -> { Orb::Internal::Type::ArrayOf[enum: Orb::InvoiceListParams::Status] }, nil?: true
112
+ # @return [Symbol, Orb::Models::InvoiceStatusFilter, Array<Symbol, Orb::Models::InvoiceStatusFilter>, nil]
113
+ optional :status, union: -> { Orb::InvoiceListParams::Status }, nil?: true
114
114
 
115
115
  # @!attribute subscription_id
116
116
  #
@@ -157,7 +157,7 @@ module Orb
157
157
  #
158
158
  # @param limit [Integer] The number of items to fetch. Defaults to 20.
159
159
  #
160
- # @param status [Array<Symbol, Orb::Models::InvoiceListParams::Status>, nil]
160
+ # @param status [Symbol, Orb::Models::InvoiceStatusFilter, Array<Symbol, Orb::Models::InvoiceStatusFilter>, nil]
161
161
  #
162
162
  # @param subscription_id [String, nil]
163
163
  #
@@ -174,16 +174,17 @@ module Orb
174
174
  end
175
175
 
176
176
  module Status
177
- extend Orb::Internal::Type::Enum
177
+ extend Orb::Internal::Type::Union
178
178
 
179
- DRAFT = :draft
180
- ISSUED = :issued
181
- PAID = :paid
182
- SYNCED = :synced
183
- VOID = :void
179
+ variant enum: -> { Orb::InvoiceStatusFilter }
184
180
 
185
- # @!method self.values
186
- # @return [Array<Symbol>]
181
+ variant -> { Orb::Models::InvoiceListParams::Status::InvoiceStatusFilterArray }
182
+
183
+ # @!method self.variants
184
+ # @return [Array(Symbol, Orb::Models::InvoiceStatusFilter, Array<Symbol, Orb::Models::InvoiceStatusFilter>)]
185
+
186
+ # @type [Orb::Internal::Type::Converter]
187
+ InvoiceStatusFilterArray = Orb::Internal::Type::ArrayOf[enum: -> { Orb::InvoiceStatusFilter }]
187
188
  end
188
189
  end
189
190
  end
@@ -101,8 +101,8 @@ module Orb
101
101
 
102
102
  # @!attribute status
103
103
  #
104
- # @return [Symbol, Orb::Models::InvoiceListSummaryParams::Status, nil]
105
- optional :status, enum: -> { Orb::InvoiceListSummaryParams::Status }, nil?: true
104
+ # @return [Symbol, Orb::Models::InvoiceStatusFilter, Array<Symbol, Orb::Models::InvoiceStatusFilter>, nil]
105
+ optional :status, union: -> { Orb::InvoiceListSummaryParams::Status }, nil?: true
106
106
 
107
107
  # @!attribute subscription_id
108
108
  #
@@ -147,7 +147,7 @@ module Orb
147
147
  #
148
148
  # @param limit [Integer] The number of items to fetch. Defaults to 20.
149
149
  #
150
- # @param status [Symbol, Orb::Models::InvoiceListSummaryParams::Status, nil]
150
+ # @param status [Symbol, Orb::Models::InvoiceStatusFilter, Array<Symbol, Orb::Models::InvoiceStatusFilter>, nil]
151
151
  #
152
152
  # @param subscription_id [String, nil]
153
153
  #
@@ -164,16 +164,17 @@ module Orb
164
164
  end
165
165
 
166
166
  module Status
167
- extend Orb::Internal::Type::Enum
167
+ extend Orb::Internal::Type::Union
168
168
 
169
- DRAFT = :draft
170
- ISSUED = :issued
171
- PAID = :paid
172
- SYNCED = :synced
173
- VOID = :void
169
+ variant enum: -> { Orb::InvoiceStatusFilter }
174
170
 
175
- # @!method self.values
176
- # @return [Array<Symbol>]
171
+ variant -> { Orb::Models::InvoiceListSummaryParams::Status::InvoiceStatusFilterArray }
172
+
173
+ # @!method self.variants
174
+ # @return [Array(Symbol, Orb::Models::InvoiceStatusFilter, Array<Symbol, Orb::Models::InvoiceStatusFilter>)]
175
+
176
+ # @type [Orb::Internal::Type::Converter]
177
+ InvoiceStatusFilterArray = Orb::Internal::Type::ArrayOf[enum: -> { Orb::InvoiceStatusFilter }]
177
178
  end
178
179
  end
179
180
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ module InvoiceStatusFilter
6
+ extend Orb::Internal::Type::Enum
7
+
8
+ DRAFT = :draft
9
+ ISSUED = :issued
10
+ PAID = :paid
11
+ SYNCED = :synced
12
+ VOID = :void
13
+
14
+ # @!method self.values
15
+ # @return [Array<Symbol>]
16
+ end
17
+ end
18
+ end
@@ -36,13 +36,17 @@ module Orb
36
36
 
37
37
  # @!attribute customer_id
38
38
  #
39
- # @return [Array<String>, nil]
40
- optional :customer_id, Orb::Internal::Type::ArrayOf[String], nil?: true
39
+ # @return [String, Array<String>, nil]
40
+ optional :customer_id, union: -> { Orb::SubscriptionListParams::CustomerID }, nil?: true
41
41
 
42
42
  # @!attribute external_customer_id
43
43
  #
44
- # @return [Array<String>, nil]
45
- optional :external_customer_id, Orb::Internal::Type::ArrayOf[String], nil?: true
44
+ # @return [String, Array<String>, nil]
45
+ optional :external_customer_id,
46
+ union: -> {
47
+ Orb::SubscriptionListParams::ExternalCustomerID
48
+ },
49
+ nil?: true
46
50
 
47
51
  # @!attribute external_plan_id
48
52
  #
@@ -62,8 +66,8 @@ module Orb
62
66
 
63
67
  # @!attribute status
64
68
  #
65
- # @return [Symbol, Orb::Models::SubscriptionListParams::Status, nil]
66
- optional :status, enum: -> { Orb::SubscriptionListParams::Status }, nil?: true
69
+ # @return [Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>, nil]
70
+ optional :status, union: -> { Orb::SubscriptionListParams::Status }, nil?: true
67
71
 
68
72
  # @!method initialize(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, customer_id: nil, external_customer_id: nil, external_plan_id: nil, limit: nil, plan_id: nil, status: nil, request_options: {})
69
73
  # Some parameter documentations has been truncated, see
@@ -79,9 +83,9 @@ module Orb
79
83
  #
80
84
  # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
81
85
  #
82
- # @param customer_id [Array<String>, nil]
86
+ # @param customer_id [String, Array<String>, nil]
83
87
  #
84
- # @param external_customer_id [Array<String>, nil]
88
+ # @param external_customer_id [String, Array<String>, nil]
85
89
  #
86
90
  # @param external_plan_id [String, nil]
87
91
  #
@@ -89,19 +93,52 @@ module Orb
89
93
  #
90
94
  # @param plan_id [String, nil]
91
95
  #
92
- # @param status [Symbol, Orb::Models::SubscriptionListParams::Status, nil]
96
+ # @param status [Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>, nil]
93
97
  #
94
98
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
95
99
 
100
+ module CustomerID
101
+ extend Orb::Internal::Type::Union
102
+
103
+ variant String
104
+
105
+ variant -> { Orb::Models::SubscriptionListParams::CustomerID::StringArray }
106
+
107
+ # @!method self.variants
108
+ # @return [Array(String, Array<String>)]
109
+
110
+ # @type [Orb::Internal::Type::Converter]
111
+ StringArray = Orb::Internal::Type::ArrayOf[String]
112
+ end
113
+
114
+ module ExternalCustomerID
115
+ extend Orb::Internal::Type::Union
116
+
117
+ variant String
118
+
119
+ variant -> { Orb::Models::SubscriptionListParams::ExternalCustomerID::StringArray }
120
+
121
+ # @!method self.variants
122
+ # @return [Array(String, Array<String>)]
123
+
124
+ # @type [Orb::Internal::Type::Converter]
125
+ StringArray = Orb::Internal::Type::ArrayOf[String]
126
+ end
127
+
96
128
  module Status
97
- extend Orb::Internal::Type::Enum
129
+ extend Orb::Internal::Type::Union
130
+
131
+ variant enum: -> { Orb::SubscriptionStatusFilter }
132
+
133
+ variant -> { Orb::Models::SubscriptionListParams::Status::SubscriptionStatusFilterArray }
98
134
 
99
- ACTIVE = :active
100
- ENDED = :ended
101
- UPCOMING = :upcoming
135
+ # @!method self.variants
136
+ # @return [Array(Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>)]
102
137
 
103
- # @!method self.values
104
- # @return [Array<Symbol>]
138
+ # @type [Orb::Internal::Type::Converter]
139
+ SubscriptionStatusFilterArray = Orb::Internal::Type::ArrayOf[enum: -> {
140
+ Orb::SubscriptionStatusFilter
141
+ }]
105
142
  end
106
143
  end
107
144
  end
@@ -36,13 +36,15 @@ module Orb
36
36
 
37
37
  # @!attribute customer_id
38
38
  #
39
- # @return [String, nil]
40
- optional :customer_id, String, nil?: true
39
+ # @return [String, Array<String>, nil]
40
+ optional :customer_id, union: -> { Orb::SubscriptionListSummaryParams::CustomerID }, nil?: true
41
41
 
42
42
  # @!attribute external_customer_id
43
43
  #
44
- # @return [String, nil]
45
- optional :external_customer_id, String, nil?: true
44
+ # @return [String, Array<String>, nil]
45
+ optional :external_customer_id,
46
+ union: -> { Orb::SubscriptionListSummaryParams::ExternalCustomerID },
47
+ nil?: true
46
48
 
47
49
  # @!attribute external_plan_id
48
50
  #
@@ -62,8 +64,8 @@ module Orb
62
64
 
63
65
  # @!attribute status
64
66
  #
65
- # @return [Symbol, Orb::Models::SubscriptionListSummaryParams::Status, nil]
66
- optional :status, enum: -> { Orb::SubscriptionListSummaryParams::Status }, nil?: true
67
+ # @return [Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>, nil]
68
+ optional :status, union: -> { Orb::SubscriptionListSummaryParams::Status }, nil?: true
67
69
 
68
70
  # @!method initialize(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, customer_id: nil, external_customer_id: nil, external_plan_id: nil, limit: nil, plan_id: nil, status: nil, request_options: {})
69
71
  # Some parameter documentations has been truncated, see
@@ -79,9 +81,9 @@ module Orb
79
81
  #
80
82
  # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
81
83
  #
82
- # @param customer_id [String, nil]
84
+ # @param customer_id [String, Array<String>, nil]
83
85
  #
84
- # @param external_customer_id [String, nil]
86
+ # @param external_customer_id [String, Array<String>, nil]
85
87
  #
86
88
  # @param external_plan_id [String, nil]
87
89
  #
@@ -89,19 +91,52 @@ module Orb
89
91
  #
90
92
  # @param plan_id [String, nil]
91
93
  #
92
- # @param status [Symbol, Orb::Models::SubscriptionListSummaryParams::Status, nil]
94
+ # @param status [Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>, nil]
93
95
  #
94
96
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
95
97
 
98
+ module CustomerID
99
+ extend Orb::Internal::Type::Union
100
+
101
+ variant String
102
+
103
+ variant -> { Orb::Models::SubscriptionListSummaryParams::CustomerID::StringArray }
104
+
105
+ # @!method self.variants
106
+ # @return [Array(String, Array<String>)]
107
+
108
+ # @type [Orb::Internal::Type::Converter]
109
+ StringArray = Orb::Internal::Type::ArrayOf[String]
110
+ end
111
+
112
+ module ExternalCustomerID
113
+ extend Orb::Internal::Type::Union
114
+
115
+ variant String
116
+
117
+ variant -> { Orb::Models::SubscriptionListSummaryParams::ExternalCustomerID::StringArray }
118
+
119
+ # @!method self.variants
120
+ # @return [Array(String, Array<String>)]
121
+
122
+ # @type [Orb::Internal::Type::Converter]
123
+ StringArray = Orb::Internal::Type::ArrayOf[String]
124
+ end
125
+
96
126
  module Status
97
- extend Orb::Internal::Type::Enum
127
+ extend Orb::Internal::Type::Union
128
+
129
+ variant enum: -> { Orb::SubscriptionStatusFilter }
130
+
131
+ variant -> { Orb::Models::SubscriptionListSummaryParams::Status::SubscriptionStatusFilterArray }
98
132
 
99
- ACTIVE = :active
100
- ENDED = :ended
101
- UPCOMING = :upcoming
133
+ # @!method self.variants
134
+ # @return [Array(Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>)]
102
135
 
103
- # @!method self.values
104
- # @return [Array<Symbol>]
136
+ # @type [Orb::Internal::Type::Converter]
137
+ SubscriptionStatusFilterArray = Orb::Internal::Type::ArrayOf[enum: -> {
138
+ Orb::SubscriptionStatusFilter
139
+ }]
105
140
  end
106
141
  end
107
142
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ module SubscriptionStatusFilter
6
+ extend Orb::Internal::Type::Enum
7
+
8
+ ACTIVE = :active
9
+ ENDED = :ended
10
+ UPCOMING = :upcoming
11
+
12
+ # @!method self.values
13
+ # @return [Array<Symbol>]
14
+ end
15
+ end
16
+ end
data/lib/orb/models.rb CHANGED
@@ -329,6 +329,8 @@ module Orb
329
329
 
330
330
  InvoiceRegenerateReceiptPdfParams = Orb::Models::InvoiceRegenerateReceiptPdfParams
331
331
 
332
+ InvoiceStatusFilter = Orb::Models::InvoiceStatusFilter
333
+
332
334
  InvoiceSyncFailedWebhookEvent = Orb::Models::InvoiceSyncFailedWebhookEvent
333
335
 
334
336
  InvoiceSyncSucceededWebhookEvent = Orb::Models::InvoiceSyncSucceededWebhookEvent
@@ -788,6 +790,8 @@ module Orb
788
790
 
789
791
  SubscriptionStartedWebhookEvent = Orb::Models::SubscriptionStartedWebhookEvent
790
792
 
793
+ SubscriptionStatusFilter = Orb::Models::SubscriptionStatusFilter
794
+
791
795
  SubscriptionTrialEndedWebhookEvent = Orb::Models::SubscriptionTrialEndedWebhookEvent
792
796
 
793
797
  SubscriptionTrialInfo = Orb::Models::SubscriptionTrialInfo
@@ -155,6 +155,17 @@ module Orb
155
155
  # 3. If `invoice_settings` is specified, an invoice will be created that reflects
156
156
  # the cost of the credits (based on `amount` and `per_unit_cost_basis`).
157
157
  #
158
+ # ## Currency
159
+ #
160
+ # `currency` sets which currency or custom pricing unit ledger the entry applies
161
+ # to. It is optional: if it is omitted, Orb uses the customer's default ledger
162
+ # pricing unit, which may not be the one you intend. We recommend passing
163
+ # `currency` explicitly on every ledger entry.
164
+ #
165
+ # For entries that act on an existing block (`void`, `amendment`, and
166
+ # `expiration_change`), `currency` must match the block's pricing unit. Otherwise
167
+ # the request fails with a currency mismatch error.
168
+ #
158
169
  # ## Adding credits
159
170
  #
160
171
  # Adding credits is done by creating an entry of type `increment`. This requires
@@ -255,6 +266,23 @@ module Orb
255
266
  # how many credits to void, up to the block's initial balance. Pass in a
256
267
  # `void_reason` of `refund` if the void is due to a refund.
257
268
  #
269
+ # Pass `currency` set to the block's currency or custom pricing unit. If it is
270
+ # omitted and the block is not in the customer's default ledger pricing unit, the
271
+ # request fails with a currency mismatch error.
272
+ #
273
+ # The following snippet illustrates a sample request body to void 50 credits from
274
+ # a block that uses a custom pricing unit named `tokens`:
275
+ #
276
+ # ```json
277
+ # {
278
+ # "entry_type": "void",
279
+ # "block_id": "UiUhFWeLHPrBY4Ad",
280
+ # "amount": 50,
281
+ # "currency": "tokens",
282
+ # "void_reason": "refund"
283
+ # }
284
+ # ```
285
+ #
258
286
  # ## Amendment
259
287
  #
260
288
  # If you'd like to undo a decrement on a credit block, create a ledger entry of
@@ -300,6 +328,17 @@ module Orb
300
328
  # 3. If `invoice_settings` is specified, an invoice will be created that reflects
301
329
  # the cost of the credits (based on `amount` and `per_unit_cost_basis`).
302
330
  #
331
+ # ## Currency
332
+ #
333
+ # `currency` sets which currency or custom pricing unit ledger the entry applies
334
+ # to. It is optional: if it is omitted, Orb uses the customer's default ledger
335
+ # pricing unit, which may not be the one you intend. We recommend passing
336
+ # `currency` explicitly on every ledger entry.
337
+ #
338
+ # For entries that act on an existing block (`void`, `amendment`, and
339
+ # `expiration_change`), `currency` must match the block's pricing unit. Otherwise
340
+ # the request fails with a currency mismatch error.
341
+ #
303
342
  # ## Adding credits
304
343
  #
305
344
  # Adding credits is done by creating an entry of type `increment`. This requires
@@ -400,6 +439,23 @@ module Orb
400
439
  # how many credits to void, up to the block's initial balance. Pass in a
401
440
  # `void_reason` of `refund` if the void is due to a refund.
402
441
  #
442
+ # Pass `currency` set to the block's currency or custom pricing unit. If it is
443
+ # omitted and the block is not in the customer's default ledger pricing unit, the
444
+ # request fails with a currency mismatch error.
445
+ #
446
+ # The following snippet illustrates a sample request body to void 50 credits from
447
+ # a block that uses a custom pricing unit named `tokens`:
448
+ #
449
+ # ```json
450
+ # {
451
+ # "entry_type": "void",
452
+ # "block_id": "UiUhFWeLHPrBY4Ad",
453
+ # "amount": 50,
454
+ # "currency": "tokens",
455
+ # "void_reason": "refund"
456
+ # }
457
+ # ```
458
+ #
403
459
  # ## Amendment
404
460
  #
405
461
  # If you'd like to undo a decrement on a credit block, create a ledger entry of
@@ -150,7 +150,7 @@ module Orb
150
150
  #
151
151
  # @param limit [Integer] The number of items to fetch. Defaults to 20.
152
152
  #
153
- # @param status [Array<Symbol, Orb::Models::InvoiceListParams::Status>, nil]
153
+ # @param status [Symbol, Orb::Models::InvoiceStatusFilter, Array<Symbol, Orb::Models::InvoiceStatusFilter>, nil]
154
154
  #
155
155
  # @param subscription_id [String, nil]
156
156
  #
@@ -392,7 +392,7 @@ module Orb
392
392
  #
393
393
  # @param limit [Integer] The number of items to fetch. Defaults to 20.
394
394
  #
395
- # @param status [Symbol, Orb::Models::InvoiceListSummaryParams::Status, nil]
395
+ # @param status [Symbol, Orb::Models::InvoiceStatusFilter, Array<Symbol, Orb::Models::InvoiceStatusFilter>, nil]
396
396
  #
397
397
  # @param subscription_id [String, nil]
398
398
  #
@@ -457,6 +457,20 @@ module Orb
457
457
  # be provided to pay using agent-granted credentials instead. This action can only
458
458
  # be taken on invoices with status "issued".
459
459
  #
460
+ # A `200` response means Orb attempted the charge, not that the payment succeeded.
461
+ # A declined card still returns `200`. To check the outcome, read the returned
462
+ # invoice:
463
+ #
464
+ # - `status` is `paid` if the payment succeeded. It stays `issued` if the payment
465
+ # failed or is still processing.
466
+ # - The newest entry in `payment_attempts` has `succeeded: true` only if the
467
+ # charge went through.
468
+ #
469
+ # Some payment methods (such as ACH debits) settle asynchronously, so the outcome
470
+ # may not be known when this endpoint returns. Listen for the
471
+ # `invoice.payment_succeeded` and `invoice.payment_failed` webhooks to get the
472
+ # final result.
473
+ #
460
474
  # @overload pay(invoice_id, shared_payment_token_id: nil, request_options: {})
461
475
  #
462
476
  # @param invoice_id [String]
@@ -422,9 +422,9 @@ module Orb
422
422
  #
423
423
  # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
424
424
  #
425
- # @param customer_id [Array<String>, nil]
425
+ # @param customer_id [String, Array<String>, nil]
426
426
  #
427
- # @param external_customer_id [Array<String>, nil]
427
+ # @param external_customer_id [String, Array<String>, nil]
428
428
  #
429
429
  # @param external_plan_id [String, nil]
430
430
  #
@@ -432,7 +432,7 @@ module Orb
432
432
  #
433
433
  # @param plan_id [String, nil]
434
434
  #
435
- # @param status [Symbol, Orb::Models::SubscriptionListParams::Status, nil]
435
+ # @param status [Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>, nil]
436
436
  #
437
437
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
438
438
  #
@@ -922,9 +922,9 @@ module Orb
922
922
  #
923
923
  # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
924
924
  #
925
- # @param customer_id [String, nil]
925
+ # @param customer_id [String, Array<String>, nil]
926
926
  #
927
- # @param external_customer_id [String, nil]
927
+ # @param external_customer_id [String, Array<String>, nil]
928
928
  #
929
929
  # @param external_plan_id [String, nil]
930
930
  #
@@ -932,7 +932,7 @@ module Orb
932
932
  #
933
933
  # @param plan_id [String, nil]
934
934
  #
935
- # @param status [Symbol, Orb::Models::SubscriptionListSummaryParams::Status, nil]
935
+ # @param status [Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>, nil]
936
936
  #
937
937
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
938
938
  #
data/lib/orb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orb
4
- VERSION = "1.58.0"
4
+ VERSION = "1.59.0"
5
5
  end
data/lib/orb.rb CHANGED
@@ -263,6 +263,7 @@ require_relative "orb/models/invoice_payment_succeeded_webhook_event"
263
263
  require_relative "orb/models/invoice_pay_params"
264
264
  require_relative "orb/models/invoice_regenerate_invoice_pdf_params"
265
265
  require_relative "orb/models/invoice_regenerate_receipt_pdf_params"
266
+ require_relative "orb/models/invoice_status_filter"
266
267
  require_relative "orb/models/invoice_sync_failed_webhook_event"
267
268
  require_relative "orb/models/invoice_sync_succeeded_webhook_event"
268
269
  require_relative "orb/models/invoice_tiny"
@@ -532,6 +533,7 @@ require_relative "orb/models/subscriptions"
532
533
  require_relative "orb/models/subscription_schedule_plan_change_params"
533
534
  require_relative "orb/models/subscription_spend_exceeded_webhook_event"
534
535
  require_relative "orb/models/subscription_started_webhook_event"
536
+ require_relative "orb/models/subscription_status_filter"
535
537
  require_relative "orb/models/subscription_trial_ended_webhook_event"
536
538
  require_relative "orb/models/subscription_trial_info"
537
539
  require_relative "orb/models/subscription_trigger_phase_params"
@@ -77,7 +77,14 @@ module Orb
77
77
  attr_writer :limit
78
78
 
79
79
  sig do
80
- returns(T.nilable(T::Array[Orb::InvoiceListParams::Status::OrSymbol]))
80
+ returns(
81
+ T.nilable(
82
+ T.any(
83
+ Orb::InvoiceStatusFilter::OrSymbol,
84
+ T::Array[Orb::InvoiceStatusFilter::OrSymbol]
85
+ )
86
+ )
87
+ )
81
88
  end
82
89
  attr_accessor :status
83
90
 
@@ -104,7 +111,13 @@ module Orb
104
111
  invoice_date_lte: T.nilable(Time),
105
112
  is_recurring: T.nilable(T::Boolean),
106
113
  limit: Integer,
107
- status: T.nilable(T::Array[Orb::InvoiceListParams::Status::OrSymbol]),
114
+ status:
115
+ T.nilable(
116
+ T.any(
117
+ Orb::InvoiceStatusFilter::OrSymbol,
118
+ T::Array[Orb::InvoiceStatusFilter::OrSymbol]
119
+ )
120
+ ),
108
121
  subscription_id: T.nilable(String),
109
122
  request_options: Orb::RequestOptions::OrHash
110
123
  ).returns(T.attached_class)
@@ -166,7 +179,12 @@ module Orb
166
179
  is_recurring: T.nilable(T::Boolean),
167
180
  limit: Integer,
168
181
  status:
169
- T.nilable(T::Array[Orb::InvoiceListParams::Status::OrSymbol]),
182
+ T.nilable(
183
+ T.any(
184
+ Orb::InvoiceStatusFilter::OrSymbol,
185
+ T::Array[Orb::InvoiceStatusFilter::OrSymbol]
186
+ )
187
+ ),
170
188
  subscription_id: T.nilable(String),
171
189
  request_options: Orb::RequestOptions
172
190
  }
@@ -197,25 +215,27 @@ module Orb
197
215
  end
198
216
 
199
217
  module Status
200
- extend Orb::Internal::Type::Enum
201
-
202
- TaggedSymbol =
203
- T.type_alias { T.all(Symbol, Orb::InvoiceListParams::Status) }
204
- OrSymbol = T.type_alias { T.any(Symbol, String) }
218
+ extend Orb::Internal::Type::Union
205
219
 
206
- DRAFT = T.let(:draft, Orb::InvoiceListParams::Status::TaggedSymbol)
207
- ISSUED = T.let(:issued, Orb::InvoiceListParams::Status::TaggedSymbol)
208
- PAID = T.let(:paid, Orb::InvoiceListParams::Status::TaggedSymbol)
209
- SYNCED = T.let(:synced, Orb::InvoiceListParams::Status::TaggedSymbol)
210
- VOID = T.let(:void, Orb::InvoiceListParams::Status::TaggedSymbol)
220
+ Variants =
221
+ T.type_alias do
222
+ T.any(
223
+ Orb::InvoiceStatusFilter::TaggedSymbol,
224
+ T::Array[Orb::InvoiceStatusFilter::TaggedSymbol]
225
+ )
226
+ end
211
227
 
212
228
  sig do
213
- override.returns(
214
- T::Array[Orb::InvoiceListParams::Status::TaggedSymbol]
215
- )
229
+ override.returns(T::Array[Orb::InvoiceListParams::Status::Variants])
216
230
  end
217
- def self.values
231
+ def self.variants
218
232
  end
233
+
234
+ InvoiceStatusFilterArray =
235
+ T.let(
236
+ Orb::Internal::Type::ArrayOf[enum: Orb::InvoiceStatusFilter],
237
+ Orb::Internal::Type::Converter
238
+ )
219
239
  end
220
240
  end
221
241
  end