orb-billing 1.48.0 → 1.50.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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/orb/models/changed_subscription_resources.rb +21 -1
  5. data/lib/orb/models/customers/credit_fetch_balance_by_external_id_params.rb +31 -0
  6. data/lib/orb/models/customers/credit_fetch_balance_by_external_id_response.rb +61 -0
  7. data/lib/orb/models/customers/credit_fetch_balance_params.rb +31 -0
  8. data/lib/orb/models/customers/credit_fetch_balance_response.rb +60 -0
  9. data/lib/orb/models/invoice.rb +21 -1
  10. data/lib/orb/models/invoice_fetch_upcoming_response.rb +21 -1
  11. data/lib/orb/models/invoice_issue_summary_response.rb +21 -1
  12. data/lib/orb/models/invoice_issued_summary_webhook_event.rb +21 -1
  13. data/lib/orb/models/invoice_list_summary_response.rb +21 -1
  14. data/lib/orb/models/subscription_list_summary_params.rb +108 -0
  15. data/lib/orb/models/subscription_list_summary_response.rb +130 -0
  16. data/lib/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rb +21 -1
  17. data/lib/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rb +21 -1
  18. data/lib/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rb +21 -1
  19. data/lib/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rb +21 -1
  20. data/lib/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rb +21 -1
  21. data/lib/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rb +21 -1
  22. data/lib/orb/models/webhooks/invoice_edited_standard_webhook_event.rb +21 -1
  23. data/lib/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rb +21 -1
  24. data/lib/orb/models/webhooks/invoice_issued_standard_webhook_event.rb +21 -1
  25. data/lib/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rb +21 -1
  26. data/lib/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rb +21 -1
  27. data/lib/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rb +21 -1
  28. data/lib/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rb +21 -1
  29. data/lib/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rb +21 -1
  30. data/lib/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rb +21 -1
  31. data/lib/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rb +21 -1
  32. data/lib/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rb +21 -1
  33. data/lib/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rb +21 -1
  34. data/lib/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rb +21 -1
  35. data/lib/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rb +21 -1
  36. data/lib/orb/models.rb +2 -0
  37. data/lib/orb/resources/alerts.rb +7 -4
  38. data/lib/orb/resources/customers/credits.rb +76 -0
  39. data/lib/orb/resources/subscriptions.rb +60 -0
  40. data/lib/orb/version.rb +1 -1
  41. data/lib/orb.rb +6 -0
  42. data/rbi/orb/models/changed_subscription_resources.rbi +24 -0
  43. data/rbi/orb/models/customers/credit_fetch_balance_by_external_id_params.rbi +54 -0
  44. data/rbi/orb/models/customers/credit_fetch_balance_by_external_id_response.rbi +86 -0
  45. data/rbi/orb/models/customers/credit_fetch_balance_params.rbi +54 -0
  46. data/rbi/orb/models/customers/credit_fetch_balance_response.rbi +86 -0
  47. data/rbi/orb/models/invoice.rbi +24 -0
  48. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +24 -0
  49. data/rbi/orb/models/invoice_issue_summary_response.rbi +24 -0
  50. data/rbi/orb/models/invoice_issued_summary_webhook_event.rbi +24 -0
  51. data/rbi/orb/models/invoice_list_summary_response.rbi +24 -0
  52. data/rbi/orb/models/subscription_list_summary_params.rbi +148 -0
  53. data/rbi/orb/models/subscription_list_summary_response.rbi +214 -0
  54. data/rbi/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rbi +24 -0
  55. data/rbi/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rbi +24 -0
  56. data/rbi/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rbi +24 -0
  57. data/rbi/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rbi +24 -0
  58. data/rbi/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rbi +24 -0
  59. data/rbi/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rbi +24 -0
  60. data/rbi/orb/models/webhooks/invoice_edited_standard_webhook_event.rbi +24 -0
  61. data/rbi/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rbi +24 -0
  62. data/rbi/orb/models/webhooks/invoice_issued_standard_webhook_event.rbi +24 -0
  63. data/rbi/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rbi +24 -0
  64. data/rbi/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rbi +24 -0
  65. data/rbi/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rbi +24 -0
  66. data/rbi/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rbi +24 -0
  67. data/rbi/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rbi +24 -0
  68. data/rbi/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rbi +24 -0
  69. data/rbi/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rbi +24 -0
  70. data/rbi/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rbi +24 -0
  71. data/rbi/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rbi +24 -0
  72. data/rbi/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rbi +24 -0
  73. data/rbi/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rbi +24 -0
  74. data/rbi/orb/models.rbi +2 -0
  75. data/rbi/orb/resources/alerts.rbi +7 -4
  76. data/rbi/orb/resources/customers/credits.rbi +60 -0
  77. data/rbi/orb/resources/subscriptions.rbi +47 -0
  78. data/sig/orb/models/changed_subscription_resources.rbs +10 -0
  79. data/sig/orb/models/customers/credit_fetch_balance_by_external_id_params.rbs +30 -0
  80. data/sig/orb/models/customers/credit_fetch_balance_by_external_id_response.rbs +42 -0
  81. data/sig/orb/models/customers/credit_fetch_balance_params.rbs +30 -0
  82. data/sig/orb/models/customers/credit_fetch_balance_response.rbs +42 -0
  83. data/sig/orb/models/invoice.rbs +10 -0
  84. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +10 -0
  85. data/sig/orb/models/invoice_issue_summary_response.rbs +10 -0
  86. data/sig/orb/models/invoice_issued_summary_webhook_event.rbs +10 -0
  87. data/sig/orb/models/invoice_list_summary_response.rbs +10 -0
  88. data/sig/orb/models/subscription_list_summary_params.rbs +90 -0
  89. data/sig/orb/models/subscription_list_summary_response.rbs +94 -0
  90. data/sig/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rbs +10 -0
  91. data/sig/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rbs +10 -0
  92. data/sig/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rbs +10 -0
  93. data/sig/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rbs +10 -0
  94. data/sig/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rbs +10 -0
  95. data/sig/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rbs +10 -0
  96. data/sig/orb/models/webhooks/invoice_edited_standard_webhook_event.rbs +10 -0
  97. data/sig/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rbs +10 -0
  98. data/sig/orb/models/webhooks/invoice_issued_standard_webhook_event.rbs +10 -0
  99. data/sig/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rbs +10 -0
  100. data/sig/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rbs +10 -0
  101. data/sig/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rbs +10 -0
  102. data/sig/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rbs +10 -0
  103. data/sig/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rbs +10 -0
  104. data/sig/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rbs +10 -0
  105. data/sig/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rbs +10 -0
  106. data/sig/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rbs +10 -0
  107. data/sig/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rbs +10 -0
  108. data/sig/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rbs +10 -0
  109. data/sig/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rbs +10 -0
  110. data/sig/orb/models.rbs +2 -0
  111. data/sig/orb/resources/customers/credits.rbs +12 -0
  112. data/sig/orb/resources/subscriptions.rbs +15 -0
  113. metadata +19 -1
