orb-billing 1.57.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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +0 -8
  5. data/lib/orb/models/invoice_list_params.rb +12 -11
  6. data/lib/orb/models/invoice_list_summary_params.rb +12 -11
  7. data/lib/orb/models/invoice_status_filter.rb +18 -0
  8. data/lib/orb/models/migration_create_params.rb +10 -1
  9. data/lib/orb/models/{beta_create_plan_version_params.rb → plan_create_plan_version_params.rb} +430 -430
  10. data/lib/orb/models/{beta_fetch_plan_version_params.rb → plan_fetch_plan_version_params.rb} +2 -2
  11. data/lib/orb/models/{beta_set_default_plan_version_params.rb → plan_set_default_plan_version_params.rb} +2 -2
  12. data/lib/orb/models/plan_version.rb +1 -1
  13. data/lib/orb/models/plans/draft_discard_params.rb +22 -0
  14. data/lib/orb/models/plans/draft_fetch_params.rb +22 -0
  15. data/lib/orb/models/plans/draft_publish_params.rb +31 -0
  16. data/lib/orb/models/plans/draft_save_params.rb +7522 -0
  17. data/lib/orb/models/plans/external_plan_id/draft_discard_params.rb +24 -0
  18. data/lib/orb/models/plans/external_plan_id/draft_fetch_params.rb +24 -0
  19. data/lib/orb/models/plans/external_plan_id/draft_publish_params.rb +33 -0
  20. data/lib/orb/models/plans/external_plan_id/draft_save_params.rb +7595 -0
  21. data/lib/orb/models/{beta → plans}/external_plan_id_create_plan_version_params.rb +430 -430
  22. data/lib/orb/models/{beta → plans}/external_plan_id_fetch_plan_version_params.rb +2 -2
  23. data/lib/orb/models/{beta → plans}/external_plan_id_set_default_plan_version_params.rb +2 -2
  24. data/lib/orb/models/plans/plan_version_draft.rb +279 -0
  25. data/lib/orb/models/subscription_list_params.rb +52 -15
  26. data/lib/orb/models/subscription_list_summary_params.rb +50 -15
  27. data/lib/orb/models/subscription_status_filter.rb +16 -0
  28. data/lib/orb/models.rb +10 -8
  29. data/lib/orb/resources/customers/credits/ledger.rb +56 -0
  30. data/lib/orb/resources/invoices.rb +16 -2
  31. data/lib/orb/resources/migrations.rb +3 -1
  32. data/lib/orb/resources/plans/draft.rb +124 -0
  33. data/lib/orb/resources/plans/external_plan_id/draft.rb +126 -0
  34. data/lib/orb/resources/plans/external_plan_id.rb +96 -0
  35. data/lib/orb/resources/plans.rb +96 -0
  36. data/lib/orb/resources/subscriptions.rb +6 -6
  37. data/lib/orb/version.rb +1 -1
  38. data/lib/orb.rb +19 -8
  39. data/rbi/orb/client.rbi +0 -7
  40. data/rbi/orb/models/invoice_list_params.rbi +37 -17
  41. data/rbi/orb/models/invoice_list_summary_params.rbi +38 -18
  42. data/rbi/orb/models/invoice_status_filter.rbi +22 -0
  43. data/rbi/orb/models/migration_create_params.rbi +13 -0
  44. data/rbi/orb/models/{beta_create_plan_version_params.rbi → plan_create_plan_version_params.rbi} +744 -744
  45. data/rbi/orb/models/{beta_fetch_plan_version_params.rbi → plan_fetch_plan_version_params.rbi} +2 -2
  46. data/rbi/orb/models/{beta_set_default_plan_version_params.rbi → plan_set_default_plan_version_params.rbi} +2 -2
  47. data/rbi/orb/models/plans/draft_discard_params.rbi +37 -0
  48. data/rbi/orb/models/plans/draft_fetch_params.rbi +37 -0
  49. data/rbi/orb/models/plans/draft_publish_params.rbi +54 -0
  50. data/rbi/orb/models/plans/draft_save_params.rbi +13143 -0
  51. data/rbi/orb/models/plans/external_plan_id/draft_discard_params.rbi +42 -0
  52. data/rbi/orb/models/plans/external_plan_id/draft_fetch_params.rbi +42 -0
  53. data/rbi/orb/models/plans/external_plan_id/draft_publish_params.rbi +59 -0
  54. data/rbi/orb/models/plans/external_plan_id/draft_save_params.rbi +13256 -0
  55. data/rbi/orb/models/{beta → plans}/external_plan_id_create_plan_version_params.rbi +744 -744
  56. data/rbi/orb/models/{beta → plans}/external_plan_id_fetch_plan_version_params.rbi +2 -2
  57. data/rbi/orb/models/{beta → plans}/external_plan_id_set_default_plan_version_params.rbi +2 -2
  58. data/rbi/orb/models/plans/plan_version_draft.rbi +502 -0
  59. data/rbi/orb/models/subscription_list_params.rbi +100 -21
  60. data/rbi/orb/models/subscription_list_summary_params.rbi +99 -28
  61. data/rbi/orb/models/subscription_status_filter.rbi +23 -0
  62. data/rbi/orb/models.rbi +10 -8
  63. data/rbi/orb/resources/customers/credits/ledger.rbi +56 -0
  64. data/rbi/orb/resources/invoices.rbi +28 -2
  65. data/rbi/orb/resources/migrations.rbi +4 -0
  66. data/rbi/orb/resources/{beta/external_plan_id.rbi → plans/draft.rbi} +58 -59
  67. data/rbi/orb/resources/plans/external_plan_id/draft.rbi +126 -0
  68. data/rbi/orb/resources/plans/external_plan_id.rbi +102 -0
  69. data/rbi/orb/resources/plans.rbi +94 -0
  70. data/rbi/orb/resources/subscriptions.rbi +25 -6
  71. data/sig/orb/client.rbs +0 -2
  72. data/sig/orb/models/invoice_list_params.rbs +10 -12
  73. data/sig/orb/models/invoice_list_summary_params.rbs +6 -8
  74. data/sig/orb/models/invoice_status_filter.rbs +17 -0
  75. data/sig/orb/models/migration_create_params.rbs +7 -0
  76. data/sig/orb/models/{beta_create_plan_version_params.rbs → plan_create_plan_version_params.rbs} +448 -448
  77. data/sig/orb/models/{beta_fetch_plan_version_params.rbs → plan_fetch_plan_version_params.rbs} +2 -2
  78. data/sig/orb/models/{beta_set_default_plan_version_params.rbs → plan_set_default_plan_version_params.rbs} +2 -2
  79. data/sig/orb/models/plans/draft_discard_params.rbs +25 -0
  80. data/sig/orb/models/plans/draft_fetch_params.rbs +25 -0
  81. data/sig/orb/models/plans/draft_publish_params.rbs +32 -0
  82. data/sig/orb/models/plans/draft_save_params.rbs +5210 -0
  83. data/sig/orb/models/plans/external_plan_id/draft_discard_params.rbs +27 -0
  84. data/sig/orb/models/plans/external_plan_id/draft_fetch_params.rbs +27 -0
  85. data/sig/orb/models/plans/external_plan_id/draft_publish_params.rbs +34 -0
  86. data/sig/orb/models/plans/external_plan_id/draft_save_params.rbs +5215 -0
  87. data/sig/orb/models/{beta → plans}/external_plan_id_create_plan_version_params.rbs +447 -447
  88. data/sig/orb/models/{beta → plans}/external_plan_id_fetch_plan_version_params.rbs +1 -1
  89. data/sig/orb/models/{beta → plans}/external_plan_id_set_default_plan_version_params.rbs +1 -1
  90. data/sig/orb/models/plans/plan_version_draft.rbs +205 -0
  91. data/sig/orb/models/subscription_list_params.rbs +34 -14
  92. data/sig/orb/models/subscription_list_summary_params.rbs +34 -14
  93. data/sig/orb/models/subscription_status_filter.rbs +15 -0
  94. data/sig/orb/models.rbs +10 -8
  95. data/sig/orb/resources/invoices.rbs +1 -1
  96. data/sig/orb/resources/migrations.rbs +1 -0
  97. data/sig/orb/resources/plans/draft.rbs +37 -0
  98. data/sig/orb/resources/plans/external_plan_id/draft.rbs +39 -0
  99. data/sig/orb/resources/plans/external_plan_id.rbs +27 -0
  100. data/sig/orb/resources/plans.rbs +27 -0
  101. data/sig/orb/resources/subscriptions.rbs +4 -4
  102. metadata +2044 -2005
  103. data/lib/orb/resources/beta/external_plan_id.rb +0 -108
  104. data/lib/orb/resources/beta.rb +0 -114
  105. data/rbi/orb/resources/beta.rbi +0 -110
  106. data/sig/orb/resources/beta/external_plan_id.rbs +0 -34
  107. data/sig/orb/resources/beta.rbs +0 -34
