orb-billing 1.12.0 → 1.13.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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +72 -0
  5. data/lib/orb/internal/util.rb +31 -0
  6. data/lib/orb/models/billable_metric.rb +10 -1
  7. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +11 -2
  8. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +11 -2
  9. data/lib/orb/models/invoice_create_params.rb +11 -1
  10. data/lib/orb/models/invoice_update_params.rb +11 -1
  11. data/lib/orb/models/item.rb +1 -0
  12. data/lib/orb/models/item_update_params.rb +1 -0
  13. data/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +9 -1
  14. data/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +9 -1
  15. data/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +9 -1
  16. data/lib/orb/models/price.rb +9 -1
  17. data/lib/orb/models/price_create_params.rb +9 -1
  18. data/lib/orb/models/price_evaluate_multiple_params.rb +12 -1
  19. data/lib/orb/models/price_evaluate_params.rb +12 -1
  20. data/lib/orb/models/price_evaluate_preview_events_params.rb +12 -1
  21. data/lib/orb/models/price_interval.rb +12 -1
  22. data/lib/orb/models/subscription_create_params.rb +24 -2
  23. data/lib/orb/models/subscription_price_intervals_params.rb +24 -2
  24. data/lib/orb/models/subscription_schedule_plan_change_params.rb +24 -2
  25. data/lib/orb/resources/alerts.rb +11 -3
  26. data/lib/orb/resources/beta/external_plan_id.rb +4 -0
  27. data/lib/orb/resources/beta.rb +8 -0
  28. data/lib/orb/resources/coupons/subscriptions.rb +7 -1
  29. data/lib/orb/resources/coupons.rb +12 -1
  30. data/lib/orb/resources/credit_blocks.rb +2 -0
  31. data/lib/orb/resources/credit_notes.rb +4 -1
  32. data/lib/orb/resources/customers/balance_transactions.rb +20 -1
  33. data/lib/orb/resources/customers/costs.rb +22 -2
  34. data/lib/orb/resources/customers/credits/ledger.rb +18 -6
  35. data/lib/orb/resources/customers/credits/top_ups.rb +6 -2
  36. data/lib/orb/resources/customers/credits.rb +10 -2
  37. data/lib/orb/resources/customers.rb +58 -1
  38. data/lib/orb/resources/dimensional_price_groups.rb +2 -1
  39. data/lib/orb/resources/events/backfills.rb +5 -1
  40. data/lib/orb/resources/events/volume.rb +5 -1
  41. data/lib/orb/resources/events.rb +12 -2
  42. data/lib/orb/resources/invoice_line_items.rb +5 -0
  43. data/lib/orb/resources/invoices.rb +23 -10
  44. data/lib/orb/resources/items.rb +5 -1
  45. data/lib/orb/resources/license_types.rb +5 -1
  46. data/lib/orb/resources/licenses/external_licenses.rb +2 -1
  47. data/lib/orb/resources/licenses/usage.rb +4 -2
  48. data/lib/orb/resources/licenses.rb +4 -2
  49. data/lib/orb/resources/metrics.rb +5 -1
  50. data/lib/orb/resources/plans/external_plan_id.rb +4 -0
  51. data/lib/orb/resources/plans/migrations.rb +6 -1
  52. data/lib/orb/resources/plans.rb +14 -1
  53. data/lib/orb/resources/prices/external_price_id.rb +10 -0
  54. data/lib/orb/resources/prices.rb +25 -2
  55. data/lib/orb/resources/subscription_changes.rb +2 -1
  56. data/lib/orb/resources/subscriptions.rb +8 -4
  57. data/lib/orb/version.rb +1 -1
  58. data/rbi/orb/client.rbi +72 -0
  59. data/rbi/orb/internal/util.rbi +18 -0
  60. data/rbi/orb/models/billable_metric.rbi +11 -3
  61. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +15 -2
  62. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +15 -2
  63. data/rbi/orb/models/invoice_create_params.rbi +12 -0
  64. data/rbi/orb/models/invoice_update_params.rbi +12 -0
  65. data/rbi/orb/models/item.rbi +5 -0
  66. data/rbi/orb/models/item_update_params.rbi +5 -0
  67. data/rbi/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbi +8 -0
  68. data/rbi/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbi +8 -0
  69. data/rbi/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbi +8 -0
  70. data/rbi/orb/models/price.rbi +8 -0
  71. data/rbi/orb/models/price_create_params.rbi +8 -0
  72. data/rbi/orb/models/price_evaluate_multiple_params.rbi +11 -0
  73. data/rbi/orb/models/price_evaluate_params.rbi +10 -0
  74. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +11 -0
  75. data/rbi/orb/models/price_interval.rbi +13 -3
  76. data/rbi/orb/models/subscription_create_params.rbi +22 -0
  77. data/rbi/orb/models/subscription_price_intervals_params.rbi +22 -0
  78. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +22 -0
  79. data/rbi/orb/resources/alerts.rbi +5 -0
  80. data/rbi/orb/resources/beta/external_plan_id.rbi +4 -0
  81. data/rbi/orb/resources/beta.rbi +8 -0
  82. data/rbi/orb/resources/coupons/subscriptions.rbi +5 -0
  83. data/rbi/orb/resources/coupons.rbi +10 -0
  84. data/rbi/orb/resources/credit_blocks.rbi +2 -0
  85. data/rbi/orb/resources/credit_notes.rbi +2 -0
  86. data/rbi/orb/resources/customers/balance_transactions.rbi +18 -0
  87. data/rbi/orb/resources/customers/costs.rbi +18 -0
  88. data/rbi/orb/resources/customers/credits/ledger.rbi +14 -4
  89. data/rbi/orb/resources/customers/credits/top_ups.rbi +2 -0
  90. data/rbi/orb/resources/customers/credits.rbi +6 -0
  91. data/rbi/orb/resources/customers.rbi +56 -0
  92. data/rbi/orb/resources/events/backfills.rbi +3 -0
  93. data/rbi/orb/resources/events/volume.rbi +3 -0
  94. data/rbi/orb/resources/events.rbi +9 -0
  95. data/rbi/orb/resources/invoice_line_items.rbi +5 -0
  96. data/rbi/orb/resources/invoices.rbi +21 -5
  97. data/rbi/orb/resources/items.rbi +3 -0
  98. data/rbi/orb/resources/license_types.rbi +3 -0
  99. data/rbi/orb/resources/metrics.rbi +3 -0
  100. data/rbi/orb/resources/plans/external_plan_id.rbi +4 -0
  101. data/rbi/orb/resources/plans/migrations.rbi +4 -0
  102. data/rbi/orb/resources/plans.rbi +12 -0
  103. data/rbi/orb/resources/prices/external_price_id.rbi +10 -0
  104. data/rbi/orb/resources/prices.rbi +24 -0
  105. data/sig/orb/internal/util.rbs +10 -0
  106. data/sig/orb/models/billable_metric.rbs +8 -3
  107. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +7 -0
  108. data/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +7 -0
  109. data/sig/orb/models/invoice_create_params.rbs +5 -0
  110. data/sig/orb/models/invoice_update_params.rbs +5 -0
  111. data/sig/orb/models/item.rbs +2 -0
  112. data/sig/orb/models/item_update_params.rbs +2 -0
  113. data/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs +5 -0
  114. data/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs +5 -0
  115. data/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs +5 -0
  116. data/sig/orb/models/price.rbs +5 -0
  117. data/sig/orb/models/price_create_params.rbs +5 -0
  118. data/sig/orb/models/price_evaluate_multiple_params.rbs +5 -0
  119. data/sig/orb/models/price_evaluate_params.rbs +6 -1
  120. data/sig/orb/models/price_evaluate_preview_events_params.rbs +5 -0
  121. data/sig/orb/models/price_interval.rbs +8 -3
  122. data/sig/orb/models/subscription_create_params.rbs +10 -0
  123. data/sig/orb/models/subscription_price_intervals_params.rbs +10 -0
  124. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +10 -0
  125. data/sig/orb/resources/invoices.rbs +2 -0
  126. data/sig/orb/resources/prices.rbs +1 -0
  127. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00424b4ad5313d78c7d0bdc5030c16fd1d69407bca56b2e21f08f23ef71d020a