@@ -612,6 +612,18 @@ module Orb
612
612
  sig { returns(T.nilable(Time)) }
613
613
  attr_accessor :scheduled_issue_at
614
614
 
615
+ # The latest `end_date` of the invoice's line items, including any line items
616
+ # hidden because they have zero quantity. This is `null` when the invoice has no
617
+ # line items.
618
+ sig { returns(T.nilable(Time)) }
619
+ attr_accessor :service_period_end
620
+
621
+ # The earliest `start_date` of the invoice's line items, including any line items
622
+ # hidden because they have zero quantity. This is `null` when the invoice has no
623
+ # line items.
624
+ sig { returns(T.nilable(Time)) }
625
+ attr_accessor :service_period_start
626
+
615
627
  sig { returns(T.nilable(Orb::Address)) }
616
628
  attr_reader :shipping_address
617
629
 
@@ -697,6 +709,8 @@ module Orb
697
709
  payment_received_at: T.nilable(Time),
698
710
  payment_started_at: T.nilable(Time),
699
711
  scheduled_issue_at: T.nilable(Time),
712
+ service_period_end: T.nilable(Time),
713
+ service_period_start: T.nilable(Time),
700
714
  shipping_address: T.nilable(Orb::Address::OrHash),
701
715
  status:
702
716
  Orb::Webhooks::SalesOrderAccountingSyncSucceededStandardWebhookEvent::Invoice::Status::OrSymbol,
@@ -927,6 +941,14 @@ module Orb
927
941
  # If the invoice is in draft, this timestamp will reflect when the invoice is
928
942
  # scheduled to be issued.
929
943
  scheduled_issue_at:,
