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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/orb/models/invoice_list_params.rb +12 -11
- data/lib/orb/models/invoice_list_summary_params.rb +12 -11
- data/lib/orb/models/invoice_status_filter.rb +18 -0
- data/lib/orb/models/subscription_list_params.rb +52 -15
- data/lib/orb/models/subscription_list_summary_params.rb +50 -15
- data/lib/orb/models/subscription_status_filter.rb +16 -0
- data/lib/orb/models.rb +4 -0
- data/lib/orb/resources/customers/credits/ledger.rb +56 -0
- data/lib/orb/resources/invoices.rb +16 -2
- data/lib/orb/resources/subscriptions.rb +6 -6
- data/lib/orb/version.rb +1 -1
- data/lib/orb.rb +2 -0
- data/rbi/orb/models/invoice_list_params.rbi +37 -17
- data/rbi/orb/models/invoice_list_summary_params.rbi +38 -18
- data/rbi/orb/models/invoice_status_filter.rbi +22 -0
- data/rbi/orb/models/subscription_list_params.rbi +100 -21
- data/rbi/orb/models/subscription_list_summary_params.rbi +99 -28
- data/rbi/orb/models/subscription_status_filter.rbi +23 -0
- data/rbi/orb/models.rbi +4 -0
- data/rbi/orb/resources/customers/credits/ledger.rbi +56 -0
- data/rbi/orb/resources/invoices.rbi +28 -2
- data/rbi/orb/resources/subscriptions.rbi +25 -6
- data/sig/orb/models/invoice_list_params.rbs +10 -12
- data/sig/orb/models/invoice_list_summary_params.rbs +6 -8
- data/sig/orb/models/invoice_status_filter.rbs +17 -0
- data/sig/orb/models/subscription_list_params.rbs +34 -14
- data/sig/orb/models/subscription_list_summary_params.rbs +34 -14
- data/sig/orb/models/subscription_status_filter.rbs +15 -0
- data/sig/orb/models.rbs +4 -0
- data/sig/orb/resources/invoices.rbs +1 -1
- data/sig/orb/resources/subscriptions.rbs +4 -4
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: be523d90a6c8534cc76e0d782fc89afc7027285acd222ea20fc2f4f47b60fad2
|
|
4
|
+
data.tar.gz: ebef81e42f4e03646fca774c4466f5424c8fad29972eb6853754e6c01c156fc8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
@@ -109,8 +109,8 @@ module Orb
|
|
|
109
109
|
|
|
110
110
|
# @!attribute status
|
|
111
111
|
#
|
|
112
|
-
# @return [Array<Symbol, Orb::Models::
|
|
113
|
-
optional :status, -> { Orb::
|
|
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::
|
|
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::
|
|
177
|
+
extend Orb::Internal::Type::Union
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
ISSUED = :issued
|
|
181
|
-
PAID = :paid
|
|
182
|
-
SYNCED = :synced
|
|
183
|
-
VOID = :void
|
|
179
|
+
variant enum: -> { Orb::InvoiceStatusFilter }
|
|
184
180
|
|
|
185
|
-
|
|
186
|
-
|
|
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::
|
|
105
|
-
optional :status,
|
|
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::
|
|
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::
|
|
167
|
+
extend Orb::Internal::Type::Union
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
ISSUED = :issued
|
|
171
|
-
PAID = :paid
|
|
172
|
-
SYNCED = :synced
|
|
173
|
-
VOID = :void
|
|
169
|
+
variant enum: -> { Orb::InvoiceStatusFilter }
|
|
174
170
|
|
|
175
|
-
|
|
176
|
-
|
|
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::
|
|
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,
|
|
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::
|
|
66
|
-
optional :status,
|
|
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::
|
|
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::
|
|
129
|
+
extend Orb::Internal::Type::Union
|
|
130
|
+
|
|
131
|
+
variant enum: -> { Orb::SubscriptionStatusFilter }
|
|
132
|
+
|
|
133
|
+
variant -> { Orb::Models::SubscriptionListParams::Status::SubscriptionStatusFilterArray }
|
|
98
134
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
UPCOMING = :upcoming
|
|
135
|
+
# @!method self.variants
|
|
136
|
+
# @return [Array(Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>)]
|
|
102
137
|
|
|
103
|
-
#
|
|
104
|
-
|
|
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,
|
|
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,
|
|
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::
|
|
66
|
-
optional :status,
|
|
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::
|
|
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::
|
|
127
|
+
extend Orb::Internal::Type::Union
|
|
128
|
+
|
|
129
|
+
variant enum: -> { Orb::SubscriptionStatusFilter }
|
|
130
|
+
|
|
131
|
+
variant -> { Orb::Models::SubscriptionListSummaryParams::Status::SubscriptionStatusFilterArray }
|
|
98
132
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
UPCOMING = :upcoming
|
|
133
|
+
# @!method self.variants
|
|
134
|
+
# @return [Array(Symbol, Orb::Models::SubscriptionStatusFilter, Array<Symbol, Orb::Models::SubscriptionStatusFilter>)]
|
|
102
135
|
|
|
103
|
-
#
|
|
104
|
-
|
|
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::
|
|
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::
|
|
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::
|
|
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::
|
|
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
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(
|
|
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:
|
|
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(
|
|
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::
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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.
|
|
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
|