4
- data.tar.gz: 6d6701aa83c11d7bd3b0dd7c0acdb6ebba1c16abc9459611e20aee18e5c02bc8
3
+ metadata.gz: 5c7cdd5d38f2aa6b93c7100f54d7867b638d76be4a8737ea73c1a2c4973b9340
4
+ data.tar.gz: 5e94a570bc66d4ebc9b9be79806626b3dc12ab835ee19c7efe78ac7c2b89224a
5
5
  SHA512:
6
- metadata.gz: 78db60c44706650e85b0f51648f9451473c0a8ce4df080ffff020d47e29031b99e2689de610a8e0e4afe91aac33989836fcb43b6508e4b768aec662e26bb28a6
7
- data.tar.gz: d34e236c1be08805668e64e147e028db88e3b635ac592204e7d800eceab334bef7cf05491c83ec9835ff415eff126d172fc1db5fbb956e3b4b933d3a96853e89
6
+ metadata.gz: 8f9921baba3f8d5438b4aa0bbcf0d54ddd4b52b9495f5318e81970535069a06237e8f6350129784166700bd37ba3b33b7421ab5d3d44e8fd3735d244a9fe8cd0
7
+ data.tar.gz: 715cbc4a16163338a16725d67de9915e144b9877209f6ceb86caead7047f9610c7781a851ef8e8123068536ad7090a05aa8240c4451ebe6e5f487cf63f42a076
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.13.0 (2026-03-03)
4
+
5
+ Full Changelog: [v1.12.0...v1.13.0](https://github.com/orbcorp/orb-ruby/compare/v1.12.0...v1.13.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([c203926](https://github.com/orbcorp/orb-ruby/commit/c203926582b3237293d3078ada79bf3d221071d7))
10
+ * **api:** api update ([fd4f82d](https://github.com/orbcorp/orb-ruby/commit/fd4f82dd2f04f36cd49a7413fdfaa5e1189f22c2))
11
+ * **api:** api update ([a703c63](https://github.com/orbcorp/orb-ruby/commit/a703c638264d4dd7761a3534562f47a86b8da288))
12
+ * **api:** api update ([49c2213](https://github.com/orbcorp/orb-ruby/commit/49c22131d40a8e0e050f894be9ff48d5958301aa))
13
+ * **api:** api update ([357d2d4](https://github.com/orbcorp/orb-ruby/commit/357d2d4e2758c92578d1c7af1e26f1a1779738b0))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **client:** serialize query parameters properly ([003ab4e](https://github.com/orbcorp/orb-ruby/commit/003ab4e466176c051711b7e89e1e40be5de6a664))
19
+ * properly mock time in ruby ci tests ([c8c588e](https://github.com/orbcorp/orb-ruby/commit/c8c588eb8bd5383d1875fef102cd7de66d6dff71))
20
+
21
+
22
+ ### Chores
23
+
24
+ * **ci:** add build step ([b57c8a3](https://github.com/orbcorp/orb-ruby/commit/b57c8a3f52e22c5c67f3842357747437d12f56d7))
25
+ * **docs:** add missing descriptions ([174bbeb](https://github.com/orbcorp/orb-ruby/commit/174bbebe6ed10a5c2c079232299b48b4269e470c))
26
+ * update mock server docs ([4b838cf](https://github.com/orbcorp/orb-ruby/commit/4b838cf2bc89666bea9767ae25e66868d38bbeef))
27
+
3
28
  ## 1.12.0 (2026-02-12)
4
29
 
5
30
  Full Changelog: [v1.11.2...v1.12.0](https://github.com/orbcorp/orb-ruby/compare/v1.11.2...v1.12.0)
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.12.0"
18
+ gem "orb-billing", "~> 1.13.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
data/lib/orb/client.rb CHANGED
@@ -21,42 +21,109 @@ module Orb
21
21
  # @return [Orb::Resources::TopLevel]
22
22
  attr_reader :top_level
23
23
 
24
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
25
+ # subscribed to by a customer. Plans define the billing behavior of the
26
+ # subscription. You can see more about how to configure prices in the
27
+ # [Price resource](/reference/price).
24
28
  # @return [Orb::Resources::Beta]
25
29
  attr_reader :beta
26
30
 
31
+ # A coupon represents a reusable discount configuration that can be applied either
32
+ # as a fixed or percentage amount to an invoice or subscription. Coupons are
33
+ # activated using a redemption code, which applies the discount to a subscription
34
+ # or invoice. The duration of a coupon determines how long it remains available
35
+ # for use by end users.
27
36
  # @return [Orb::Resources::Coupons]
28
37
  attr_reader :coupons
29
38
 
39
+ # The [Credit Note](/invoicing/credit-notes) resource represents a credit that has
40
+ # been applied to a particular invoice.
30
41
  # @return [Orb::Resources::CreditNotes]
31
42
  attr_reader :credit_notes
32
43
 
44
+ # A customer is a buyer of your products, and the other party to the billing
45
+ # relationship.
46
+ #
47
+ # In Orb, customers are assigned system generated identifiers automatically, but
48
+ # it's often desirable to have these match existing identifiers in your system. To
49
+ # avoid having to denormalize Orb ID information, you can pass in an
50
+ # `external_customer_id` with your own identifier. See
51
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
52
+ # information about how these aliases work in Orb.
53
+ #
54
+ # In addition to having an identifier in your system, a customer may exist in a
55
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
56
+ # `payment_provider` enum field to express this mapping.
57
+ #
58
+ # A customer also has a timezone (from the standard
59
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
60
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
61
+ # information on what this timezone parameter influences within Orb.
33
62
  # @return [Orb::Resources::Customers]
34
63
  attr_reader :customers
35
64
 
65
+ # The [Event](/core-concepts#event) resource represents a usage event that has
66
+ # been created for a customer. Events are the core of Orb's usage-based billing
67
+ # model, and are used to calculate the usage charges for a given billing period.
36
68
  # @return [Orb::Resources::Events]
37
69
  attr_reader :events
38
70
 
71
+ # An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity,
72
+ # representing the request for payment for a single subscription. This includes a
73
+ # set of line items, which correspond to prices in the subscription's plan and can
74
+ # represent fixed recurring fees or usage-based fees. They are generated at the
75
+ # end of a billing period, or as the result of an action, such as a cancellation.
39
76
  # @return [Orb::Resources::InvoiceLineItems]
40
77
  attr_reader :invoice_line_items
41
78
 
79
+ # An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity,
80
+ # representing the request for payment for a single subscription. This includes a
81
+ # set of line items, which correspond to prices in the subscription's plan and can
82
+ # represent fixed recurring fees or usage-based fees. They are generated at the
83
+ # end of a billing period, or as the result of an action, such as a cancellation.
42
84
  # @return [Orb::Resources::Invoices]
43
85
  attr_reader :invoices
44
86
 
87
+ # The Item resource represents a sellable product or good. Items are associated
88
+ # with all line items, billable metrics, and prices and are used for defining
89
+ # external sync behavior for invoices and tax calculation purposes.
45
90
  # @return [Orb::Resources::Items]
46
91
  attr_reader :items
47
92
 
93
+ # The Metric resource represents a calculation of a quantity based on events.
94
+ # Metrics are defined by the query that transforms raw usage events into
95
+ # meaningful values for your customers.
48
96
  # @return [Orb::Resources::Metrics]
49
97
  attr_reader :metrics
50
98
 
99
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
100
+ # subscribed to by a customer. Plans define the billing behavior of the
101
+ # subscription. You can see more about how to configure prices in the
102
+ # [Price resource](/reference/price).
51
103
  # @return [Orb::Resources::Plans]
52
104
  attr_reader :plans
53
105
 
106
+ # The Price resource represents a price that can be billed on a subscription,
107
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
108
+ # take a quantity and determine an amount to bill.
109
+ #
110
+ # Orb supports a few different pricing models out of the box. Each of these models
111
+ # is serialized differently in a given Price object. The model_type field
112
+ # determines the key for the configuration object that is present.
113
+ #
114
+ # For more on the types of prices, see
115
+ # [the core concepts documentation](/core-concepts#plan-and-price)
54
116
  # @return [Orb::Resources::Prices]
55
117
  attr_reader :prices
56
118
 
57
119
  # @return [Orb::Resources::Subscriptions]
58
120
  attr_reader :subscriptions
59
121
 
122
+ # [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
123
+ # usage, or credit balance and trigger webhooks when a threshold is exceeded.
124
+ #
125
+ # Alerts created through the API can be scoped to either customers or
126
+ # subscriptions.
60
127
  # @return [Orb::Resources::Alerts]
61
128
  attr_reader :alerts
62
129
 
@@ -66,9 +133,14 @@ module Orb
66
133
  # @return [Orb::Resources::SubscriptionChanges]
67
134
  attr_reader :subscription_changes
68
135
 
136
+ # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
137
+ # credits within Orb.
69
138
  # @return [Orb::Resources::CreditBlocks]
70
139
  attr_reader :credit_blocks
71
140
 
141
+ # The LicenseType resource represents a type of license that can be assigned to
142
+ # users. License types are used during billing by grouping metrics on the
143
+ # configured grouping key.
72
144
  # @return [Orb::Resources::LicenseTypes]
73
145
  attr_reader :license_types
74
146
 
@@ -490,6 +490,37 @@ module Orb
490
490
  JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491
491
 
492
492
  class << self
493
+ # @api private
494
+ #
495
+ # @param query [Hash{Symbol=>Object}]
496
+ #
497
+ # @return [Hash{Symbol=>Object}]
498
+ def encode_query_params(query)
499
+ out = {}
500
+ query.each { write_query_param_element!(out, _1, _2) }
501
+ out
502
+ end
503
+
504
+ # @api private
505
+ #
506
+ # @param collection [Hash{Symbol=>Object}]
507
+ # @param key [String]
508
+ # @param element [Object]
509
+ #
510
+ # @return [nil]
511
+ private def write_query_param_element!(collection, key, element)
512
+ case element
513
+ in Hash
514
+ element.each do |name, value|
515
+ write_query_param_element!(collection, "#{key}[#{name}]", value)
516
+ end
517
+ in Array
518
+ collection["#{key}[]"] = element.map(&:to_s)
519
+ else
520
+ collection[key] = element.to_s
521
+ end
522
+ end
523
+
493
524
  # @api private
494
525
  #
495
526
  # @param y [Enumerator::Yielder]
@@ -41,7 +41,14 @@ module Orb
41
41
  # @return [Symbol, Orb::Models::BillableMetric::Status]
42
42
  required :status, enum: -> { Orb::BillableMetric::Status }
43
43
 
44
- # @!method initialize(id:, description:, item:, metadata:, name:, status:)
44
+ # @!attribute parameter_definitions
45
+ #
46
+ # @return [Array<Hash{Symbol=>Object}>, nil]
47
+ optional :parameter_definitions,
48
+ Orb::Internal::Type::ArrayOf[Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]],
49
+ nil?: true
50
+
51
+ # @!method initialize(id:, description:, item:, metadata:, name:, status:, parameter_definitions: nil)
45
52
  # Some parameter documentations has been truncated, see
46
53
  # {Orb::Models::BillableMetric} for more details.
47
54
  #
@@ -60,6 +67,8 @@ module Orb
60
67
  # @param name [String]
61
68
  #
62
69
  # @param status [Symbol, Orb::Models::BillableMetric::Status]
70
+ #
71
+ # @param parameter_definitions [Array<Hash{Symbol=>Object}>, nil]
63
72
 
64
73
  # @see Orb::Models::BillableMetric#status
65
74
  module Status
@@ -243,6 +243,12 @@ module Orb
243
243
  # @return [String, nil]
244
244
  optional :item_id, String, nil?: true
245
245
 
246
+ # @!attribute mark_as_paid
247
+ # If true, the new credits purchase invoice will be marked as paid.
248
+ #
249
+ # @return [Boolean, nil]
250
+ optional :mark_as_paid, Orb::Internal::Type::Boolean
251
+
246
252
  # @!attribute memo
247
253
  # An optional memo to display on the invoice.
248
254
  #
@@ -254,7 +260,8 @@ module Orb
254
260
  # based on the invoice or issuance date, depending on the account's configured due
255
261
  # date calculation method. A value of '0' here represents that the invoice is due
256
262
  # on issue, whereas a value of '30' represents that the customer has 30 days to
257
- # pay the invoice. Do not set this field if you want to set a custom due date.
263
+ # pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
264
+ # both.
258
265
  #
259
266
  # @return [Integer, nil]
260
267
  optional :net_terms, Integer, nil?: true
@@ -266,7 +273,7 @@ module Orb
266
273
  # @return [Boolean, nil]
267
274
  optional :require_successful_payment, Orb::Internal::Type::Boolean
268
275
 
269
- # @!method initialize(auto_collection:, custom_due_date: nil, invoice_date: nil, item_id: nil, memo: nil, net_terms: nil, require_successful_payment: nil)
276
+ # @!method initialize(auto_collection:, custom_due_date: nil, invoice_date: nil, item_id: nil, mark_as_paid: nil, memo: nil, net_terms: nil, require_successful_payment: nil)
270
277
  # Some parameter documentations has been truncated, see
271
278
  # {Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings}
272
279
  # for more details.
@@ -284,6 +291,8 @@ module Orb
284
291
  #
285
292
  # @param item_id [String, nil] The ID of the Item to be used for the invoice line item. If not provided, a defa
286
293
  #
294
+ # @param mark_as_paid [Boolean] If true, the new credits purchase invoice will be marked as paid.
295
+ #
287
296
  # @param memo [String, nil] An optional memo to display on the invoice.
288
297
  #
289
298
  # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas
@@ -241,6 +241,12 @@ module Orb
241
241
  # @return [String, nil]
242
242
  optional :item_id, String, nil?: true
243
243
 
244
+ # @!attribute mark_as_paid
245
+ # If true, the new credits purchase invoice will be marked as paid.
246
+ #
247
+ # @return [Boolean, nil]
248
+ optional :mark_as_paid, Orb::Internal::Type::Boolean
249
+
244
250
  # @!attribute memo
245
251
  # An optional memo to display on the invoice.
246
252
  #
@@ -252,7 +258,8 @@ module Orb
252
258
  # based on the invoice or issuance date, depending on the account's configured due
253
259
  # date calculation method. A value of '0' here represents that the invoice is due
254
260
  # on issue, whereas a value of '30' represents that the customer has 30 days to
255
- # pay the invoice. Do not set this field if you want to set a custom due date.
261
+ # pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
262
+ # both.
256
263
  #
257
264
  # @return [Integer, nil]
258
265
  optional :net_terms, Integer, nil?: true
@@ -264,7 +271,7 @@ module Orb
264
271
  # @return [Boolean, nil]
265
272
  optional :require_successful_payment, Orb::Internal::Type::Boolean
266
273
 
267
- # @!method initialize(auto_collection:, custom_due_date: nil, invoice_date: nil, item_id: nil, memo: nil, net_terms: nil, require_successful_payment: nil)
274
+ # @!method initialize(auto_collection:, custom_due_date: nil, invoice_date: nil, item_id: nil, mark_as_paid: nil, memo: nil, net_terms: nil, require_successful_payment: nil)
268
275
  # Some parameter documentations has been truncated, see
269
276
  # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings} for
270
277
  # more details.
@@ -282,6 +289,8 @@ module Orb
282
289
  #
283
290
  # @param item_id [String, nil] The ID of the Item to be used for the invoice line item. If not provided, a defa
284
291
  #
292
+ # @param mark_as_paid [Boolean] If true, the new credits purchase invoice will be marked as paid.
293
+ #
285
294
  # @param memo [String, nil] An optional memo to display on the invoice.
286
295
  #
287
296
  # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas
@@ -26,6 +26,14 @@ module Orb
26
26
  # @return [Array<Orb::Models::InvoiceCreateParams::LineItem>]
27
27
  required :line_items, -> { Orb::Internal::Type::ArrayOf[Orb::InvoiceCreateParams::LineItem] }
28
28
 
29
+ # @!attribute auto_collection
30
+ # Determines whether this invoice will automatically attempt to charge a saved
31
+ # payment method, if any. If not specified, the invoice inherits the customer's
32
+ # auto_collection setting.
33
+ #
34
+ # @return [Boolean, nil]
35
+ optional :auto_collection, Orb::Internal::Type::Boolean, nil?: true
36
+
29
37
  # @!attribute customer_id
30
38
  # The id of the `Customer` to create this invoice for. One of `customer_id` and
31
39
  # `external_customer_id` are required.
@@ -86,7 +94,7 @@ module Orb
86
94
  # @return [Boolean, nil]
87
95
  optional :will_auto_issue, Orb::Internal::Type::Boolean
88
96
 
89
- # @!method initialize(currency:, invoice_date:, line_items:, customer_id: nil, discount: nil, due_date: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {})
97
+ # @!method initialize(currency:, invoice_date:, line_items:, auto_collection: nil, customer_id: nil, discount: nil, due_date: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {})
90
98
  # Some parameter documentations has been truncated, see
91
99
  # {Orb::Models::InvoiceCreateParams} for more details.
92
100
  #
@@ -96,6 +104,8 @@ module Orb
96
104
  #
97
105
  # @param line_items [Array<Orb::Models::InvoiceCreateParams::LineItem>]
98
106
  #
107
+ # @param auto_collection [Boolean, nil] Determines whether this invoice will automatically attempt to charge a saved pay
108
+ #
99
109
  # @param customer_id [String, nil] The id of the `Customer` to create this invoice for. One of `customer_id` and `e
100
110
  #
101
111
  # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] An optional discount to attach to the invoice.
@@ -7,6 +7,14 @@ module Orb
7
7
  extend Orb::Internal::Type::RequestParameters::Converter
8
8
  include Orb::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute auto_collection
11
+ # Determines whether this invoice will automatically attempt to charge a saved
12
+ # payment method, if any. Can only be modified on draft invoices. If not
13
+ # specified, the invoice's existing setting is unchanged.
14
+ #
15
+ # @return [Boolean, nil]
16
+ optional :auto_collection, Orb::Internal::Type::Boolean, nil?: true
17
+
10
18
  # @!attribute due_date
11
19
  # An optional custom due date for the invoice. If not set, the due date will be
12
20
  # calculated based on the `net_terms` value.
@@ -38,10 +46,12 @@ module Orb
38
46
  # @return [Integer, nil]
39
47
  optional :net_terms, Integer, nil?: true
40
48
 
41
- # @!method initialize(due_date: nil, invoice_date: nil, metadata: nil, net_terms: nil, request_options: {})
49
+ # @!method initialize(auto_collection: nil, due_date: nil, invoice_date: nil, metadata: nil, net_terms: nil, request_options: {})
42
50
  # Some parameter documentations has been truncated, see
43
51
  # {Orb::Models::InvoiceUpdateParams} for more details.
44
52
  #
53
+ # @param auto_collection [Boolean, nil] Determines whether this invoice will automatically attempt to charge a saved pay
54
+ #
45
55
  # @param due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca
46
56
  #
47
57
  # @param invoice_date [Date, Time, nil] The date of the invoice. Can only be modified for one-off draft invoices.
@@ -99,6 +99,7 @@ module Orb
99
99
  AVALARA = :avalara
100
100
  ANROK = :anrok
101
101
  NUMERAL = :numeral
102
+ STRIPE_TAX = :stripe_tax
102
103
 
103
104
  # @!method self.values
104
105
  # @return [Array<Symbol>]
@@ -75,6 +75,7 @@ module Orb
75
75
  AVALARA = :avalara
76
76
  ANROK = :anrok
77
77
  NUMERAL = :numeral
78
+ STRIPE_TAX = :stripe_tax
78
79
 
79
80
  # @!method self.values
80
81
  # @return [Array<Symbol>]
@@ -215,6 +215,12 @@ module Orb
215
215
  # @return [String]
216
216
  required :unit_price, String
217
217
 
218
+ # @!attribute grouping_key
219
+ # The property used to group this price
220
+ #
221
+ # @return [String, nil]
222
+ optional :grouping_key, String, nil?: true
223
+
218
224
  # @!attribute prorate
219
225
  # If true, the unit price will be prorated to the billing period
220
226
  #
@@ -227,7 +233,7 @@ module Orb
227
233
  # @return [String, nil]
228
234
  optional :second_dimension, String, nil?: true
229
235
 
230
- # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil)
236
+ # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, grouping_key: nil, prorate: nil, second_dimension: nil)
231
237
  # Configuration for scalable_matrix_with_unit_pricing pricing
232
238
  #
233
239
  # @param first_dimension [String] Used to determine the unit rate
@@ -236,6 +242,8 @@ module Orb
236
242
  #
237
243
  # @param unit_price [String] The final unit price to rate against the output of the matrix
238
244
  #
245
+ # @param grouping_key [String, nil] The property used to group this price
246
+ #
239
247
  # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period
240
248
  #
241
249
  # @param second_dimension [String, nil] Used to determine the unit rate (optional)
@@ -221,6 +221,12 @@ module Orb
221
221
  # @return [String]
222
222
  required :unit_price, String
223
223
 
224
+ # @!attribute grouping_key
225
+ # The property used to group this price
226
+ #
227
+ # @return [String, nil]
228
+ optional :grouping_key, String, nil?: true
229
+
224
230
  # @!attribute prorate
225
231
  # If true, the unit price will be prorated to the billing period
226
232
  #
@@ -233,7 +239,7 @@ module Orb
233
239
  # @return [String, nil]
234
240
  optional :second_dimension, String, nil?: true
235
241
 
236
- # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil)
242
+ # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, grouping_key: nil, prorate: nil, second_dimension: nil)
237
243
  # Configuration for scalable_matrix_with_unit_pricing pricing
238
244
  #
239
245
  # @param first_dimension [String] Used to determine the unit rate
@@ -242,6 +248,8 @@ module Orb
242
248
  #
243
249
  # @param unit_price [String] The final unit price to rate against the output of the matrix
244
250
  #
251
+ # @param grouping_key [String, nil] The property used to group this price
252
+ #
245
253
  # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period
246
254
  #
247
255
  # @param second_dimension [String, nil] Used to determine the unit rate (optional)
@@ -226,6 +226,12 @@ module Orb
226
226
  # @return [String]
227
227
  required :unit_price, String
228
228
 
229
+ # @!attribute grouping_key
230
+ # The property used to group this price
231
+ #
232
+ # @return [String, nil]
233
+ optional :grouping_key, String, nil?: true
234
+
229
235
  # @!attribute prorate
230
236
  # If true, the unit price will be prorated to the billing period
231
237
  #
@@ -238,7 +244,7 @@ module Orb
238
244
  # @return [String, nil]
239
245
  optional :second_dimension, String, nil?: true
240
246
 
241
- # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil)
247
+ # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, grouping_key: nil, prorate: nil, second_dimension: nil)
242
248
  # Configuration for scalable_matrix_with_unit_pricing pricing
243
249
  #
244
250
  # @param first_dimension [String] Used to determine the unit rate
@@ -247,6 +253,8 @@ module Orb
247
253
  #
248
254
  # @param unit_price [String] The final unit price to rate against the output of the matrix
249
255
  #
256
+ # @param grouping_key [String, nil] The property used to group this price
257
+ #
250
258
  # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period
251
259
  #
252
260
  # @param second_dimension [String, nil] Used to determine the unit rate (optional)
@@ -9916,6 +9916,12 @@ module Orb
9916
9916
  # @return [String]
9917
9917
  required :unit_price, String
9918
9918
 
9919
+ # @!attribute grouping_key
9920
+ # The property used to group this price
9921
+ #
9922
+ # @return [String, nil]
9923
+ optional :grouping_key, String, nil?: true
9924
+
9919
9925
  # @!attribute prorate
9920
9926
  # If true, the unit price will be prorated to the billing period
9921
9927
  #
@@ -9928,7 +9934,7 @@ module Orb
9928
9934
  # @return [String, nil]
9929
9935
  optional :second_dimension, String, nil?: true
9930
9936
 
9931
- # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil)
9937
+ # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, grouping_key: nil, prorate: nil, second_dimension: nil)
9932
9938
  # Configuration for scalable_matrix_with_unit_pricing pricing
9933
9939
  #
9934
9940
  # @param first_dimension [String] Used to determine the unit rate
@@ -9937,6 +9943,8 @@ module Orb
9937
9943
  #
9938
9944
  # @param unit_price [String] The final unit price to rate against the output of the matrix
9939
9945
  #
9946
+ # @param grouping_key [String, nil] The property used to group this price
9947
+ #
9940
9948
  # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period
9941
9949
  #
9942
9950
  # @param second_dimension [String, nil] Used to determine the unit rate (optional)
@@ -1250,6 +1250,12 @@ module Orb
1250
1250
  # @return [String]
1251
1251
  required :unit_price, String
1252
1252
 
1253
+ # @!attribute grouping_key
1254
+ # The property used to group this price
1255
+ #
1256
+ # @return [String, nil]
1257
+ optional :grouping_key, String, nil?: true
1258
+
1253
1259
  # @!attribute prorate
1254
1260
  # If true, the unit price will be prorated to the billing period
1255
1261
  #
@@ -1262,7 +1268,7 @@ module Orb
1262
1268
  # @return [String, nil]
1263
1269
  optional :second_dimension, String, nil?: true
1264
1270
 
1265
- # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil)
1271
+ # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, grouping_key: nil, prorate: nil, second_dimension: nil)
1266
1272
  # Configuration for scalable_matrix_with_unit_pricing pricing
1267
1273
  #
1268
1274
  # @param first_dimension [String] Used to determine the unit rate
@@ -1271,6 +1277,8 @@ module Orb
1271
1277
  #
1272
1278
  # @param unit_price [String] The final unit price to rate against the output of the matrix
1273
1279
  #
1280
+ # @param grouping_key [String, nil] The property used to group this price
1281
+ #
1274
1282
  # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period
1275
1283
  #
1276
1284
  # @param second_dimension [String, nil] Used to determine the unit rate (optional)
@@ -74,6 +74,15 @@ module Orb
74
74
  # @return [Array<String>, nil]
75
75
  optional :grouping_keys, Orb::Internal::Type::ArrayOf[String]
76
76
 
77
+ # @!attribute metric_parameter_overrides
78
+ # Optional overrides for parameterized billable metric parameters. If the metric
79
+ # has parameter definitions and no overrides are provided, defaults will be used.
80
+ #
81
+ # @return [Hash{Symbol=>Object}, nil]
82
+ optional :metric_parameter_overrides,
83
+ Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
84
+ nil?: true
85
+
77
86
  # @!attribute price
78
87
  # New floating price request body params.
79
88
  #
@@ -86,7 +95,7 @@ module Orb
86
95
  # @return [String, nil]
87
96
  optional :price_id, String, nil?: true
88
97
 
89
- # @!method initialize(external_price_id: nil, filter: nil, grouping_keys: nil, price: nil, price_id: nil)
98
+ # @!method initialize(external_price_id: nil, filter: nil, grouping_keys: nil, metric_parameter_overrides: nil, price: nil, price_id: nil)
90
99
  # Some parameter documentations has been truncated, see
91
100
  # {Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation} for more details.
92
101
  #
@@ -96,6 +105,8 @@ module Orb
96
105
  #
97
106
  # @param grouping_keys [Array<String>] Properties (or [computed properties](/extensibility/advanced-metrics#computed-pr
98
107
  #
108
+ # @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Optional overrides for parameterized billable metric parameters. If the metric h
109
+ #
99
110
  # @param price [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::BulkWithFilters, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::CumulativeGroupedAllocation, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput, nil] New floating price request body params.
100
111
  #
101
112
  # @param price_id [String, nil] The ID of a price to evaluate that exists in your Orb account.
@@ -47,7 +47,16 @@ module Orb
47
47
  # @return [Array<String>, nil]
48
48
  optional :grouping_keys, Orb::Internal::Type::ArrayOf[String]
49
49
 
50
- # @!method initialize(timeframe_end:, timeframe_start:, customer_id: nil, external_customer_id: nil, filter: nil, grouping_keys: nil, request_options: {})
50
+ # @!attribute metric_parameter_overrides
51
+ # Optional overrides for parameterized billable metric parameters. If the metric
52
+ # has parameter definitions and no overrides are provided, defaults will be used.
53
+ #
54
+ # @return [Hash{Symbol=>Object}, nil]
55
+ optional :metric_parameter_overrides,
56
+ Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
57
+ nil?: true
58
+
59
+ # @!method initialize(timeframe_end:, timeframe_start:, customer_id: nil, external_customer_id: nil, filter: nil, grouping_keys: nil, metric_parameter_overrides: nil, request_options: {})
51
60
  # Some parameter documentations has been truncated, see
52
61
  # {Orb::Models::PriceEvaluateParams} for more details.
53
62
  #
@@ -63,6 +72,8 @@ module Orb
63
72
  #
64
73
  # @param grouping_keys [Array<String>] Properties (or [computed properties](/extensibility/advanced-metrics#computed-pr
65
74
  #
75
+ # @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Optional overrides for parameterized billable metric parameters. If the metric h
76
+ #
66
77
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
67
78
  end
68
79
  end