944
+ # The latest `end_date` of the invoice's line items, including any line items
945
+ # hidden because they have zero quantity. This is `null` when the invoice has no
946
+ # line items.
947
+ service_period_end:,
948
+ # The earliest `start_date` of the invoice's line items, including any line items
949
+ # hidden because they have zero quantity. This is `null` when the invoice has no
950
+ # line items.
951
+ service_period_start:,
930
952
  shipping_address:,
931
953
  status:,
932
954
  subscription:,
@@ -986,6 +1008,8 @@ module Orb
986
1008
  payment_received_at: T.nilable(Time),
987
1009
  payment_started_at: T.nilable(Time),
988
1010
  scheduled_issue_at: T.nilable(Time),
1011
+ service_period_end: T.nilable(Time),
1012
+ service_period_start: T.nilable(Time),
989
1013
  shipping_address: T.nilable(Orb::Address),
990
1014
  status:
991
1015
  Orb::Webhooks::SalesOrderAccountingSyncSucceededStandardWebhookEvent::Invoice::Status::TaggedSymbol,
data/rbi/orb/models.rbi CHANGED
@@ -813,6 +813,8 @@ module Orb
813
813
 
814
814
  SubscriptionListParams = Orb::Models::SubscriptionListParams
815
815
 
816
+ SubscriptionListSummaryParams = Orb::Models::SubscriptionListSummaryParams
817
+
816
818
  SubscriptionMinified = Orb::Models::SubscriptionMinified
817
819
 
818
820
  SubscriptionPlanChangedWebhookEvent =
@@ -187,8 +187,9 @@ module Orb
187
187
  # before invoice-level adjustments and credits) denominated in the alert's
188
188
  # currency exceeds predefined thresholds during the current billing cycle;
189
189
  # `price_filters` can scope which prices contribute. Each plan can have one
190
- # `cost_exceeded` alert and one `usage_exceeded` alert per metric that is a part
191
- # of the plan.
190
+ # `cost_exceeded` alert, one `usage_exceeded` alert per metric that is a part of
191
+ # the plan, and up to 50 `spend_exceeded` alerts, one per combination of currency
192
+ # and `price_filters`, so separate products can each have their own spend alert.
192
193
  sig do
193
194
  params(
194
195
  plan_id: String,
@@ -243,8 +244,10 @@ module Orb
243
244
  # spend (the pricing subtotal, before invoice-level adjustments and credits)
244
245
  # denominated in the alert's currency exceeds predefined thresholds during the
245
246
  # current billing cycle; `price_filters` can scope which prices contribute. Each
246
- # subscription can have one `cost_exceeded` alert and one `usage_exceeded` alert
247
- # per metric that is a part of the subscription.
247
+ # subscription can have one `cost_exceeded` alert, one `usage_exceeded` alert per
248
+ # metric that is a part of the subscription, and up to 50 `spend_exceeded` alerts,
249
+ # one per combination of currency and `price_filters`, so separate products can
250
+ # each have their own spend alert.
248
251
  sig do
249
252
  params(
250
253
  subscription_id: String,
@@ -64,6 +64,66 @@ module Orb
64
64
  )
65
65
  end
66
66
 
67
+ # This endpoint returns a customer's credit balance in a single currency or custom
68
+ # pricing unit: the total available balance, the balance waiting on payment, and
69
+ # the next upcoming expiration.
70
+ #
71
+ # `balance` is the sum of `balance` across the customer's `active` credit blocks,
72
+ # as listed by
73
+ # [Fetch customer credit balance](/api-reference/credit/fetch-customer-credit-balance).
74
+ # Expired, depleted, and voided blocks are not included. Blocks in
75
+ # `pending_payment` status are totaled in `pending_payment_balance` instead, and
76
+ # become available once their invoice is paid.
77
+ #
78
+ # Note that `currency` defaults to credits if not specified. To use a real world
79
+ # currency, set `currency` to an ISO 4217 string. A customer with no credits in
80
+ # that currency returns a balance of `0`.
81
+ sig do
82
+ params(
83
+ customer_id: String,
84
+ currency: T.nilable(String),
85
+ request_options: Orb::RequestOptions::OrHash
86
+ ).returns(Orb::Models::Customers::CreditFetchBalanceResponse)
87
+ end
88
+ def fetch_balance(
89
+ customer_id,
90
+ # The ledger currency or custom pricing unit to use.
91
+ currency: nil,
92
+ request_options: {}
93
+ )
94
+ end
95
+
96
+ # This endpoint returns a customer's credit balance in a single currency or custom
97
+ # pricing unit: the total available balance, the balance waiting on payment, and
98
+ # the next upcoming expiration.
99
+ #
100
+ # `balance` is the sum of `balance` across the customer's `active` credit blocks,
101
+ # as listed by
102
+ # [Fetch customer credit balance](/api-reference/credit/fetch-customer-credit-balance).
103
+ # Expired, depleted, and voided blocks are not included. Blocks in
104
+ # `pending_payment` status are totaled in `pending_payment_balance` instead, and
105
+ # become available once their invoice is paid.
106
+ #
107
+ # Note that `currency` defaults to credits if not specified. To use a real world
108
+ # currency, set `currency` to an ISO 4217 string. A customer with no credits in
109
+ # that currency returns a balance of `0`.
110
+ sig do
111
+ params(
112
+ external_customer_id: String,
113
+ currency: T.nilable(String),
114
+ request_options: Orb::RequestOptions::OrHash
115
+ ).returns(
116
+ Orb::Models::Customers::CreditFetchBalanceByExternalIDResponse
117
+ )
118
+ end
119
+ def fetch_balance_by_external_id(
120
+ external_customer_id,
121
+ # The ledger currency or custom pricing unit to use.
122
+ currency: nil,
123
+ request_options: {}
124
+ )
125
+ end
126
+
67
127
  # Returns a paginated list of unexpired, non-zero credit blocks for a customer.
68
128
  #
69
129
  # If `include_all_blocks` is set to `true`, all credit blocks (including expired
@@ -923,6 +923,53 @@ module Orb
923
923
  )
