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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/README.md +1 -1
- data/lib/orb/client.rb +72 -0
- data/lib/orb/internal/util.rb +31 -0
- data/lib/orb/models/billable_metric.rb +10 -1
- data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +11 -2
- data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +11 -2
- data/lib/orb/models/invoice_create_params.rb +11 -1
- data/lib/orb/models/invoice_update_params.rb +11 -1
- data/lib/orb/models/item.rb +1 -0
- data/lib/orb/models/item_update_params.rb +1 -0
- data/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +9 -1
- data/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +9 -1
- data/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +9 -1
- data/lib/orb/models/price.rb +9 -1
- data/lib/orb/models/price_create_params.rb +9 -1
- data/lib/orb/models/price_evaluate_multiple_params.rb +12 -1
- data/lib/orb/models/price_evaluate_params.rb +12 -1
- data/lib/orb/models/price_evaluate_preview_events_params.rb +12 -1
- data/lib/orb/models/price_interval.rb +12 -1
- data/lib/orb/models/subscription_create_params.rb +24 -2
- data/lib/orb/models/subscription_price_intervals_params.rb +24 -2
- data/lib/orb/models/subscription_schedule_plan_change_params.rb +24 -2
- data/lib/orb/resources/alerts.rb +11 -3
- data/lib/orb/resources/beta/external_plan_id.rb +4 -0
- data/lib/orb/resources/beta.rb +8 -0
- data/lib/orb/resources/coupons/subscriptions.rb +7 -1
- data/lib/orb/resources/coupons.rb +12 -1
- data/lib/orb/resources/credit_blocks.rb +2 -0
- data/lib/orb/resources/credit_notes.rb +4 -1
- data/lib/orb/resources/customers/balance_transactions.rb +20 -1
- data/lib/orb/resources/customers/costs.rb +22 -2
- data/lib/orb/resources/customers/credits/ledger.rb +18 -6
- data/lib/orb/resources/customers/credits/top_ups.rb +6 -2
- data/lib/orb/resources/customers/credits.rb +10 -2
- data/lib/orb/resources/customers.rb +58 -1
- data/lib/orb/resources/dimensional_price_groups.rb +2 -1
- data/lib/orb/resources/events/backfills.rb +5 -1
- data/lib/orb/resources/events/volume.rb +5 -1
- data/lib/orb/resources/events.rb +12 -2
- data/lib/orb/resources/invoice_line_items.rb +5 -0
- data/lib/orb/resources/invoices.rb +23 -10
- data/lib/orb/resources/items.rb +5 -1
- data/lib/orb/resources/license_types.rb +5 -1
- data/lib/orb/resources/licenses/external_licenses.rb +2 -1
- data/lib/orb/resources/licenses/usage.rb +4 -2
- data/lib/orb/resources/licenses.rb +4 -2
- data/lib/orb/resources/metrics.rb +5 -1
- data/lib/orb/resources/plans/external_plan_id.rb +4 -0
- data/lib/orb/resources/plans/migrations.rb +6 -1
- data/lib/orb/resources/plans.rb +14 -1
- data/lib/orb/resources/prices/external_price_id.rb +10 -0
- data/lib/orb/resources/prices.rb +25 -2
- data/lib/orb/resources/subscription_changes.rb +2 -1
- data/lib/orb/resources/subscriptions.rb +8 -4
- data/lib/orb/version.rb +1 -1
- data/rbi/orb/client.rbi +72 -0
- data/rbi/orb/internal/util.rbi +18 -0
- data/rbi/orb/models/billable_metric.rbi +11 -3
- data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +15 -2
- data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +15 -2
- data/rbi/orb/models/invoice_create_params.rbi +12 -0
- data/rbi/orb/models/invoice_update_params.rbi +12 -0
- data/rbi/orb/models/item.rbi +5 -0
- data/rbi/orb/models/item_update_params.rbi +5 -0
- data/rbi/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbi +8 -0
- data/rbi/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbi +8 -0
- data/rbi/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbi +8 -0
- data/rbi/orb/models/price.rbi +8 -0
- data/rbi/orb/models/price_create_params.rbi +8 -0
- data/rbi/orb/models/price_evaluate_multiple_params.rbi +11 -0
- data/rbi/orb/models/price_evaluate_params.rbi +10 -0
- data/rbi/orb/models/price_evaluate_preview_events_params.rbi +11 -0
- data/rbi/orb/models/price_interval.rbi +13 -3
- data/rbi/orb/models/subscription_create_params.rbi +22 -0
- data/rbi/orb/models/subscription_price_intervals_params.rbi +22 -0
- data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +22 -0
- data/rbi/orb/resources/alerts.rbi +5 -0
- data/rbi/orb/resources/beta/external_plan_id.rbi +4 -0
- data/rbi/orb/resources/beta.rbi +8 -0
- data/rbi/orb/resources/coupons/subscriptions.rbi +5 -0
- data/rbi/orb/resources/coupons.rbi +10 -0
- data/rbi/orb/resources/credit_blocks.rbi +2 -0
- data/rbi/orb/resources/credit_notes.rbi +2 -0
- data/rbi/orb/resources/customers/balance_transactions.rbi +18 -0
- data/rbi/orb/resources/customers/costs.rbi +18 -0
- data/rbi/orb/resources/customers/credits/ledger.rbi +14 -4
- data/rbi/orb/resources/customers/credits/top_ups.rbi +2 -0
- data/rbi/orb/resources/customers/credits.rbi +6 -0
- data/rbi/orb/resources/customers.rbi +56 -0
- data/rbi/orb/resources/events/backfills.rbi +3 -0
- data/rbi/orb/resources/events/volume.rbi +3 -0
- data/rbi/orb/resources/events.rbi +9 -0
- data/rbi/orb/resources/invoice_line_items.rbi +5 -0
- data/rbi/orb/resources/invoices.rbi +21 -5
- data/rbi/orb/resources/items.rbi +3 -0
- data/rbi/orb/resources/license_types.rbi +3 -0
- data/rbi/orb/resources/metrics.rbi +3 -0
- data/rbi/orb/resources/plans/external_plan_id.rbi +4 -0
- data/rbi/orb/resources/plans/migrations.rbi +4 -0
- data/rbi/orb/resources/plans.rbi +12 -0
- data/rbi/orb/resources/prices/external_price_id.rbi +10 -0
- data/rbi/orb/resources/prices.rbi +24 -0
- data/sig/orb/internal/util.rbs +10 -0
- data/sig/orb/models/billable_metric.rbs +8 -3
- data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +7 -0
- data/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +7 -0
- data/sig/orb/models/invoice_create_params.rbs +5 -0
- data/sig/orb/models/invoice_update_params.rbs +5 -0
- data/sig/orb/models/item.rbs +2 -0
- data/sig/orb/models/item_update_params.rbs +2 -0
- data/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs +5 -0
- data/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs +5 -0
- data/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs +5 -0
- data/sig/orb/models/price.rbs +5 -0
- data/sig/orb/models/price_create_params.rbs +5 -0
- data/sig/orb/models/price_evaluate_multiple_params.rbs +5 -0
- data/sig/orb/models/price_evaluate_params.rbs +6 -1
- data/sig/orb/models/price_evaluate_preview_events_params.rbs +5 -0
- data/sig/orb/models/price_interval.rbs +8 -3
- data/sig/orb/models/subscription_create_params.rbs +10 -0
- data/sig/orb/models/subscription_price_intervals_params.rbs +10 -0
- data/sig/orb/models/subscription_schedule_plan_change_params.rbs +10 -0
- data/sig/orb/resources/invoices.rbs +2 -0
- data/sig/orb/resources/prices.rbs +1 -0
- metadata +2 -2
|
@@ -132,6 +132,15 @@ module Orb
|
|
|
132
132
|
# @return [Array<String>, nil]
|
|
133
133
|
optional :grouping_keys, Orb::Internal::Type::ArrayOf[String]
|
|
134
134
|
|
|
135
|
+
# @!attribute metric_parameter_overrides
|
|
136
|
+
# Optional overrides for parameterized billable metric parameters. If the metric
|
|
137
|
+
# has parameter definitions and no overrides are provided, defaults will be used.
|
|
138
|
+
#
|
|
139
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
140
|
+
optional :metric_parameter_overrides,
|
|
141
|
+
Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
|
|
142
|
+
nil?: true
|
|
143
|
+
|
|
135
144
|
# @!attribute price
|
|
136
145
|
# New floating price request body params.
|
|
137
146
|
#
|
|
@@ -148,7 +157,7 @@ module Orb
|
|
|
148
157
|
# @return [String, nil]
|
|
149
158
|
optional :price_id, String, nil?: true
|
|
150
159
|
|
|
151
|
-
# @!method initialize(external_price_id: nil, filter: nil, grouping_keys: nil, price: nil, price_id: nil)
|
|
160
|
+
# @!method initialize(external_price_id: nil, filter: nil, grouping_keys: nil, metric_parameter_overrides: nil, price: nil, price_id: nil)
|
|
152
161
|
# Some parameter documentations has been truncated, see
|
|
153
162
|
# {Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation} for more
|
|
154
163
|
# details.
|
|
@@ -159,6 +168,8 @@ module Orb
|
|
|
159
168
|
#
|
|
160
169
|
# @param grouping_keys [Array<String>] Properties (or [computed properties](/extensibility/advanced-metrics#computed-pr
|
|
161
170
|
#
|
|
171
|
+
# @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Optional overrides for parameterized billable metric parameters. If the metric h
|
|
172
|
+
#
|
|
162
173
|
# @param price [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::PriceEvaluatePreviewEventsParams::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::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::CumulativeGroupedAllocation, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput, nil] New floating price request body params.
|
|
163
174
|
#
|
|
164
175
|
# @param price_id [String, nil] The ID of a price to evaluate that exists in your Orb account.
|
|
@@ -89,7 +89,16 @@ module Orb
|
|
|
89
89
|
# @return [Array<String>, nil]
|
|
90
90
|
required :usage_customer_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
|
|
91
91
|
|
|
92
|
-
# @!
|
|
92
|
+
# @!attribute metric_parameter_overrides
|
|
93
|
+
# Override values for parameterized billable metric variables. Keys are parameter
|
|
94
|
+
# names, values are the override values.
|
|
95
|
+
#
|
|
96
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
97
|
+
optional :metric_parameter_overrides,
|
|
98
|
+
Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
|
|
99
|
+
nil?: true
|
|
100
|
+
|
|
101
|
+
# @!method initialize(id:, billing_cycle_day:, can_defer_billing:, current_billing_period_end_date:, current_billing_period_start_date:, end_date:, filter:, fixed_fee_quantity_transitions:, price:, start_date:, usage_customer_ids:, metric_parameter_overrides: nil)
|
|
93
102
|
# Some parameter documentations has been truncated, see
|
|
94
103
|
# {Orb::Models::PriceInterval} for more details.
|
|
95
104
|
#
|
|
@@ -118,6 +127,8 @@ module Orb
|
|
|
118
127
|
# @param start_date [Time] The start date of the price interval. This is the date that Orb starts billing f
|
|
119
128
|
#
|
|
120
129
|
# @param usage_customer_ids [Array<String>, nil] A list of customer IDs whose usage events will be aggregated and billed under th
|
|
130
|
+
#
|
|
131
|
+
# @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Override values for parameterized billable metric variables. Keys are parameter
|
|
121
132
|
end
|
|
122
133
|
end
|
|
123
134
|
end
|
|
@@ -422,6 +422,15 @@ module Orb
|
|
|
422
422
|
# @return [String, nil]
|
|
423
423
|
optional :maximum_amount, String, nil?: true
|
|
424
424
|
|
|
425
|
+
# @!attribute metric_parameter_overrides
|
|
426
|
+
# Override values for parameterized billable metric variables. Keys are parameter
|
|
427
|
+
# names, values are the override values.
|
|
428
|
+
#
|
|
429
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
430
|
+
optional :metric_parameter_overrides,
|
|
431
|
+
Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
|
|
432
|
+
nil?: true
|
|
433
|
+
|
|
425
434
|
# @!attribute minimum_amount
|
|
426
435
|
# @deprecated
|
|
427
436
|
#
|
|
@@ -457,7 +466,7 @@ module Orb
|
|
|
457
466
|
# @return [Time, nil]
|
|
458
467
|
optional :start_date, Time, nil?: true
|
|
459
468
|
|
|
460
|
-
# @!method initialize(allocation_price: nil, discounts: nil, end_date: nil, external_price_id: nil, maximum_amount: nil, minimum_amount: nil, plan_phase_order: nil, price: nil, price_id: nil, start_date: nil)
|
|
469
|
+
# @!method initialize(allocation_price: nil, discounts: nil, end_date: nil, external_price_id: nil, maximum_amount: nil, metric_parameter_overrides: nil, minimum_amount: nil, plan_phase_order: nil, price: nil, price_id: nil, start_date: nil)
|
|
461
470
|
# Some parameter documentations has been truncated, see
|
|
462
471
|
# {Orb::Models::SubscriptionCreateParams::AddPrice} for more details.
|
|
463
472
|
#
|
|
@@ -471,6 +480,8 @@ module Orb
|
|
|
471
480
|
#
|
|
472
481
|
# @param maximum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for
|
|
473
482
|
#
|
|
483
|
+
# @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Override values for parameterized billable metric variables. Keys are parameter
|
|
484
|
+
#
|
|
474
485
|
# @param minimum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
|
|
475
486
|
#
|
|
476
487
|
# @param plan_phase_order [Integer, nil] The phase to add this price to.
|
|
@@ -2085,6 +2096,15 @@ module Orb
|
|
|
2085
2096
|
# @return [String, nil]
|
|
2086
2097
|
optional :maximum_amount, String, nil?: true
|
|
2087
2098
|
|
|
2099
|
+
# @!attribute metric_parameter_overrides
|
|
2100
|
+
# Override values for parameterized billable metric variables. Keys are parameter
|
|
2101
|
+
# names, values are the override values.
|
|
2102
|
+
#
|
|
2103
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
2104
|
+
optional :metric_parameter_overrides,
|
|
2105
|
+
Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
|
|
2106
|
+
nil?: true
|
|
2107
|
+
|
|
2088
2108
|
# @!attribute minimum_amount
|
|
2089
2109
|
# @deprecated
|
|
2090
2110
|
#
|
|
@@ -2106,7 +2126,7 @@ module Orb
|
|
|
2106
2126
|
# @return [String, nil]
|
|
2107
2127
|
optional :price_id, String, nil?: true
|
|
2108
2128
|
|
|
2109
|
-
# @!method initialize(replaces_price_id:, allocation_price: nil, discounts: nil, external_price_id: nil, fixed_price_quantity: nil, maximum_amount: nil, minimum_amount: nil, price: nil, price_id: nil)
|
|
2129
|
+
# @!method initialize(replaces_price_id:, allocation_price: nil, discounts: nil, external_price_id: nil, fixed_price_quantity: nil, maximum_amount: nil, metric_parameter_overrides: nil, minimum_amount: nil, price: nil, price_id: nil)
|
|
2110
2130
|
# Some parameter documentations has been truncated, see
|
|
2111
2131
|
# {Orb::Models::SubscriptionCreateParams::ReplacePrice} for more details.
|
|
2112
2132
|
#
|
|
@@ -2122,6 +2142,8 @@ module Orb
|
|
|
2122
2142
|
#
|
|
2123
2143
|
# @param maximum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for
|
|
2124
2144
|
#
|
|
2145
|
+
# @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Override values for parameterized billable metric variables. Keys are parameter
|
|
2146
|
+
#
|
|
2125
2147
|
# @param minimum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
|
|
2126
2148
|
#
|
|
2127
2149
|
# @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::BulkWithFilters, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::CumulativeGroupedAllocation, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput, nil] New subscription price request body params.
|
|
@@ -137,6 +137,15 @@ module Orb
|
|
|
137
137
|
# @return [Float, nil]
|
|
138
138
|
optional :maximum_amount, Float, nil?: true
|
|
139
139
|
|
|
140
|
+
# @!attribute metric_parameter_overrides
|
|
141
|
+
# Override values for parameterized billable metric variables. Keys are parameter
|
|
142
|
+
# names, values are the override values (number or string).
|
|
143
|
+
#
|
|
144
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
145
|
+
optional :metric_parameter_overrides,
|
|
146
|
+
Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
|
|
147
|
+
nil?: true
|
|
148
|
+
|
|
140
149
|
# @!attribute minimum_amount
|
|
141
150
|
# The minimum amount that will be billed for this price interval for a given
|
|
142
151
|
# billing period.
|
|
@@ -167,7 +176,7 @@ module Orb
|
|
|
167
176
|
# @return [Array<String>, nil]
|
|
168
177
|
optional :usage_customer_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
|
|
169
178
|
|
|
170
|
-
# @!method initialize(start_date:, allocation_price: nil, can_defer_billing: nil, discounts: nil, end_date: nil, external_price_id: nil, filter: nil, fixed_fee_quantity_transitions: nil, maximum_amount: nil, minimum_amount: nil, price: nil, price_id: nil, usage_customer_ids: nil)
|
|
179
|
+
# @!method initialize(start_date:, allocation_price: nil, can_defer_billing: nil, discounts: nil, end_date: nil, external_price_id: nil, filter: nil, fixed_fee_quantity_transitions: nil, maximum_amount: nil, metric_parameter_overrides: nil, minimum_amount: nil, price: nil, price_id: nil, usage_customer_ids: nil)
|
|
171
180
|
# Some parameter documentations has been truncated, see
|
|
172
181
|
# {Orb::Models::SubscriptionPriceIntervalsParams::Add} for more details.
|
|
173
182
|
#
|
|
@@ -189,6 +198,8 @@ module Orb
|
|
|
189
198
|
#
|
|
190
199
|
# @param maximum_amount [Float, nil] The maximum amount that will be billed for this price interval for a given billi
|
|
191
200
|
#
|
|
201
|
+
# @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Override values for parameterized billable metric variables. Keys are parameter
|
|
202
|
+
#
|
|
192
203
|
# @param minimum_amount [Float, nil] The minimum amount that will be billed for this price interval for a given billi
|
|
193
204
|
#
|
|
194
205
|
# @param price [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::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::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput, nil] New floating price request body params.
|
|
@@ -1674,6 +1685,15 @@ module Orb
|
|
|
1674
1685
|
},
|
|
1675
1686
|
nil?: true
|
|
1676
1687
|
|
|
1688
|
+
# @!attribute metric_parameter_overrides
|
|
1689
|
+
# Override values for parameterized billable metric variables. Keys are parameter
|
|
1690
|
+
# names, values are the override values (number or string).
|
|
1691
|
+
#
|
|
1692
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
1693
|
+
optional :metric_parameter_overrides,
|
|
1694
|
+
Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
|
|
1695
|
+
nil?: true
|
|
1696
|
+
|
|
1677
1697
|
# @!attribute start_date
|
|
1678
1698
|
# The updated start date of this price interval. If not specified, the start date
|
|
1679
1699
|
# will not be updated.
|
|
@@ -1692,7 +1712,7 @@ module Orb
|
|
|
1692
1712
|
# @return [Array<String>, nil]
|
|
1693
1713
|
optional :usage_customer_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
|
|
1694
1714
|
|
|
1695
|
-
# @!method initialize(price_interval_id:, billing_cycle_day: nil, can_defer_billing: nil, end_date: nil, filter: nil, fixed_fee_quantity_transitions: nil, start_date: nil, usage_customer_ids: nil)
|
|
1715
|
+
# @!method initialize(price_interval_id:, billing_cycle_day: nil, can_defer_billing: nil, end_date: nil, filter: nil, fixed_fee_quantity_transitions: nil, metric_parameter_overrides: nil, start_date: nil, usage_customer_ids: nil)
|
|
1696
1716
|
# Some parameter documentations has been truncated, see
|
|
1697
1717
|
# {Orb::Models::SubscriptionPriceIntervalsParams::Edit} for more details.
|
|
1698
1718
|
#
|
|
@@ -1708,6 +1728,8 @@ module Orb
|
|
|
1708
1728
|
#
|
|
1709
1729
|
# @param fixed_fee_quantity_transitions [Array<Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition>, nil] A list of fixed fee quantity transitions to use for this price interval. Note th
|
|
1710
1730
|
#
|
|
1731
|
+
# @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Override values for parameterized billable metric variables. Keys are parameter
|
|
1732
|
+
#
|
|
1711
1733
|
# @param start_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate] The updated start date of this price interval. If not specified, the start date
|
|
1712
1734
|
#
|
|
1713
1735
|
# @param usage_customer_ids [Array<String>, nil] A list of customer IDs whose usage events will be aggregated and billed under th
|
|
@@ -387,6 +387,15 @@ module Orb
|
|
|
387
387
|
# @return [String, nil]
|
|
388
388
|
optional :maximum_amount, String, nil?: true
|
|
389
389
|
|
|
390
|
+
# @!attribute metric_parameter_overrides
|
|
391
|
+
# Override values for parameterized billable metric variables. Keys are parameter
|
|
392
|
+
# names, values are the override values.
|
|
393
|
+
#
|
|
394
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
395
|
+
optional :metric_parameter_overrides,
|
|
396
|
+
Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
|
|
397
|
+
nil?: true
|
|
398
|
+
|
|
390
399
|
# @!attribute minimum_amount
|
|
391
400
|
# @deprecated
|
|
392
401
|
#
|
|
@@ -422,7 +431,7 @@ module Orb
|
|
|
422
431
|
# @return [Time, nil]
|
|
423
432
|
optional :start_date, Time, nil?: true
|
|
424
433
|
|
|
425
|
-
# @!method initialize(allocation_price: nil, discounts: nil, end_date: nil, external_price_id: nil, maximum_amount: nil, minimum_amount: nil, plan_phase_order: nil, price: nil, price_id: nil, start_date: nil)
|
|
434
|
+
# @!method initialize(allocation_price: nil, discounts: nil, end_date: nil, external_price_id: nil, maximum_amount: nil, metric_parameter_overrides: nil, minimum_amount: nil, plan_phase_order: nil, price: nil, price_id: nil, start_date: nil)
|
|
426
435
|
# Some parameter documentations has been truncated, see
|
|
427
436
|
# {Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice} for more details.
|
|
428
437
|
#
|
|
@@ -436,6 +445,8 @@ module Orb
|
|
|
436
445
|
#
|
|
437
446
|
# @param maximum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for
|
|
438
447
|
#
|
|
448
|
+
# @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Override values for parameterized billable metric variables. Keys are parameter
|
|
449
|
+
#
|
|
439
450
|
# @param minimum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
|
|
440
451
|
#
|
|
441
452
|
# @param plan_phase_order [Integer, nil] The phase to add this price to.
|
|
@@ -2063,6 +2074,15 @@ module Orb
|
|
|
2063
2074
|
# @return [String, nil]
|
|
2064
2075
|
optional :maximum_amount, String, nil?: true
|
|
2065
2076
|
|
|
2077
|
+
# @!attribute metric_parameter_overrides
|
|
2078
|
+
# Override values for parameterized billable metric variables. Keys are parameter
|
|
2079
|
+
# names, values are the override values.
|
|
2080
|
+
#
|
|
2081
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
2082
|
+
optional :metric_parameter_overrides,
|
|
2083
|
+
Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown],
|
|
2084
|
+
nil?: true
|
|
2085
|
+
|
|
2066
2086
|
# @!attribute minimum_amount
|
|
2067
2087
|
# @deprecated
|
|
2068
2088
|
#
|
|
@@ -2088,7 +2108,7 @@ module Orb
|
|
|
2088
2108
|
# @return [String, nil]
|
|
2089
2109
|
optional :price_id, String, nil?: true
|
|
2090
2110
|
|
|
2091
|
-
# @!method initialize(replaces_price_id:, allocation_price: nil, discounts: nil, external_price_id: nil, fixed_price_quantity: nil, maximum_amount: nil, minimum_amount: nil, price: nil, price_id: nil)
|
|
2111
|
+
# @!method initialize(replaces_price_id:, allocation_price: nil, discounts: nil, external_price_id: nil, fixed_price_quantity: nil, maximum_amount: nil, metric_parameter_overrides: nil, minimum_amount: nil, price: nil, price_id: nil)
|
|
2092
2112
|
# Some parameter documentations has been truncated, see
|
|
2093
2113
|
# {Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice} for more
|
|
2094
2114
|
# details.
|
|
@@ -2105,6 +2125,8 @@ module Orb
|
|
|
2105
2125
|
#
|
|
2106
2126
|
# @param maximum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for
|
|
2107
2127
|
#
|
|
2128
|
+
# @param metric_parameter_overrides [Hash{Symbol=>Object}, nil] Override values for parameterized billable metric variables. Keys are parameter
|
|
2129
|
+
#
|
|
2108
2130
|
# @param minimum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for
|
|
2109
2131
|
#
|
|
2110
2132
|
# @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::BulkWithFilters, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::CumulativeGroupedAllocation, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput, nil] New subscription price request body params.
|
data/lib/orb/resources/alerts.rb
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
module Orb
|
|
4
4
|
module Resources
|
|
5
|
+
# [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
|
|
6
|
+
# usage, or credit balance and trigger webhooks when a threshold is exceeded.
|
|
7
|
+
#
|
|
8
|
+
# Alerts created through the API can be scoped to either customers or
|
|
9
|
+
# subscriptions.
|
|
5
10
|
class Alerts
|
|
6
11
|
# This endpoint retrieves an alert by its ID.
|
|
7
12
|
#
|
|
@@ -88,10 +93,11 @@ module Orb
|
|
|
88
93
|
# @see Orb::Models::AlertListParams
|
|
89
94
|
def list(params = {})
|
|
90
95
|
parsed, options = Orb::AlertListParams.dump_request(params)
|
|
96
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
91
97
|
@client.request(
|
|
92
98
|
method: :get,
|
|
93
99
|
path: "alerts",
|
|
94
|
-
query:
|
|
100
|
+
query: query.transform_keys(
|
|
95
101
|
created_at_gt: "created_at[gt]",
|
|
96
102
|
created_at_gte: "created_at[gte]",
|
|
97
103
|
created_at_lt: "created_at[lt]",
|
|
@@ -228,10 +234,11 @@ module Orb
|
|
|
228
234
|
# @see Orb::Models::AlertDisableParams
|
|
229
235
|
def disable(alert_configuration_id, params = {})
|
|
230
236
|
parsed, options = Orb::AlertDisableParams.dump_request(params)
|
|
237
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
231
238
|
@client.request(
|
|
232
239
|
method: :post,
|
|
233
240
|
path: ["alerts/%1$s/disable", alert_configuration_id],
|
|
234
|
-
query:
|
|
241
|
+
query: query,
|
|
235
242
|
model: Orb::Alert,
|
|
236
243
|
options: options
|
|
237
244
|
)
|
|
@@ -254,10 +261,11 @@ module Orb
|
|
|
254
261
|
# @see Orb::Models::AlertEnableParams
|
|
255
262
|
def enable(alert_configuration_id, params = {})
|
|
256
263
|
parsed, options = Orb::AlertEnableParams.dump_request(params)
|
|
264
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
257
265
|
@client.request(
|
|
258
266
|
method: :post,
|
|
259
267
|
path: ["alerts/%1$s/enable", alert_configuration_id],
|
|
260
|
-
query:
|
|
268
|
+
query: query,
|
|
261
269
|
model: Orb::Alert,
|
|
262
270
|
options: options
|
|
263
271
|
)
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
module Orb
|
|
4
4
|
module Resources
|
|
5
5
|
class Beta
|
|
6
|
+
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
|
7
|
+
# subscribed to by a customer. Plans define the billing behavior of the
|
|
8
|
+
# subscription. You can see more about how to configure prices in the
|
|
9
|
+
# [Price resource](/reference/price).
|
|
6
10
|
class ExternalPlanID
|
|
7
11
|
# This endpoint allows the creation of a new plan version for an existing plan.
|
|
8
12
|
#
|
data/lib/orb/resources/beta.rb
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
module Orb
|
|
4
4
|
module Resources
|
|
5
|
+
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
|
6
|
+
# subscribed to by a customer. Plans define the billing behavior of the
|
|
7
|
+
# subscription. You can see more about how to configure prices in the
|
|
8
|
+
# [Price resource](/reference/price).
|
|
5
9
|
class Beta
|
|
10
|
+
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
|
11
|
+
# subscribed to by a customer. Plans define the billing behavior of the
|
|
12
|
+
# subscription. You can see more about how to configure prices in the
|
|
13
|
+
# [Price resource](/reference/price).
|
|
6
14
|
# @return [Orb::Resources::Beta::ExternalPlanID]
|
|
7
15
|
attr_reader :external_plan_id
|
|
8
16
|
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
module Orb
|
|
4
4
|
module Resources
|
|
5
5
|
class Coupons
|
|
6
|
+
# A coupon represents a reusable discount configuration that can be applied either
|
|
7
|
+
# as a fixed or percentage amount to an invoice or subscription. Coupons are
|
|
8
|
+
# activated using a redemption code, which applies the discount to a subscription
|
|
9
|
+
# or invoice. The duration of a coupon determines how long it remains available
|
|
10
|
+
# for use by end users.
|
|
6
11
|
class Subscriptions
|
|
7
12
|
# Some parameter documentations has been truncated, see
|
|
8
13
|
# {Orb::Models::Coupons::SubscriptionListParams} for more details.
|
|
@@ -27,10 +32,11 @@ module Orb
|
|
|
27
32
|
# @see Orb::Models::Coupons::SubscriptionListParams
|
|
28
33
|
def list(coupon_id, params = {})
|
|
29
34
|
parsed, options = Orb::Coupons::SubscriptionListParams.dump_request(params)
|
|
35
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
30
36
|
@client.request(
|
|
31
37
|
method: :get,
|
|
32
38
|
path: ["coupons/%1$s/subscriptions", coupon_id],
|
|
33
|
-
query:
|
|
39
|
+
query: query,
|
|
34
40
|
page: Orb::Internal::Page,
|
|
35
41
|
model: Orb::Subscription,
|
|
36
42
|
options: options
|
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
module Orb
|
|
4
4
|
module Resources
|
|
5
|
+
# A coupon represents a reusable discount configuration that can be applied either
|
|
6
|
+
# as a fixed or percentage amount to an invoice or subscription. Coupons are
|
|
7
|
+
# activated using a redemption code, which applies the discount to a subscription
|
|
8
|
+
# or invoice. The duration of a coupon determines how long it remains available
|
|
9
|
+
# for use by end users.
|
|
5
10
|
class Coupons
|
|
11
|
+
# A coupon represents a reusable discount configuration that can be applied either
|
|
12
|
+
# as a fixed or percentage amount to an invoice or subscription. Coupons are
|
|
13
|
+
# activated using a redemption code, which applies the discount to a subscription
|
|
14
|
+
# or invoice. The duration of a coupon determines how long it remains available
|
|
15
|
+
# for use by end users.
|
|
6
16
|
# @return [Orb::Resources::Coupons::Subscriptions]
|
|
7
17
|
attr_reader :subscriptions
|
|
8
18
|
|
|
@@ -59,10 +69,11 @@ module Orb
|
|
|
59
69
|
# @see Orb::Models::CouponListParams
|
|
60
70
|
def list(params = {})
|
|
61
71
|
parsed, options = Orb::CouponListParams.dump_request(params)
|
|
72
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
62
73
|
@client.request(
|
|
63
74
|
method: :get,
|
|
64
75
|
path: "coupons",
|
|
65
|
-
query:
|
|
76
|
+
query: query,
|
|
66
77
|
page: Orb::Internal::Page,
|
|
67
78
|
model: Orb::Coupon,
|
|
68
79
|
options: options
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Orb
|
|
4
4
|
module Resources
|
|
5
|
+
# The [Credit Note](/invoicing/credit-notes) resource represents a credit that has
|
|
6
|
+
# been applied to a particular invoice.
|
|
5
7
|
class CreditNotes
|
|
6
8
|
# Some parameter documentations has been truncated, see
|
|
7
9
|
# {Orb::Models::CreditNoteCreateParams} for more details.
|
|
@@ -90,10 +92,11 @@ module Orb
|
|
|
90
92
|
# @see Orb::Models::CreditNoteListParams
|
|
91
93
|
def list(params = {})
|
|
92
94
|
parsed, options = Orb::CreditNoteListParams.dump_request(params)
|
|
95
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
93
96
|
@client.request(
|
|
94
97
|
method: :get,
|
|
95
98
|
path: "credit_notes",
|
|
96
|
-
query:
|
|
99
|
+
query: query.transform_keys(
|
|
97
100
|
created_at_gt: "created_at[gt]",
|
|
98
101
|
created_at_gte: "created_at[gte]",
|
|
99
102
|
created_at_lt: "created_at[lt]",
|
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
module Orb
|
|
4
4
|
module Resources
|
|
5
5
|
class Customers
|
|
6
|
+
# A customer is a buyer of your products, and the other party to the billing
|
|
7
|
+
# relationship.
|
|
8
|
+
#
|
|
9
|
+
# In Orb, customers are assigned system generated identifiers automatically, but
|
|
10
|
+
# it's often desirable to have these match existing identifiers in your system. To
|
|
11
|
+
# avoid having to denormalize Orb ID information, you can pass in an
|
|
12
|
+
# `external_customer_id` with your own identifier. See
|
|
13
|
+
# [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
|
|
14
|
+
# information about how these aliases work in Orb.
|
|
15
|
+
#
|
|
16
|
+
# In addition to having an identifier in your system, a customer may exist in a
|
|
17
|
+
# payment provider solution like Stripe. Use the `payment_provider_id` and the
|
|
18
|
+
# `payment_provider` enum field to express this mapping.
|
|
19
|
+
#
|
|
20
|
+
# A customer also has a timezone (from the standard
|
|
21
|
+
# [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
|
|
22
|
+
# your account's timezone. See [Timezone localization](/essentials/timezones) for
|
|
23
|
+
# information on what this timezone parameter influences within Orb.
|
|
6
24
|
class BalanceTransactions
|
|
7
25
|
# Creates an immutable balance transaction that updates the customer's balance and
|
|
8
26
|
# returns back the newly created transaction.
|
|
@@ -81,10 +99,11 @@ module Orb
|
|
|
81
99
|
# @see Orb::Models::Customers::BalanceTransactionListParams
|
|
82
100
|
def list(customer_id, params = {})
|
|
83
101
|
parsed, options = Orb::Customers::BalanceTransactionListParams.dump_request(params)
|
|
102
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
84
103
|
@client.request(
|
|
85
104
|
method: :get,
|
|
86
105
|
path: ["customers/%1$s/balance_transactions", customer_id],
|
|
87
|
-
query:
|
|
106
|
+
query: query.transform_keys(
|
|
88
107
|
operation_time_gt: "operation_time[gt]",
|
|
89
108
|
operation_time_gte: "operation_time[gte]",
|
|
90
109
|
operation_time_lt: "operation_time[lt]",
|
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
module Orb
|
|
4
4
|
module Resources
|
|
5
5
|
class Customers
|
|
6
|
+
# A customer is a buyer of your products, and the other party to the billing
|
|
7
|
+
# relationship.
|
|
8
|
+
#
|
|
9
|
+
# In Orb, customers are assigned system generated identifiers automatically, but
|
|
10
|
+
# it's often desirable to have these match existing identifiers in your system. To
|
|
11
|
+
# avoid having to denormalize Orb ID information, you can pass in an
|
|
12
|
+
# `external_customer_id` with your own identifier. See
|
|
13
|
+
# [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
|
|
14
|
+
# information about how these aliases work in Orb.
|
|
15
|
+
#
|
|
16
|
+
# In addition to having an identifier in your system, a customer may exist in a
|
|
17
|
+
# payment provider solution like Stripe. Use the `payment_provider_id` and the
|
|
18
|
+
# `payment_provider` enum field to express this mapping.
|
|
19
|
+
#
|
|
20
|
+
# A customer also has a timezone (from the standard
|
|
21
|
+
# [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
|
|
22
|
+
# your account's timezone. See [Timezone localization](/essentials/timezones) for
|
|
23
|
+
# information on what this timezone parameter influences within Orb.
|
|
6
24
|
class Costs
|
|
7
25
|
# Some parameter documentations has been truncated, see
|
|
8
26
|
# {Orb::Models::Customers::CostListParams} for more details.
|
|
@@ -144,10 +162,11 @@ module Orb
|
|
|
144
162
|
# @see Orb::Models::Customers::CostListParams
|
|
145
163
|
def list(customer_id, params = {})
|
|
146
164
|
parsed, options = Orb::Customers::CostListParams.dump_request(params)
|
|
165
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
147
166
|
@client.request(
|
|
148
167
|
method: :get,
|
|
149
168
|
path: ["customers/%1$s/costs", customer_id],
|
|
150
|
-
query:
|
|
169
|
+
query: query,
|
|
151
170
|
model: Orb::Models::Customers::CostListResponse,
|
|
152
171
|
options: options
|
|
153
172
|
)
|
|
@@ -293,10 +312,11 @@ module Orb
|
|
|
293
312
|
# @see Orb::Models::Customers::CostListByExternalIDParams
|
|
294
313
|
def list_by_external_id(external_customer_id, params = {})
|
|
295
314
|
parsed, options = Orb::Customers::CostListByExternalIDParams.dump_request(params)
|
|
315
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
296
316
|
@client.request(
|
|
297
317
|
method: :get,
|
|
298
318
|
path: ["customers/external_customer_id/%1$s/costs", external_customer_id],
|
|
299
|
-
query:
|
|
319
|
+
query: query,
|
|
300
320
|
model: Orb::Models::Customers::CostListByExternalIDResponse,
|
|
301
321
|
options: options
|
|
302
322
|
)
|
|
@@ -4,6 +4,8 @@ module Orb
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Customers
|
|
6
6
|
class Credits
|
|
7
|
+
# The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
|
|
8
|
+
# credits within Orb.
|
|
7
9
|
class Ledger
|
|
8
10
|
# Some parameter documentations has been truncated, see
|
|
9
11
|
# {Orb::Models::Customers::Credits::LedgerListParams} for more details.
|
|
@@ -119,10 +121,11 @@ module Orb
|
|
|
119
121
|
# @see Orb::Models::Customers::Credits::LedgerListParams
|
|
120
122
|
def list(customer_id, params = {})
|
|
121
123
|
parsed, options = Orb::Customers::Credits::LedgerListParams.dump_request(params)
|
|
124
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
122
125
|
@client.request(
|
|
123
126
|
method: :get,
|
|
124
127
|
path: ["customers/%1$s/credits/ledger", customer_id],
|
|
125
|
-
query:
|
|
128
|
+
query: query.transform_keys(
|
|
126
129
|
created_at_gt: "created_at[gt]",
|
|
127
130
|
created_at_gte: "created_at[gte]",
|
|
128
131
|
created_at_lt: "created_at[lt]",
|
|
@@ -187,8 +190,12 @@ module Orb
|
|
|
187
190
|
# also generate a one-off invoice for the customer for the credits pre-purchase.
|
|
188
191
|
# Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
|
|
189
192
|
# on the invoice are calculated by multiplying the cost basis with the number of
|
|
190
|
-
# credit units added.
|
|
191
|
-
#
|
|
193
|
+
# credit units added.
|
|
194
|
+
#
|
|
195
|
+
# - if `per_unit_cost_basis` is greater than zero, an invoice will be generated
|
|
196
|
+
# and `invoice_settings` must be included
|
|
197
|
+
# - if `invoice_settings` is passed, one of either `custom_due_date` or
|
|
198
|
+
# `net_terms` is required to determine the due date
|
|
192
199
|
#
|
|
193
200
|
# ## Deducting Credits
|
|
194
201
|
#
|
|
@@ -349,8 +356,12 @@ module Orb
|
|
|
349
356
|
# also generate a one-off invoice for the customer for the credits pre-purchase.
|
|
350
357
|
# Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
|
|
351
358
|
# on the invoice are calculated by multiplying the cost basis with the number of
|
|
352
|
-
# credit units added.
|
|
353
|
-
#
|
|
359
|
+
# credit units added.
|
|
360
|
+
#
|
|
361
|
+
# - if `per_unit_cost_basis` is greater than zero, an invoice will be generated
|
|
362
|
+
# and `invoice_settings` must be included
|
|
363
|
+
# - if `invoice_settings` is passed, one of either `custom_due_date` or
|
|
364
|
+
# `net_terms` is required to determine the due date
|
|
354
365
|
#
|
|
355
366
|
# ## Deducting Credits
|
|
356
367
|
#
|
|
@@ -572,10 +583,11 @@ module Orb
|
|
|
572
583
|
# @see Orb::Models::Customers::Credits::LedgerListByExternalIDParams
|
|
573
584
|
def list_by_external_id(external_customer_id, params = {})
|
|
574
585
|
parsed, options = Orb::Customers::Credits::LedgerListByExternalIDParams.dump_request(params)
|
|
586
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
575
587
|
@client.request(
|
|
576
588
|
method: :get,
|
|
577
589
|
path: ["customers/external_customer_id/%1$s/credits/ledger", external_customer_id],
|
|
578
|
-
query:
|
|
590
|
+
query: query.transform_keys(
|
|
579
591
|
created_at_gt: "created_at[gt]",
|
|
580
592
|
created_at_gte: "created_at[gte]",
|
|
581
593
|
created_at_lt: "created_at[lt]",
|
|
@@ -4,6 +4,8 @@ module Orb
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Customers
|
|
6
6
|
class Credits
|
|
7
|
+
# The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
|
|
8
|
+
# credits within Orb.
|
|
7
9
|
class TopUps
|
|
8
10
|
# Some parameter documentations has been truncated, see
|
|
9
11
|
# {Orb::Models::Customers::Credits::TopUpCreateParams} for more details.
|
|
@@ -72,10 +74,11 @@ module Orb
|
|
|
72
74
|
# @see Orb::Models::Customers::Credits::TopUpListParams
|
|
73
75
|
def list(customer_id, params = {})
|
|
74
76
|
parsed, options = Orb::Customers::Credits::TopUpListParams.dump_request(params)
|
|
77
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
75
78
|
@client.request(
|
|
76
79
|
method: :get,
|
|
77
80
|
path: ["customers/%1$s/credits/top_ups", customer_id],
|
|
78
|
-
query:
|
|
81
|
+
query: query,
|
|
79
82
|
page: Orb::Internal::Page,
|
|
80
83
|
model: Orb::Models::Customers::Credits::TopUpListResponse,
|
|
81
84
|
options: options
|
|
@@ -206,10 +209,11 @@ module Orb
|
|
|
206
209
|
# @see Orb::Models::Customers::Credits::TopUpListByExternalIDParams
|
|
207
210
|
def list_by_external_id(external_customer_id, params = {})
|
|
208
211
|
parsed, options = Orb::Customers::Credits::TopUpListByExternalIDParams.dump_request(params)
|
|
212
|
+
query = Orb::Internal::Util.encode_query_params(parsed)
|
|
209
213
|
@client.request(
|
|
210
214
|
method: :get,
|
|
211
215
|
path: ["customers/external_customer_id/%1$s/credits/top_ups", external_customer_id],
|
|
212
|
-
query:
|
|
216
|
+
query: query,
|
|
213
217
|
page: Orb::Internal::Page,
|
|
214
218
|
model: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse,
|
|
215
219
|
options: options
|