@@ -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
@@ -45,14 +45,6 @@ module Orb
45
45
 
46
46
  BackfillRevertedWebhookEvent = Orb::Models::BackfillRevertedWebhookEvent
47
47
 
48
- Beta = Orb::Models::Beta
49
-
50
- BetaCreatePlanVersionParams = Orb::Models::BetaCreatePlanVersionParams
51
-
52
- BetaFetchPlanVersionParams = Orb::Models::BetaFetchPlanVersionParams
53
-
54
- BetaSetDefaultPlanVersionParams = Orb::Models::BetaSetDefaultPlanVersionParams
55
-
56
48
  BillableMetric = Orb::Models::BillableMetric
57
49
 
58
50
  BillableMetricEditedWebhookEvent =
@@ -335,6 +327,8 @@ module Orb
335
327
  InvoiceRegenerateReceiptPdfParams =
336
328
  Orb::Models::InvoiceRegenerateReceiptPdfParams
337
329
 
330
+ InvoiceStatusFilter = Orb::Models::InvoiceStatusFilter
331
+
338
332
  InvoiceSyncFailedWebhookEvent = Orb::Models::InvoiceSyncFailedWebhookEvent
339
333
 
340
334
  InvoiceSyncSucceededWebhookEvent =
@@ -694,6 +688,8 @@ module Orb
694
688
 