924
924
  end
925
925
 
926
+ # This is a lighter-weight version of
927
+ # [List subscriptions](/api-reference/subscription/list-subscriptions), with the
928
+ # same filters, pagination and order. It returns each subscription's own fields,
929
+ # with its plan and customer as references, and leaves out price intervals,
930
+ # billing periods, plan phases and other derived fields, making it faster to
931
+ # respond. Fetch a subscription for those.
932
+ #
933
+ # This is the same summary of a subscription that standard
934
+ # [webhook payloads](/integrations-and-exports/webhook-payload-styles) carry.
935
+ sig do
936
+ params(
937
+ created_at_gt: T.nilable(Time),
938
+ created_at_gte: T.nilable(Time),
939
+ created_at_lt: T.nilable(Time),
940
+ created_at_lte: T.nilable(Time),
941
+ cursor: T.nilable(String),
942
+ customer_id: T.nilable(String),
943
+ external_customer_id: T.nilable(String),
944
+ external_plan_id: T.nilable(String),
945
+ limit: Integer,
946
+ plan_id: T.nilable(String),
947
+ status:
948
+ T.nilable(Orb::SubscriptionListSummaryParams::Status::OrSymbol),
949
+ request_options: Orb::RequestOptions::OrHash
950
+ ).returns(
951
+ Orb::Internal::Page[Orb::Models::SubscriptionListSummaryResponse]
952
+ )
953
+ end
954
+ def list_summary(
955
+ created_at_gt: nil,
956
+ created_at_gte: nil,
957
+ created_at_lt: nil,
958
+ created_at_lte: nil,
959
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
960
+ # from the initial request.
961
+ cursor: nil,
962
+ customer_id: nil,
963
+ external_customer_id: nil,
964
+ external_plan_id: nil,
965
+ # The number of items to fetch. Defaults to 20.
966
+ limit: nil,
967
+ plan_id: nil,
968
+ status: nil,
969
+ request_options: {}
970
+ )
971
+ end
972
+
926
973
  # This endpoint is used to add and edit subscription
927
974
  # [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By
928
975
  # making modifications to a subscription’s price intervals, you can
@@ -69,6 +69,8 @@ module Orb
69
69
  payment_received_at: Time?,
70
70
  payment_started_at: Time?,
71
71
  scheduled_issue_at: Time?,
72
+ service_period_end: Time?,
73
+ service_period_start: Time?,
72
74
  shipping_address: Orb::Address?,
73
75
  status: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::status,
74
76
  subscription: Orb::SubscriptionMinified?,
@@ -152,6 +154,10 @@ module Orb
152
154
 
153
155
  attr_accessor scheduled_issue_at: Time?
154
156
 
157
+ attr_accessor service_period_end: Time?
158
+
159
+ attr_accessor service_period_start: Time?
160
+
155
161
  attr_accessor shipping_address: Orb::Address?
156
162
 
157
163
  attr_accessor status: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::status
@@ -205,6 +211,8 @@ module Orb
205
211
  payment_received_at: Time?,
206
212
  payment_started_at: Time?,
207
213
  scheduled_issue_at: Time?,
214
+ service_period_end: Time?,
215
+ service_period_start: Time?,
208
216
  shipping_address: Orb::Address?,
209
217
  status: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::status,
210
218
  subscription: Orb::SubscriptionMinified?,
@@ -252,6 +260,8 @@ module Orb
252
260
  payment_received_at: Time?,
253
261
  payment_started_at: Time?,
254
262
  scheduled_issue_at: Time?,
263
+ service_period_end: Time?,
264
+ service_period_start: Time?,
255
265
  shipping_address: Orb::Address?,
256
266
  status: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::status,
257
267
  subscription: Orb::SubscriptionMinified?,
@@ -0,0 +1,30 @@
1
+ module Orb
2
+ module Models
3
+ module Customers
4
+ type credit_fetch_balance_by_external_id_params =
5
+ { external_customer_id: String, currency: String? }
6
+ & Orb::Internal::Type::request_parameters
7
+
8
+ class CreditFetchBalanceByExternalIDParams < Orb::Internal::Type::BaseModel
9
+ extend Orb::Internal::Type::RequestParameters::Converter
10
+ include Orb::Internal::Type::RequestParameters
11
+
12
+ attr_accessor external_customer_id: String
13
+
14
+ attr_accessor currency: String?
15
+
16
+ def initialize: (
17
+ external_customer_id: String,
18
+ ?currency: String?,
19
+ ?request_options: Orb::request_opts
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ external_customer_id: String,
24
+ currency: String?,
25
+ request_options: Orb::RequestOptions
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,42 @@
1
+ module Orb
2
+ module Models
3
+ module Customers
4
+ type credit_fetch_balance_by_external_id_response =
5
+ {
6
+ balance: Float,
7
+ currency: String?,
8
+ next_expiry_balance: Float?,
9
+ next_expiry_date: Time?,
10
+ pending_payment_balance: Float
11
+ }
12
+
13
+ class CreditFetchBalanceByExternalIDResponse < Orb::Internal::Type::BaseModel
14
+ attr_accessor balance: Float
15
+
16
+ attr_accessor currency: String?
17
+
18
+ attr_accessor next_expiry_balance: Float?
19
+
20
+ attr_accessor next_expiry_date: Time?
21
+
22
+ attr_accessor pending_payment_balance: Float
23
+
24
+ def initialize: (
25
+ balance: Float,
26
+ currency: String?,
27
+ next_expiry_balance: Float?,
28
+ next_expiry_date: Time?,
29
+ pending_payment_balance: Float
30
+ ) -> void
31
+
32
+ def to_hash: -> {
33
+ balance: Float,
34
+ currency: String?,
35
+ next_expiry_balance: Float?,
36
+ next_expiry_date: Time?,
37
+ pending_payment_balance: Float
38
+ }
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,30 @@
1
+ module Orb
2
+ module Models
3
+ module Customers
4
+ type credit_fetch_balance_params =
5
+ { customer_id: String, currency: String? }
6
+ & Orb::Internal::Type::request_parameters
7
+
8
+ class CreditFetchBalanceParams < Orb::Internal::Type::BaseModel
9
+ extend Orb::Internal::Type::RequestParameters::Converter
10
+ include Orb::Internal::Type::RequestParameters
11
+
12
+ attr_accessor customer_id: String
13
+
14
+ attr_accessor currency: String?
15
+
16
+ def initialize: (
17
+ customer_id: String,
18
+ ?currency: String?,
19
+ ?request_options: Orb::request_opts
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ customer_id: String,
24
+ currency: String?,
25
+ request_options: Orb::RequestOptions
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,42 @@
1
+ module Orb
2
+ module Models
3
+ module Customers
4
+ type credit_fetch_balance_response =
5
+ {
6
+ balance: Float,
7
+ currency: String?,
8
+ next_expiry_balance: Float?,
9
+ next_expiry_date: Time?,
10
+ pending_payment_balance: Float
11
+ }
12
+
13
+ class CreditFetchBalanceResponse < Orb::Internal::Type::BaseModel
14
+ attr_accessor balance: Float
15
+
16
+ attr_accessor currency: String?
17
+
18
+ attr_accessor next_expiry_balance: Float?
19
+
20
+ attr_accessor next_expiry_date: Time?
21
+
22
+ attr_accessor pending_payment_balance: Float
23
+
24
+ def initialize: (
25
+ balance: Float,
26
+ currency: String?,
27
+ next_expiry_balance: Float?,
28
+ next_expiry_date: Time?,
29
+ pending_payment_balance: Float
30
+ ) -> void
31
+
32
+ def to_hash: -> {
33
+ balance: Float,
34
+ currency: String?,
35
+ next_expiry_balance: Float?,
36
+ next_expiry_date: Time?,
37
+ pending_payment_balance: Float
38
+ }
39
+ end
40
+ end
41
+ end
42
+ end
@@ -37,6 +37,8 @@ module Orb
37
37
  payment_received_at: Time?,
38
38
  payment_started_at: Time?,
39
39
  scheduled_issue_at: Time?,
40
+ service_period_end: Time?,
41
+ service_period_start: Time?,
40
42
  shipping_address: Orb::Address?,
41
43
  status: Orb::Models::Invoice::status,
42
44
  subscription: Orb::SubscriptionMinified?,
@@ -118,6 +120,10 @@ module Orb
118
120
 
119
121
  attr_accessor scheduled_issue_at: Time?
120
122
 
123
+ attr_accessor service_period_end: Time?
124
+
125
+ attr_accessor service_period_start: Time?
126
+
121
127
  attr_accessor shipping_address: Orb::Address?
122
128
 
123
129
  attr_accessor status: Orb::Models::Invoice::status
@@ -170,6 +176,8 @@ module Orb
170
176
  payment_received_at: Time?,
171
177
  payment_started_at: Time?,
172
178
  scheduled_issue_at: Time?,
179
+ service_period_end: Time?,
180
+ service_period_start: Time?,
173
181
  shipping_address: Orb::Address?,
174
182
  status: Orb::Models::Invoice::status,
175
183
  subscription: Orb::SubscriptionMinified?,
@@ -216,6 +224,8 @@ module Orb
216
224
  payment_received_at: Time?,
217
225
  payment_started_at: Time?,
218
226
  scheduled_issue_at: Time?,
227
+ service_period_end: Time?,
228
+ service_period_start: Time?,
219
229
  shipping_address: Orb::Address?,
220
230
  status: Orb::Models::Invoice::status,
221
231
  subscription: Orb::SubscriptionMinified?,
@@ -36,6 +36,8 @@ module Orb
36
36
  payment_received_at: Time?,
37
37
  payment_started_at: Time?,
38
38
  scheduled_issue_at: Time?,
39
+ service_period_end: Time?,
40
+ service_period_start: Time?,
39
41
  shipping_address: Orb::Address?,
40
42
  status: Orb::Models::InvoiceFetchUpcomingResponse::status,
41
43
  subscription: Orb::SubscriptionMinified?,
@@ -116,6 +118,10 @@ module Orb
116
118
 
117
119
  attr_accessor scheduled_issue_at: Time?
118
120
 
121
+ attr_accessor service_period_end: Time?
122
+
123
+ attr_accessor service_period_start: Time?
124
+
119
125
  attr_accessor shipping_address: Orb::Address?
120
126
 
121
127
  attr_accessor status: Orb::Models::InvoiceFetchUpcomingResponse::status
@@ -169,6 +175,8 @@ module Orb
169
175
  payment_received_at: Time?,
170
176
  payment_started_at: Time?,
171
177
  scheduled_issue_at: Time?,
178
+ service_period_end: Time?,
179
+ service_period_start: Time?,
172
180
  shipping_address: Orb::Address?,
173
181
  status: Orb::Models::InvoiceFetchUpcomingResponse::status,
174
182
  subscription: Orb::SubscriptionMinified?,
@@ -215,6 +223,8 @@ module Orb
215
223
  payment_received_at: Time?,
216
224
  payment_started_at: Time?,
217
225
  scheduled_issue_at: Time?,
226
+ service_period_end: Time?,
227
+ service_period_start: Time?,
218
228
  shipping_address: Orb::Address?,
219
229
  status: Orb::Models::InvoiceFetchUpcomingResponse::status,
220
230
  subscription: Orb::SubscriptionMinified?,
@@ -29,6 +29,8 @@ module Orb
29
29
  payment_received_at: Time?,
30
30
  payment_started_at: Time?,
31
31
  scheduled_issue_at: Time?,
32
+ service_period_end: Time?,
33
+ service_period_start: Time?,
32
34
  shipping_address: Orb::Address?,
33
35
  status: Orb::Models::InvoiceIssueSummaryResponse::status,
34
36
  subscription: Orb::SubscriptionMinified?,
@@ -93,6 +95,10 @@ module Orb
93
95
 
94
96
  attr_accessor scheduled_issue_at: Time?
95
97
 
98
+ attr_accessor service_period_end: Time?
99
+
100
+ attr_accessor service_period_start: Time?
101
+
96
102
  attr_accessor shipping_address: Orb::Address?
97
103
 
98
104
  attr_accessor status: Orb::Models::InvoiceIssueSummaryResponse::status
@@ -135,6 +141,8 @@ module Orb
135
141
  payment_received_at: Time?,
136
142
  payment_started_at: Time?,
137
143
  scheduled_issue_at: Time?,
144
+ service_period_end: Time?,
145
+ service_period_start: Time?,
138
146
  shipping_address: Orb::Address?,
139
147
  status: Orb::Models::InvoiceIssueSummaryResponse::status,
140
148
  subscription: Orb::SubscriptionMinified?,
@@ -172,6 +180,8 @@ module Orb
172
180
  payment_received_at: Time?,
173
181
  payment_started_at: Time?,
174
182
  scheduled_issue_at: Time?,
183
+ service_period_end: Time?,
184
+ service_period_start: Time?,
175
185
  shipping_address: Orb::Address?,
176
186
  status: Orb::Models::InvoiceIssueSummaryResponse::status,
177
187
  subscription: Orb::SubscriptionMinified?,
@@ -70,6 +70,8 @@ module Orb
70
70
  payment_received_at: Time?,
71
71
  payment_started_at: Time?,
72
72
  scheduled_issue_at: Time?,
73
+ service_period_end: Time?,
74
+ service_period_start: Time?,
73
75
  shipping_address: Orb::Address?,
74
76
  status: Orb::Models::InvoiceIssuedSummaryWebhookEvent::Invoice::status,
75
77
  subscription: Orb::SubscriptionMinified?,
@@ -134,6 +136,10 @@ module Orb
134
136
 
135
137
  attr_accessor scheduled_issue_at: Time?
136
138
 
139
+ attr_accessor service_period_end: Time?
140
+
141
+ attr_accessor service_period_start: Time?
142
+
137
143
  attr_accessor shipping_address: Orb::Address?
138
144
 
139
145
  attr_accessor status: Orb::Models::InvoiceIssuedSummaryWebhookEvent::Invoice::status
@@ -176,6 +182,8 @@ module Orb
176
182
  payment_received_at: Time?,
177
183
  payment_started_at: Time?,
178
184
  scheduled_issue_at: Time?,
185
+ service_period_end: Time?,
186
+ service_period_start: Time?,
179
187
  shipping_address: Orb::Address?,
180
188
  status: Orb::Models::InvoiceIssuedSummaryWebhookEvent::Invoice::status,
181
189
  subscription: Orb::SubscriptionMinified?,
@@ -213,6 +221,8 @@ module Orb
213
221
  payment_received_at: Time?,
214
222
  payment_started_at: Time?,
215
223
  scheduled_issue_at: Time?,
224
+ service_period_end: Time?,
225
+ service_period_start: Time?,
216
226
  shipping_address: Orb::Address?,
217
227
  status: Orb::Models::InvoiceIssuedSummaryWebhookEvent::Invoice::status,
218
228
  subscription: Orb::SubscriptionMinified?,
@@ -29,6 +29,8 @@ module Orb
29
29
  payment_received_at: Time?,
30
30
  payment_started_at: Time?,
31
31
  scheduled_issue_at: Time?,
32
+ service_period_end: Time?,
33
+ service_period_start: Time?,
32
34
  shipping_address: Orb::Address?,
33
35
  status: Orb::Models::InvoiceListSummaryResponse::status,
34
36
  subscription: Orb::SubscriptionMinified?,
@@ -93,6 +95,10 @@ module Orb
93
95
 
94
96
  attr_accessor scheduled_issue_at: Time?
95
97
 
98
+ attr_accessor service_period_end: Time?
99
+
100
+ attr_accessor service_period_start: Time?
101
+
96
102
  attr_accessor shipping_address: Orb::Address?
97
103
 
98
104
  attr_accessor status: Orb::Models::InvoiceListSummaryResponse::status
@@ -135,6 +141,8 @@ module Orb
135
141
  payment_received_at: Time?,
136
142
  payment_started_at: Time?,
137
143
  scheduled_issue_at: Time?,
144
+ service_period_end: Time?,
145
+ service_period_start: Time?,
138
146
  shipping_address: Orb::Address?,
139
147
  status: Orb::Models::InvoiceListSummaryResponse::status,
140
148
  subscription: Orb::SubscriptionMinified?,
@@ -172,6 +180,8 @@ module Orb
172
180
  payment_received_at: Time?,
173
181
  payment_started_at: Time?,
174
182
  scheduled_issue_at: Time?,
183
+ service_period_end: Time?,
184
+ service_period_start: Time?,
175
185
  shipping_address: Orb::Address?,
176
186
  status: Orb::Models::InvoiceListSummaryResponse::status,
177
187
  subscription: Orb::SubscriptionMinified?,
@@ -0,0 +1,90 @@
1
+ module Orb
2
+ module Models
3
+ type subscription_list_summary_params =
4
+ {
5
+ created_at_gt: Time?,
6
+ created_at_gte: Time?,
7
+ created_at_lt: Time?,
8
+ created_at_lte: Time?,
9
+ cursor: String?,
10
+ customer_id: String?,
11
+ external_customer_id: String?,
12
+ external_plan_id: String?,
13
+ limit: Integer,
14
+ plan_id: String?,
15
+ status: Orb::Models::SubscriptionListSummaryParams::status?
16
+ }
17
+ & Orb::Internal::Type::request_parameters
18
+
19
+ class SubscriptionListSummaryParams < Orb::Internal::Type::BaseModel
20
+ extend Orb::Internal::Type::RequestParameters::Converter
21
+ include Orb::Internal::Type::RequestParameters
22
+
23
+ attr_accessor created_at_gt: Time?
24
+
25
+ attr_accessor created_at_gte: Time?
26
+
27
+ attr_accessor created_at_lt: Time?
28
+
29
+ attr_accessor created_at_lte: Time?
30
+
31
+ attr_accessor cursor: String?
32
+
33
+ attr_accessor customer_id: String?
34
+
35
+ attr_accessor external_customer_id: String?
36
+
37
+ attr_accessor external_plan_id: String?
38
+
39
+ attr_reader limit: Integer?
40
+
41
+ def limit=: (Integer) -> Integer
42
+
43
+ attr_accessor plan_id: String?
44
+
45
+ attr_accessor status: Orb::Models::SubscriptionListSummaryParams::status?
46
+
47
+ def initialize: (
48
+ ?created_at_gt: Time?,
49
+ ?created_at_gte: Time?,
50
+ ?created_at_lt: Time?,
51
+ ?created_at_lte: Time?,
52
+ ?cursor: String?,
53
+ ?customer_id: String?,
54
+ ?external_customer_id: String?,
55
+ ?external_plan_id: String?,
56
+ ?limit: Integer,
57
+ ?plan_id: String?,
58
+ ?status: Orb::Models::SubscriptionListSummaryParams::status?,
59
+ ?request_options: Orb::request_opts
60
+ ) -> void
61
+
62
+ def to_hash: -> {
63
+ created_at_gt: Time?,
64
+ created_at_gte: Time?,
65
+ created_at_lt: Time?,
66
+ created_at_lte: Time?,
67
+ cursor: String?,
68
+ customer_id: String?,
69
+ external_customer_id: String?,
70
+ external_plan_id: String?,
71
+ limit: Integer,
72
+ plan_id: String?,
73
+ status: Orb::Models::SubscriptionListSummaryParams::status?,
74
+ request_options: Orb::RequestOptions
75
+ }
76
+
77
+ type status = :active | :ended | :upcoming
78
+
79
+ module Status
80
+ extend Orb::Internal::Type::Enum
81
+
82
+ ACTIVE: :active
83
+ ENDED: :ended
84
+ UPCOMING: :upcoming
85
+
86
+ def self?.values: -> ::Array[Orb::Models::SubscriptionListSummaryParams::status]
87
+ end
88
+ end
89
+ end
90
+ end