695
689
  PlanCreateParams = Orb::Models::PlanCreateParams
696
690
 
691
+ PlanCreatePlanVersionParams = Orb::Models::PlanCreatePlanVersionParams
692
+
697
693
  PlanDefaultVersionSetWebhookEvent =
698
694
  Orb::Models::PlanDefaultVersionSetWebhookEvent
699
695
 
@@ -701,6 +697,8 @@ module Orb
701
697
 
702
698
  PlanFetchParams = Orb::Models::PlanFetchParams
703
699
 
700
+ PlanFetchPlanVersionParams = Orb::Models::PlanFetchPlanVersionParams
701
+
704
702
  PlanListParams = Orb::Models::PlanListParams
705
703
 
706
704
  PlanPhaseAmountDiscountAdjustment =
@@ -718,6 +716,8 @@ module Orb
718
716
 
719
717
  Plans = Orb::Models::Plans
720
718
 
719
+ PlanSetDefaultPlanVersionParams = Orb::Models::PlanSetDefaultPlanVersionParams
720
+
721
721
  PlanUpdateParams = Orb::Models::PlanUpdateParams
722
722
 
723
723
  PlanVersion = Orb::Models::PlanVersion
@@ -858,6 +858,8 @@ module Orb
858
858
 
859
859
  SubscriptionStartedWebhookEvent = Orb::Models::SubscriptionStartedWebhookEvent
860
860
 
861
+ SubscriptionStatusFilter = Orb::Models::SubscriptionStatusFilter
862
+
861
863
  SubscriptionTrialEndedWebhookEvent =
862
864
  Orb::Models::SubscriptionTrialEndedWebhookEvent
863
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,
@@ -31,6 +31,7 @@ module Orb
31
31
  plan_id: T.nilable(String),
32
32
  plan_version_numbers: T.nilable(T::Array[Integer]),
33
33
  reason: T.nilable(String),
34
+ skip_grace_period: T::Boolean,
34
35
  statuses: T::Array[Orb::MigrationCreateParams::Status::OrSymbol],
35
36
  request_options: Orb::RequestOptions::OrHash
36
37
  ).returns(Orb::Models::MigrationCreateResponse)
@@ -69,6 +70,9 @@ module Orb
69
70
  plan_version_numbers: nil,
70
71
  # Why the migration was created.
71
72
  reason: nil,
73
+ # A new migration waits 5 minutes before it changes any subscriptions, so it can
74
+ # be canceled. When true, it starts right away instead.
75
+ skip_grace_period: nil,
72
76
  # Migrate subscriptions with these statuses. Defaults to active subscriptions.
73
77
  statuses: nil,
74
78
  request_options: {}