metronome-sdk 0.3.0 → 2.0.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 +91 -0
- data/README.md +9 -9
- data/lib/metronome_sdk/errors.rb +25 -11
- data/lib/metronome_sdk/file_part.rb +10 -7
- data/lib/metronome_sdk/internal/body_cursor_page.rb +86 -0
- data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
- data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +86 -0
- data/lib/metronome_sdk/internal/transport/base_client.rb +12 -11
- data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +8 -19
- data/lib/metronome_sdk/internal/type/base_model.rb +6 -13
- data/lib/metronome_sdk/internal/type/base_page.rb +1 -1
- data/lib/metronome_sdk/internal/type/enum.rb +25 -0
- data/lib/metronome_sdk/internal/type/file_input.rb +7 -4
- data/lib/metronome_sdk/internal/type/union.rb +11 -0
- data/lib/metronome_sdk/internal/util.rb +9 -8
- data/lib/metronome_sdk/models/base_threshold_commit.rb +36 -0
- data/lib/metronome_sdk/models/commit.rb +26 -170
- data/lib/metronome_sdk/models/commit_hierarchy_configuration.rb +98 -0
- data/lib/metronome_sdk/models/commit_rate.rb +48 -0
- data/lib/metronome_sdk/models/commit_specifier.rb +42 -0
- data/lib/metronome_sdk/models/commit_specifier_input.rb +42 -0
- data/lib/metronome_sdk/models/contract.rb +404 -0
- data/lib/metronome_sdk/models/contract_v2.rb +3169 -0
- data/lib/metronome_sdk/models/contract_without_amendments.rb +38 -1128
- data/lib/metronome_sdk/models/credit.rb +9 -156
- data/lib/metronome_sdk/models/discount.rb +2 -1
- data/lib/metronome_sdk/models/hierarchy_configuration.rb +173 -0
- data/lib/metronome_sdk/models/override.rb +6 -101
- data/lib/metronome_sdk/models/override_tier.rb +21 -0
- data/lib/metronome_sdk/models/overwrite_rate.rb +82 -0
- data/lib/metronome_sdk/models/payment_gate_config.rb +150 -0
- data/lib/metronome_sdk/models/payment_gate_config_v2.rb +150 -0
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +100 -0
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +102 -0
- data/lib/metronome_sdk/models/pro_service.rb +2 -1
- data/lib/metronome_sdk/models/recurring_commit_subscription_config.rb +51 -0
- data/lib/metronome_sdk/models/scheduled_charge.rb +2 -1
- data/lib/metronome_sdk/models/spend_threshold_configuration.rb +44 -0
- data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +44 -0
- data/lib/metronome_sdk/models/subscription.rb +311 -0
- data/lib/metronome_sdk/models/update_base_threshold_commit.rb +36 -0
- data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +42 -42
- data/lib/metronome_sdk/models/v1/billable_metric_create_params.rb +1 -2
- data/lib/metronome_sdk/models/v1/billable_metric_list_response.rb +3 -3
- data/lib/metronome_sdk/models/v1/billable_metric_retrieve_response.rb +4 -7
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +58 -411
- data/lib/metronome_sdk/models/v1/contract_create_historical_invoices_params.rb +7 -16
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +315 -1459
- data/lib/metronome_sdk/models/v1/contract_list_balances_response.rb +6 -23
- data/lib/metronome_sdk/models/v1/contract_list_response.rb +3 -1153
- data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_params.rb +2 -6
- data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rb +5 -50
- data/lib/metronome_sdk/models/v1/contract_retrieve_response.rb +3 -1154
- data/lib/metronome_sdk/models/v1/contract_schedule_pro_services_invoice_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +2 -1
- data/lib/metronome_sdk/models/v1/contracts/product_list_response.rb +8 -1
- data/lib/metronome_sdk/models/v1/contracts/product_retrieve_response.rb +8 -1
- data/lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb +1 -4
- data/lib/metronome_sdk/models/v1/contracts/rate_card_create_params.rb +4 -7
- data/lib/metronome_sdk/models/v1/contracts/rate_card_list_response.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_params.rb +2 -6
- data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rb +5 -50
- data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/rate_card_update_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/product_order_update_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rb +6 -61
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rb +3 -49
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rb +4 -51
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_params.rb +2 -6
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rb +5 -49
- data/lib/metronome_sdk/models/v1/credit_grant_list_entries_response.rb +103 -123
- data/lib/metronome_sdk/models/v1/credit_grant_list_response.rb +3 -5
- data/lib/metronome_sdk/models/v1/custom_field_list_keys_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/custom_field_list_keys_response.rb +41 -58
- data/lib/metronome_sdk/models/v1/custom_field_set_values_params.rb +5 -1
- data/lib/metronome_sdk/models/v1/customer.rb +2 -1
- data/lib/metronome_sdk/models/v1/customer_create_params.rb +37 -11
- data/lib/metronome_sdk/models/v1/customer_detail.rb +11 -2
- data/lib/metronome_sdk/models/v1/customer_list_billable_metrics_response.rb +3 -3
- data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +6 -18
- data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
- data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +128 -0
- data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +143 -0
- data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +4 -6
- data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
- data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +37 -8
- data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +2 -0
- data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +2 -0
- data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +10 -60
- data/lib/metronome_sdk/models/v1/customers/credit_create_params.rb +6 -48
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +48 -54
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +197 -66
- data/lib/metronome_sdk/models/v1/customers/invoice_list_breakdowns_params.rb +1 -4
- data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
- data/lib/metronome_sdk/models/v1/customers/plan_add_params.rb +2 -6
- data/lib/metronome_sdk/models/v1/customers/plan_list_response.rb +2 -1
- data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +4 -11
- data/lib/metronome_sdk/models/v1/payment.rb +151 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
- data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
- data/lib/metronome_sdk/models/v1/plan_detail.rb +9 -5
- data/lib/metronome_sdk/models/v1/plan_list_charges_response.rb +2 -1
- data/lib/metronome_sdk/models/v1/plan_list_customers_response.rb +2 -1
- data/lib/metronome_sdk/models/v1/plan_list_response.rb +5 -1
- data/lib/metronome_sdk/models/v1/usage_ingest_params.rb +1 -4
- data/lib/metronome_sdk/models/v1/usage_list_params.rb +1 -3
- data/lib/metronome_sdk/models/v1/usage_list_response.rb +45 -62
- data/lib/metronome_sdk/models/v1/usage_search_response.rb +4 -7
- data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +37 -58
- data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +34 -49
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +552 -2265
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +417 -2317
- data/lib/metronome_sdk/models/v2/contract_list_response.rb +3 -4520
- data/lib/metronome_sdk/models/v2/contract_retrieve_response.rb +3 -4528
- data/lib/metronome_sdk/models.rb +38 -0
- data/lib/metronome_sdk/resources/v1/alerts.rb +90 -16
- data/lib/metronome_sdk/resources/v1/audit_logs.rb +39 -4
- data/lib/metronome_sdk/resources/v1/billable_metrics.rb +54 -4
- data/lib/metronome_sdk/resources/v1/contracts/products.rb +25 -6
- data/lib/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rb +7 -2
- data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +10 -2
- data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +109 -10
- data/lib/metronome_sdk/resources/v1/contracts.rb +255 -18
- data/lib/metronome_sdk/resources/v1/credit_grants.rb +2 -1
- data/lib/metronome_sdk/resources/v1/custom_fields.rb +51 -14
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +127 -13
- data/lib/metronome_sdk/resources/v1/customers/commits.rb +119 -9
- data/lib/metronome_sdk/resources/v1/customers/credits.rb +104 -8
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +179 -8
- data/lib/metronome_sdk/resources/v1/customers.rb +175 -15
- data/lib/metronome_sdk/resources/v1/dashboards.rb +29 -3
- data/lib/metronome_sdk/resources/v1/invoices.rb +23 -2
- data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
- data/lib/metronome_sdk/resources/v1/pricing_units.rb +6 -1
- data/lib/metronome_sdk/resources/v1/services.rb +6 -4
- data/lib/metronome_sdk/resources/v1/usage.rb +188 -13
- data/lib/metronome_sdk/resources/v1.rb +4 -0
- data/lib/metronome_sdk/resources/v2/contracts.rb +120 -18
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +33 -3
- data/rbi/metronome_sdk/errors.rbi +31 -4
- data/rbi/metronome_sdk/file_part.rbi +1 -1
- data/rbi/metronome_sdk/internal/body_cursor_page.rbi +22 -0
- data/rbi/metronome_sdk/internal/cursor_page_without_limit.rbi +22 -0
- data/rbi/metronome_sdk/internal/transport/base_client.rbi +4 -5
- data/rbi/metronome_sdk/internal/type/base_page.rbi +1 -1
- data/rbi/metronome_sdk/internal/util.rbi +1 -1
- data/rbi/metronome_sdk/models/base_threshold_commit.rbi +58 -0
- data/rbi/metronome_sdk/models/commit.rbi +26 -348
- data/rbi/metronome_sdk/models/commit_hierarchy_configuration.rbi +280 -0
- data/rbi/metronome_sdk/models/commit_rate.rbi +85 -0
- data/rbi/metronome_sdk/models/commit_specifier.rbi +71 -0
- data/rbi/metronome_sdk/models/commit_specifier_input.rbi +74 -0
- data/rbi/metronome_sdk/models/contract.rbi +768 -0
- data/rbi/metronome_sdk/models/contract_v2.rbi +6415 -0
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +186 -2509
- data/rbi/metronome_sdk/models/credit.rbi +10 -348
- data/rbi/metronome_sdk/models/discount.rbi +2 -0
- data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +424 -0
- data/rbi/metronome_sdk/models/override.rbi +8 -193
- data/rbi/metronome_sdk/models/override_tier.rbi +29 -0
- data/rbi/metronome_sdk/models/overwrite_rate.rbi +137 -0
- data/rbi/metronome_sdk/models/payment_gate_config.rbi +317 -0
- data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +326 -0
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +183 -0
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +188 -0
- data/rbi/metronome_sdk/models/pro_service.rbi +2 -0
- data/rbi/metronome_sdk/models/recurring_commit_subscription_config.rbi +125 -0
- data/rbi/metronome_sdk/models/scheduled_charge.rbi +2 -0
- data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +76 -0
- data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -0
- data/rbi/metronome_sdk/models/subscription.rbi +635 -0
- data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +61 -0
- data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +57 -50
- data/rbi/metronome_sdk/models/v1/billable_metric_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/billable_metric_retrieve_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +49 -768
- data/rbi/metronome_sdk/models/v1/contract_create_historical_invoices_params.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1843 -4119
- data/rbi/metronome_sdk/models/v1/contract_list_balances_response.rbi +8 -59
- data/rbi/metronome_sdk/models/v1/contract_list_response.rbi +5 -2420
- data/rbi/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbi +6 -129
- data/rbi/metronome_sdk/models/v1/contract_retrieve_response.rbi +4 -2419
- data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_retrieve_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_card_create_params.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_card_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbi +6 -129
- data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbi +4 -129
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbi +4 -129
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbi +4 -129
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbi +6 -129
- data/rbi/metronome_sdk/models/v1/credit_grant_list_entries_response.rbi +147 -198
- data/rbi/metronome_sdk/models/v1/credit_grant_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/custom_field_list_keys_response.rbi +117 -165
- data/rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi +8 -1
- data/rbi/metronome_sdk/models/v1/customer.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +88 -3
- data/rbi/metronome_sdk/models/v1/customer_detail.rbi +10 -0
- data/rbi/metronome_sdk/models/v1/customer_list_billable_metrics_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +6 -21
- data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
- data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbi +51 -0
- data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +265 -0
- data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +348 -0
- data/rbi/metronome_sdk/models/v1/customers/alert_list_params.rbi +4 -4
- data/rbi/metronome_sdk/models/v1/customers/alert_reset_params.rbi +2 -2
- data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +68 -8
- data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +10 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +10 -0
- data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +6 -90
- data/rbi/metronome_sdk/models/v1/customers/credit_create_params.rbi +6 -90
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +54 -47
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +316 -68
- data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
- data/rbi/metronome_sdk/models/v1/customers/plan_list_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/payment.rbi +316 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
- data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -0
- data/rbi/metronome_sdk/models/v1/plan_detail.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/plan_list_charges_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/plan_list_customers_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v1/plan_list_response.rbi +8 -1
- data/rbi/metronome_sdk/models/v1/usage_list_response.rbi +45 -86
- data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +2 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +74 -76
- data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +74 -76
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +3875 -7234
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1733 -6207
- data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +5 -9867
- data/rbi/metronome_sdk/models/v2/contract_retrieve_response.rbi +6 -9866
- data/rbi/metronome_sdk/models.rbi +44 -0
- data/rbi/metronome_sdk/resources/v1/alerts.rbi +101 -27
- data/rbi/metronome_sdk/resources/v1/audit_logs.rbi +39 -4
- data/rbi/metronome_sdk/resources/v1/billable_metrics.rbi +54 -4
- data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +25 -5
- data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rbi +7 -2
- data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +10 -3
- data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +109 -9
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +258 -16
- data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +5 -1
- data/rbi/metronome_sdk/resources/v1/custom_fields.rbi +57 -14
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +133 -11
- data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +119 -10
- data/rbi/metronome_sdk/resources/v1/customers/credits.rbi +104 -9
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +159 -7
- data/rbi/metronome_sdk/resources/v1/customers.rbi +162 -14
- data/rbi/metronome_sdk/resources/v1/dashboards.rbi +29 -3
- data/rbi/metronome_sdk/resources/v1/invoices.rbi +23 -2
- data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
- data/rbi/metronome_sdk/resources/v1/pricing_units.rbi +6 -1
- data/rbi/metronome_sdk/resources/v1/services.rbi +6 -4
- data/rbi/metronome_sdk/resources/v1/usage.rbi +191 -13
- data/rbi/metronome_sdk/resources/v1.rbi +3 -0
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +134 -23
- data/sig/metronome_sdk/errors.rbs +7 -0
- data/sig/metronome_sdk/file_part.rbs +1 -1
- data/sig/metronome_sdk/internal/body_cursor_page.rbs +13 -0
- data/sig/metronome_sdk/internal/cursor_page_without_limit.rbs +13 -0
- data/sig/metronome_sdk/models/base_threshold_commit.rbs +26 -0
- data/sig/metronome_sdk/models/commit.rbs +17 -170
- data/sig/metronome_sdk/models/commit_hierarchy_configuration.rbs +117 -0
- data/sig/metronome_sdk/models/commit_rate.rbs +48 -0
- data/sig/metronome_sdk/models/commit_specifier.rbs +47 -0
- data/sig/metronome_sdk/models/commit_specifier_input.rbs +47 -0
- data/sig/metronome_sdk/models/contract.rbs +398 -0
- data/sig/metronome_sdk/models/contract_v2.rbs +3108 -0
- data/sig/metronome_sdk/models/contract_without_amendments.rbs +54 -976
- data/sig/metronome_sdk/models/credit.rbs +12 -170
- data/sig/metronome_sdk/models/hierarchy_configuration.rbs +152 -0
- data/sig/metronome_sdk/models/override.rbs +12 -101
- data/sig/metronome_sdk/models/override_tier.rbs +17 -0
- data/sig/metronome_sdk/models/overwrite_rate.rbs +78 -0
- data/sig/metronome_sdk/models/payment_gate_config.rbs +124 -0
- data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +124 -0
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +82 -0
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +82 -0
- data/sig/metronome_sdk/models/recurring_commit_subscription_config.rbs +51 -0
- data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +35 -0
- data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +35 -0
- data/sig/metronome_sdk/models/subscription.rbs +295 -0
- data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +28 -0
- data/sig/metronome_sdk/models/v1/alert_create_params.rbs +4 -2
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +26 -341
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +219 -1184
- data/sig/metronome_sdk/models/v1/contract_list_balances_response.rbs +4 -25
- data/sig/metronome_sdk/models/v1/contract_list_response.rbs +4 -1041
- data/sig/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contract_retrieve_response.rbs +4 -1041
- data/sig/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbs +6 -54
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbs +6 -54
- data/sig/metronome_sdk/models/v1/credit_grant_list_entries_response.rbs +72 -94
- data/sig/metronome_sdk/models/v1/custom_field_list_keys_response.rbs +53 -75
- data/sig/metronome_sdk/models/v1/customer_create_params.rbs +31 -4
- data/sig/metronome_sdk/models/v1/customer_detail.rbs +5 -0
- data/sig/metronome_sdk/models/v1/customer_preview_events_params.rbs +0 -7
- data/sig/metronome_sdk/models/v1/customer_preview_events_response.rbs +6 -4
- data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbs +32 -0
- data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +113 -0
- data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +133 -0
- data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +21 -0
- data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +7 -1
- data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +6 -1
- data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +6 -50
- data/sig/metronome_sdk/models/v1/customers/credit_create_params.rbs +6 -50
- data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +4 -2
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +137 -24
- data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
- data/sig/metronome_sdk/models/v1/payment.rbs +191 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
- data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
- data/sig/metronome_sdk/models/v1/usage_list_response.rbs +33 -55
- data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +28 -43
- data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +28 -43
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +412 -1793
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +342 -2149
- data/sig/metronome_sdk/models/v2/contract_list_response.rbs +4 -4426
- data/sig/metronome_sdk/models/v2/contract_retrieve_response.rbs +4 -4426
- data/sig/metronome_sdk/models.rbs +38 -0
- data/sig/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbs +1 -1
- data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -3
- data/sig/metronome_sdk/resources/v1/credit_grants.rbs +1 -1
- data/sig/metronome_sdk/resources/v1/custom_fields.rbs +1 -1
- data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +2 -1
- data/sig/metronome_sdk/resources/v1/customers/commits.rbs +2 -2
- data/sig/metronome_sdk/resources/v1/customers/credits.rbs +2 -2
- data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +6 -0
- data/sig/metronome_sdk/resources/v1/customers.rbs +11 -0
- data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
- data/sig/metronome_sdk/resources/v1/usage.rbs +1 -1
- data/sig/metronome_sdk/resources/v1.rbs +2 -0
- data/sig/metronome_sdk/resources/v2/contracts.rbs +10 -4
- metadata +101 -11
- data/lib/metronome_sdk/models/v1/customers/alert_list_response.rb +0 -29
- data/lib/metronome_sdk/models/v1/customers/commit_list_response.rb +0 -26
- data/lib/metronome_sdk/models/v1/customers/credit_list_response.rb +0 -26
- data/rbi/metronome_sdk/models/v1/customers/alert_list_response.rbi +0 -46
- data/rbi/metronome_sdk/models/v1/customers/commit_list_response.rbi +0 -45
- data/rbi/metronome_sdk/models/v1/customers/credit_list_response.rbi +0 -45
- data/sig/metronome_sdk/models/v1/customers/alert_list_response.rbs +0 -29
- data/sig/metronome_sdk/models/v1/customers/commit_list_response.rbs +0 -26
- data/sig/metronome_sdk/models/v1/customers/credit_list_response.rbs +0 -26
|
@@ -24,7 +24,39 @@ module MetronomeSDK
|
|
|
24
24
|
end
|
|
25
25
|
attr_reader :named_schedules
|
|
26
26
|
|
|
27
|
-
#
|
|
27
|
+
# In Metronome, the rate card is the central location for your pricing. Rate cards
|
|
28
|
+
# were built with new product launches and pricing changes in mind - you can
|
|
29
|
+
# update your products and pricing in one place, and that change will be
|
|
30
|
+
# automatically propagated across your customer cohorts. Most clients need only
|
|
31
|
+
# maintain one or a few rate cards within Metronome.
|
|
32
|
+
#
|
|
33
|
+
# ### Use this endpoint to:
|
|
34
|
+
#
|
|
35
|
+
# - Create a rate card with a name and description
|
|
36
|
+
# - Define the rate card's single underlying fiat currency, and any number of
|
|
37
|
+
# conversion rates between that fiat currency and custom pricing units. You can
|
|
38
|
+
# then add products and associated rates in the fiat currency or custom pricing
|
|
39
|
+
# unit for which you have defined a conversion rate.
|
|
40
|
+
# - Set aliases for the rate card. Aliases are human-readable names that you can
|
|
41
|
+
# use in the place of the id of the rate card when provisioning a customer's
|
|
42
|
+
# contract. By using an alias, you can easily create a contract and provision a
|
|
43
|
+
# customer by choosing the paygo rate card, without storing the rate card id in
|
|
44
|
+
# your internal systems. This is helpful when launching a new rate card for
|
|
45
|
+
# paygo customers, you can update the alias for paygo to be scheduled to be
|
|
46
|
+
# assigned to the new rate card without updating your code.
|
|
47
|
+
#
|
|
48
|
+
# ### Key response fields:
|
|
49
|
+
#
|
|
50
|
+
# - The ID of the rate card you just created
|
|
51
|
+
#
|
|
52
|
+
# ### Usage guidelines:
|
|
53
|
+
#
|
|
54
|
+
# - After creating a rate card, you can now use the addRate or addRates endpoints
|
|
55
|
+
# to add products and their prices to it
|
|
56
|
+
# - A rate card alias can only be used by one rate card at a time. If you create a
|
|
57
|
+
# contract with a rate card alias that is already in use by another rate card,
|
|
58
|
+
# the original rate card's alias schedule will be updated. The alias will
|
|
59
|
+
# reference the rate card to which it was most recently assigned.
|
|
28
60
|
sig do
|
|
29
61
|
params(
|
|
30
62
|
name: String,
|
|
@@ -53,6 +85,7 @@ module MetronomeSDK
|
|
|
53
85
|
aliases: nil,
|
|
54
86
|
# Required when using custom pricing units in rates.
|
|
55
87
|
credit_type_conversions: nil,
|
|
88
|
+
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
56
89
|
custom_fields: nil,
|
|
57
90
|
description: nil,
|
|
58
91
|
# The Metronome ID of the credit type to associate with the rate card, defaults to
|
|
@@ -62,8 +95,9 @@ module MetronomeSDK
|
|
|
62
95
|
)
|
|
63
96
|
end
|
|
64
97
|
|
|
65
|
-
#
|
|
66
|
-
#
|
|
98
|
+
# Return details for a specific rate card including name, description, and
|
|
99
|
+
# aliases. This endpoint does not return rates - use the dedicated getRates or
|
|
100
|
+
# getRateSchedule endpoints to understand the rates on a rate card.
|
|
67
101
|
sig do
|
|
68
102
|
params(
|
|
69
103
|
id: String,
|
|
@@ -75,7 +109,58 @@ module MetronomeSDK
|
|
|
75
109
|
def retrieve(id:, request_options: {})
|
|
76
110
|
end
|
|
77
111
|
|
|
78
|
-
# Update
|
|
112
|
+
# Update the metadata properties of an existing rate card, including its name,
|
|
113
|
+
# description, and aliases. This endpoint is designed for managing rate card
|
|
114
|
+
# identity and reference aliases rather than modifying pricing rates.
|
|
115
|
+
#
|
|
116
|
+
# Modifies the descriptive properties and alias configuration of a rate card
|
|
117
|
+
# without affecting the underlying pricing rates or schedules. This allows you to
|
|
118
|
+
# update how a rate card is identified and referenced throughout your system.
|
|
119
|
+
#
|
|
120
|
+
# ### Use this endpoint to:
|
|
121
|
+
#
|
|
122
|
+
# - Rate card renaming: Update display names or descriptions for organizational
|
|
123
|
+
# clarity
|
|
124
|
+
# - Alias management: Add, modify, or schedule alias transitions for seamless rate
|
|
125
|
+
# card migrations
|
|
126
|
+
# - Documentation updates: Keep rate card descriptions current with business
|
|
127
|
+
# context
|
|
128
|
+
# - Self-serve provisioning setup: Configure aliases to enable code-free rate card
|
|
129
|
+
# transitions
|
|
130
|
+
#
|
|
131
|
+
# #### Active contract impact:
|
|
132
|
+
#
|
|
133
|
+
# - Alias changes: Already-created contracts continue using their originally
|
|
134
|
+
# assigned rate cards.
|
|
135
|
+
# - Other changes made using this endpoint will only impact the Metronome UI.
|
|
136
|
+
#
|
|
137
|
+
# #### Grandfathering existing PLG customer pricing:
|
|
138
|
+
#
|
|
139
|
+
# - Rate card aliases support scheduled transitions, enabling seamless rate card
|
|
140
|
+
# migrations for new customers, allowing existing customers to be grandfathered
|
|
141
|
+
# into their existing prices without code. Note that there are multiple
|
|
142
|
+
# mechanisms to support grandfathering in Metronome.
|
|
143
|
+
#
|
|
144
|
+
# #### How scheduled aliases work for PLG grandfathering:
|
|
145
|
+
#
|
|
146
|
+
# Initial setup:
|
|
147
|
+
#
|
|
148
|
+
# - Add alias to current rate card: Assign a stable alias (e.g.,
|
|
149
|
+
# "standard-pricing") to your active rate card
|
|
150
|
+
# - Reference alias during contract creation: Configure your self-serve workflow
|
|
151
|
+
# to create contracts using `rate_card_alias` instead of direct `rate_card_id`
|
|
152
|
+
# - Automatic resolution: New contracts referencing the alias automatically
|
|
153
|
+
# resolve to the rate card associated with the alias at the point in time of
|
|
154
|
+
# provisioning
|
|
155
|
+
#
|
|
156
|
+
# #### Grandfathering process:
|
|
157
|
+
#
|
|
158
|
+
# - Create new rate card: Build your new rate card with updated pricing structure
|
|
159
|
+
# - Schedule alias transition: Add the same alias to the new rate card with a
|
|
160
|
+
# `starting_at` timestamp
|
|
161
|
+
# - Automatic cutover: Starting at the scheduled time, new contracts created in
|
|
162
|
+
# your PLG workflow using that alias will automatically reference the new rate
|
|
163
|
+
# card
|
|
79
164
|
sig do
|
|
80
165
|
params(
|
|
81
166
|
rate_card_id: String,
|
|
@@ -104,8 +189,9 @@ module MetronomeSDK
|
|
|
104
189
|
)
|
|
105
190
|
end
|
|
106
191
|
|
|
107
|
-
# List rate cards
|
|
108
|
-
# rate card
|
|
192
|
+
# List all rate cards. Returns rate card IDs, names, descriptions, aliases, and
|
|
193
|
+
# other details. To view the rates associated with a given rate card, use the
|
|
194
|
+
# getRates or getRateSchedule endpoints.
|
|
109
195
|
sig do
|
|
110
196
|
params(
|
|
111
197
|
limit: Integer,
|
|
@@ -129,7 +215,11 @@ module MetronomeSDK
|
|
|
129
215
|
)
|
|
130
216
|
end
|
|
131
217
|
|
|
132
|
-
#
|
|
218
|
+
# Permanently disable a rate card by archiving it, preventing use in new contracts
|
|
219
|
+
# while preserving existing contract pricing. Use this when retiring old pricing
|
|
220
|
+
# models, consolidating rate cards, or removing outdated pricing structures.
|
|
221
|
+
# Returns the archived rate card ID and stops the rate card from appearing in
|
|
222
|
+
# contract creation workflows.
|
|
133
223
|
sig do
|
|
134
224
|
params(
|
|
135
225
|
id: String,
|
|
@@ -141,8 +231,18 @@ module MetronomeSDK
|
|
|
141
231
|
def archive(id:, request_options: {})
|
|
142
232
|
end
|
|
143
233
|
|
|
144
|
-
#
|
|
145
|
-
#
|
|
234
|
+
# A rate card defines the prices that you charge for your products. Rate cards
|
|
235
|
+
# support scheduled changes over time, to allow you to easily roll out pricing
|
|
236
|
+
# changes and new product launches across your customer base. Use this endpoint to
|
|
237
|
+
# understand the rate schedule `starting_at` a given date, optionally filtering
|
|
238
|
+
# the list of rates returned based on product id or pricing group values. For
|
|
239
|
+
# example, you may want to display a schedule of upcoming price changes for a
|
|
240
|
+
# given product in your product experience - use this endpoint to fetch that
|
|
241
|
+
# information from its source of truth in Metronome.
|
|
242
|
+
#
|
|
243
|
+
# If you want to understand the rates for a specific customer's contract,
|
|
244
|
+
# inclusive of contract-level overrides, use the `getContractRateSchedule`
|
|
245
|
+
# endpoint.
|
|
146
246
|
sig do
|
|
147
247
|
params(
|
|
148
248
|
rate_card_id: String,
|
|
@@ -13,7 +13,129 @@ module MetronomeSDK
|
|
|
13
13
|
sig { returns(MetronomeSDK::Resources::V1::Contracts::NamedSchedules) }
|
|
14
14
|
attr_reader :named_schedules
|
|
15
15
|
|
|
16
|
-
#
|
|
16
|
+
# Contracts define a customer's products, pricing, discounts, access duration, and
|
|
17
|
+
# billing configuration. Contracts serve as the central billing agreement for both
|
|
18
|
+
# PLG and Enterprise customers, you can automatically customers access to your
|
|
19
|
+
# products and services directly from your product or CRM.
|
|
20
|
+
#
|
|
21
|
+
# ### Use this endpoint to:
|
|
22
|
+
#
|
|
23
|
+
# - PLG onboarding: Automatically provision new self-serve customers with
|
|
24
|
+
# contracts when they sign up.
|
|
25
|
+
# - Enterprise sales: Push negotiated contracts from Salesforce with custom
|
|
26
|
+
# pricing and commitments
|
|
27
|
+
# - Promotional pricing: Implement time-limited discounts and free trials through
|
|
28
|
+
# overrides
|
|
29
|
+
#
|
|
30
|
+
# ### Key components:
|
|
31
|
+
#
|
|
32
|
+
# #### Contract Term and Billing Schedule
|
|
33
|
+
#
|
|
34
|
+
# - Set contract duration using `starting_at` and `ending_before` fields. PLG
|
|
35
|
+
# contracts typically use perpetual agreements (no end date), while Enterprise
|
|
36
|
+
# contracts have fixed end dates which can be edited over time in the case of
|
|
37
|
+
# co-term upsells.
|
|
38
|
+
#
|
|
39
|
+
# #### Rate Card
|
|
40
|
+
#
|
|
41
|
+
# If you are offering usage based pricing, you can set a rate card for the
|
|
42
|
+
# contract to reference through `rate_card_id` or `rate_card_alias`. The rate card
|
|
43
|
+
# is a store of all of your usage based products and their centralized pricing.
|
|
44
|
+
# Any new products or price changes on the rate card can be set to automatically
|
|
45
|
+
# propagate to all associated contracts - this ensures consistent pricing and
|
|
46
|
+
# product launches flow to contracts without manual updates and migrations. The
|
|
47
|
+
# `usage_statement_schedule` determines the cadence on which Metronome will
|
|
48
|
+
# finalize a usage invoice for the customer. This defaults to monthly on the 1st,
|
|
49
|
+
# with options for custom dates, quarterly, or annual cadences. Note: Most usage
|
|
50
|
+
# based billing companies align usage statements to be evaluated aligned to the
|
|
51
|
+
# first of the month. Read more about
|
|
52
|
+
# [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).
|
|
53
|
+
#
|
|
54
|
+
# #### Overrides and discounts
|
|
55
|
+
#
|
|
56
|
+
# Customize pricing on the contract through time-bounded overrides that can target
|
|
57
|
+
# specific products, product families, or complex usage scenarios. Overrides
|
|
58
|
+
# enable two key capabilities:
|
|
59
|
+
#
|
|
60
|
+
# - Discounts: Apply percentage discounts, fixed rate reductions, or
|
|
61
|
+
# quantity-based pricing tiers
|
|
62
|
+
# - Entitlements: Provide special pricing or access to specific products for
|
|
63
|
+
# negotiated deals
|
|
64
|
+
#
|
|
65
|
+
# Read more about
|
|
66
|
+
# [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).
|
|
67
|
+
#
|
|
68
|
+
# #### Commits and Credits
|
|
69
|
+
#
|
|
70
|
+
# Using commits, configure prepaid or postpaid spending commitments where
|
|
71
|
+
# customers promise to spend a certain amount over the contract period paid in
|
|
72
|
+
# advance or in arrears. Use credits to provide free spending allowances. Under
|
|
73
|
+
# the hood these are the same mechanisms, however, credits are typically offered
|
|
74
|
+
# for free (SLA or promotional) or as a part of an allotment associated with a
|
|
75
|
+
# Subscription.
|
|
76
|
+
#
|
|
77
|
+
# In Metronome, you can set commits and credits to only be applicable for a subset
|
|
78
|
+
# of usage. Use `applicable_product_ids` or `applicable_product_tags` to create
|
|
79
|
+
# product or product-family specific commits or credits, or you can build complex
|
|
80
|
+
# boolean logic specifiers to target usage based on pricing and presentation group
|
|
81
|
+
# values using `override_specifiers`.
|
|
82
|
+
#
|
|
83
|
+
# These objects can also also be configured to have a recurrence schedule to
|
|
84
|
+
# easily model customer packaging which includes recurring monthly or quarterly
|
|
85
|
+
# allotments.
|
|
86
|
+
#
|
|
87
|
+
# Commits support rollover settings (`rollover_fraction`) to transfer unused
|
|
88
|
+
# balances between contract periods, either entirely or as a percentage.
|
|
89
|
+
#
|
|
90
|
+
# Read more about
|
|
91
|
+
# [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).
|
|
92
|
+
#
|
|
93
|
+
# #### Subscriptions
|
|
94
|
+
#
|
|
95
|
+
# You can add a fixed recurring charge to a contract, like monthly licenses or
|
|
96
|
+
# seat-based fees, using the subscription charge. Subscription charges are defined
|
|
97
|
+
# on your rate card and you can select which subscription is applicable to add to
|
|
98
|
+
# each contract. When you add a subscription to a contract you need to:
|
|
99
|
+
#
|
|
100
|
+
# - Define whether the subscription is paid for in-advance or in-arrears
|
|
101
|
+
# (`collection_schedule`)
|
|
102
|
+
# - Define the proration behavior (`proration`)
|
|
103
|
+
# - Specify an initial quantity (`initial_quantity`)
|
|
104
|
+
# - Define which subscription rate on the rate card should be used
|
|
105
|
+
# (`subscription_rate`)
|
|
106
|
+
#
|
|
107
|
+
# Read more about
|
|
108
|
+
# [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).
|
|
109
|
+
#
|
|
110
|
+
# #### Scheduled Charges
|
|
111
|
+
#
|
|
112
|
+
# Set up one-time, recurring, or entirely custom charges that occur on specific
|
|
113
|
+
# dates, separate from usage-based billing or commitments. These can be used to
|
|
114
|
+
# model non-recurring platform charges or professional services.
|
|
115
|
+
#
|
|
116
|
+
# #### Threshold Billing
|
|
117
|
+
#
|
|
118
|
+
# Metronome allows you to configure automatic billing triggers when customers
|
|
119
|
+
# reach spending thresholds to prevent fraud and manage risk. You can use
|
|
120
|
+
# `spend_threshold_configuration` to trigger an invoice to cover current charges
|
|
121
|
+
# whenever the threshold is reached or you can ensure the customer maintains a
|
|
122
|
+
# minimum prepaid balance using the `prepaid_balance_configuration`.
|
|
123
|
+
#
|
|
124
|
+
# Read more about
|
|
125
|
+
# [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/)
|
|
126
|
+
# and
|
|
127
|
+
# [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).
|
|
128
|
+
#
|
|
129
|
+
# ### Usage guidelines:
|
|
130
|
+
#
|
|
131
|
+
# - You can always
|
|
132
|
+
# [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/)
|
|
133
|
+
# after it has been created, using the `editContract` endpoint. Metronome keeps
|
|
134
|
+
# track of all edits, both in the audit log and over the `getEditHistory`
|
|
135
|
+
# endpoint.
|
|
136
|
+
# - Customers in Metronome can have multiple concurrent contracts at one time. Use
|
|
137
|
+
# `usage_filters` to route the correct usage to each contract.
|
|
138
|
+
# [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).
|
|
17
139
|
sig do
|
|
18
140
|
params(
|
|
19
141
|
customer_id: String,
|
|
@@ -42,7 +164,7 @@ module MetronomeSDK
|
|
|
42
164
|
MetronomeSDK::V1::ContractCreateParams::Override::OrHash
|
|
43
165
|
],
|
|
44
166
|
prepaid_balance_threshold_configuration:
|
|
45
|
-
MetronomeSDK::
|
|
167
|
+
MetronomeSDK::PrepaidBalanceThresholdConfiguration::OrHash,
|
|
46
168
|
priority: Float,
|
|
47
169
|
professional_services:
|
|
48
170
|
T::Array[
|
|
@@ -70,7 +192,7 @@ module MetronomeSDK
|
|
|
70
192
|
scheduled_charges_on_usage_invoices:
|
|
71
193
|
MetronomeSDK::V1::ContractCreateParams::ScheduledChargesOnUsageInvoices::OrSymbol,
|
|
72
194
|
spend_threshold_configuration:
|
|
73
|
-
MetronomeSDK::
|
|
195
|
+
MetronomeSDK::SpendThresholdConfiguration::OrHash,
|
|
74
196
|
subscriptions:
|
|
75
197
|
T::Array[
|
|
76
198
|
MetronomeSDK::V1::ContractCreateParams::Subscription::OrHash
|
|
@@ -94,6 +216,7 @@ module MetronomeSDK
|
|
|
94
216
|
billing_provider_configuration: nil,
|
|
95
217
|
commits: nil,
|
|
96
218
|
credits: nil,
|
|
219
|
+
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
97
220
|
custom_fields: nil,
|
|
98
221
|
# This field's availability is dependent on your client's configuration.
|
|
99
222
|
discounts: nil,
|
|
@@ -174,8 +297,13 @@ module MetronomeSDK
|
|
|
174
297
|
)
|
|
175
298
|
end
|
|
176
299
|
|
|
177
|
-
#
|
|
178
|
-
#
|
|
300
|
+
# Retrieves all contracts for a specific customer, including pricing, terms,
|
|
301
|
+
# credits, and commitments. Use this to view a customer's contract history and
|
|
302
|
+
# current agreements for billing management. Returns contract details with
|
|
303
|
+
# optional ledgers and balance information.
|
|
304
|
+
#
|
|
305
|
+
# ⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2
|
|
306
|
+
# endpoint for enhanced features.
|
|
179
307
|
sig do
|
|
180
308
|
params(
|
|
181
309
|
customer_id: String,
|
|
@@ -209,7 +337,24 @@ module MetronomeSDK
|
|
|
209
337
|
)
|
|
210
338
|
end
|
|
211
339
|
|
|
212
|
-
#
|
|
340
|
+
# Manually adjust the available balance on a commit or credit. This entry is
|
|
341
|
+
# appended to the commit ledger as a new event. Optionally include a description
|
|
342
|
+
# that provides the reasoning for the entry.
|
|
343
|
+
#
|
|
344
|
+
# ### Use this endpoint to:
|
|
345
|
+
#
|
|
346
|
+
# - Address incorrect usage burn-down caused by malformed usage or invalid config
|
|
347
|
+
# - Decrease available balance to account for outages where usage may have not
|
|
348
|
+
# been tracked or sent to Metronome
|
|
349
|
+
# - Issue credits to customers in the form of increased balance on existing commit
|
|
350
|
+
# or credit
|
|
351
|
+
#
|
|
352
|
+
# ### Usage guidelines:
|
|
353
|
+
#
|
|
354
|
+
# Manual ledger entries can be extremely useful for resolving discrepancies in
|
|
355
|
+
# Metronome. However, most corrections to inaccurate billings can be modified
|
|
356
|
+
# upstream of the commit, whether that is via contract editing, rate editing, or
|
|
357
|
+
# other actions that cause an invoice to be recalculated.
|
|
213
358
|
sig do
|
|
214
359
|
params(
|
|
215
360
|
id: String,
|
|
@@ -243,7 +388,7 @@ module MetronomeSDK
|
|
|
243
388
|
end
|
|
244
389
|
|
|
245
390
|
# Amendments will be replaced by Contract editing. New clients should implement
|
|
246
|
-
# using the editContract endpoint. Read more about the migration to contract
|
|
391
|
+
# using the `editContract` endpoint. Read more about the migration to contract
|
|
247
392
|
# editing [here](https://docs.metronome.com/migrate-amendments-to-edits/) and
|
|
248
393
|
# reach out to your Metronome representative for more details. Once contract
|
|
249
394
|
# editing is enabled, access to this endpoint will be removed.
|
|
@@ -288,6 +433,7 @@ module MetronomeSDK
|
|
|
288
433
|
starting_at:,
|
|
289
434
|
commits: nil,
|
|
290
435
|
credits: nil,
|
|
436
|
+
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
291
437
|
custom_fields: nil,
|
|
292
438
|
# This field's availability is dependent on your client's configuration.
|
|
293
439
|
discounts: nil,
|
|
@@ -307,7 +453,26 @@ module MetronomeSDK
|
|
|
307
453
|
)
|
|
308
454
|
end
|
|
309
455
|
|
|
310
|
-
#
|
|
456
|
+
# Permanently end and archive a contract along with all its terms. Any draft
|
|
457
|
+
# invoices will be canceled, and all upcoming scheduled invoices will be
|
|
458
|
+
# voided–also all finalized invoices can optionally be voided. Use this in the
|
|
459
|
+
# event a contract was incorrectly created and needed to be removed from a
|
|
460
|
+
# customer.
|
|
461
|
+
#
|
|
462
|
+
# #### Impact on commits and credits:
|
|
463
|
+
#
|
|
464
|
+
# When archiving a contract, all associated commits and credits are also archived.
|
|
465
|
+
# For prepaid commits with active segments, Metronome automatically generates
|
|
466
|
+
# expiration ledger entries to close out any remaining balances, ensuring accurate
|
|
467
|
+
# accounting of unused prepaid amounts. These ledger entries will appear in the
|
|
468
|
+
# commit's transaction history with type `PREPAID_COMMIT_EXPIRATION`.
|
|
469
|
+
#
|
|
470
|
+
# #### Archived contract visibility:
|
|
471
|
+
#
|
|
472
|
+
# Archived contracts remain accessible for historical reporting and audit
|
|
473
|
+
# purposes. They can be retrieved using the `ListContracts` endpoint by setting
|
|
474
|
+
# the `include_archived` parameter to `true` or in the Metronome UI when the "Show
|
|
475
|
+
# archived" option is enabled.
|
|
311
476
|
sig do
|
|
312
477
|
params(
|
|
313
478
|
contract_id: String,
|
|
@@ -328,7 +493,11 @@ module MetronomeSDK
|
|
|
328
493
|
)
|
|
329
494
|
end
|
|
330
495
|
|
|
331
|
-
#
|
|
496
|
+
# Create historical usage invoices for past billing periods on specific contracts.
|
|
497
|
+
# Use this endpoint to generate retroactive invoices with custom usage line items,
|
|
498
|
+
# quantities, and date ranges. Supports preview mode to validate invoice data
|
|
499
|
+
# before creation. Ideal for billing migrations or correcting past billing
|
|
500
|
+
# periods.
|
|
332
501
|
sig do
|
|
333
502
|
params(
|
|
334
503
|
invoices:
|
|
@@ -344,7 +513,40 @@ module MetronomeSDK
|
|
|
344
513
|
def create_historical_invoices(invoices:, preview:, request_options: {})
|
|
345
514
|
end
|
|
346
515
|
|
|
347
|
-
#
|
|
516
|
+
# Retrieve a comprehensive view of all available balances (commits and credits)
|
|
517
|
+
# for a customer. This endpoint provides real-time visibility into prepaid funds,
|
|
518
|
+
# postpaid commitments, promotional credits, and other balance types that can
|
|
519
|
+
# offset usage charges, helping you build transparent billing experiences.
|
|
520
|
+
#
|
|
521
|
+
# ### Use this endpoint to:
|
|
522
|
+
#
|
|
523
|
+
# - Display current available balances in customer dashboards
|
|
524
|
+
# - Verify available funds before approving high-usage operations
|
|
525
|
+
# - Generate balance reports for finance teams
|
|
526
|
+
# - Filter balances by contract or date ranges
|
|
527
|
+
#
|
|
528
|
+
# ### Key response fields:
|
|
529
|
+
#
|
|
530
|
+
# An array of balance objects (all credits and commits) containing:
|
|
531
|
+
#
|
|
532
|
+
# - Balance details: Current available amount for each commit or credit
|
|
533
|
+
# - Metadata: Product associations, priorities, applicable date ranges
|
|
534
|
+
# - Optional ledger entries: Detailed transaction history (if
|
|
535
|
+
# `include_ledgers=true`)
|
|
536
|
+
# - Balance calculations: Including pending transactions and future-dated entries
|
|
537
|
+
# - Custom fields: Any additional metadata attached to balances
|
|
538
|
+
#
|
|
539
|
+
# ### Usage guidelines:
|
|
540
|
+
#
|
|
541
|
+
# - Date filtering: Use `effective_before` to include only balances with access
|
|
542
|
+
# before a specific date (exclusive)
|
|
543
|
+
# - Set `include_balance=true` for calculated balance amounts on each commit or
|
|
544
|
+
# credit
|
|
545
|
+
# - Set `include_ledgers=true` for full transaction history
|
|
546
|
+
# - Set `include_contract_balances = true` to see contract level balances
|
|
547
|
+
# - Balance logic: Reflects currently accessible amounts, excluding expired/future
|
|
548
|
+
# segments
|
|
549
|
+
# - Manual adjustments: Includes all manual ledger entries, even future-dated ones
|
|
348
550
|
sig do
|
|
349
551
|
params(
|
|
350
552
|
customer_id: String,
|
|
@@ -359,7 +561,11 @@ module MetronomeSDK
|
|
|
359
561
|
next_page: String,
|
|
360
562
|
starting_at: Time,
|
|
361
563
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
362
|
-
).returns(
|
|
564
|
+
).returns(
|
|
565
|
+
MetronomeSDK::Internal::BodyCursorPage[
|
|
566
|
+
MetronomeSDK::Models::V1::ContractListBalancesResponse::Variants
|
|
567
|
+
]
|
|
568
|
+
)
|
|
363
569
|
end
|
|
364
570
|
def list_balances(
|
|
365
571
|
customer_id:,
|
|
@@ -388,7 +594,13 @@ module MetronomeSDK
|
|
|
388
594
|
)
|
|
389
595
|
end
|
|
390
596
|
|
|
391
|
-
#
|
|
597
|
+
# For a specific customer and contract, get the rates at a specific point in time.
|
|
598
|
+
# This endpoint takes the contract's rate card into consideration, including
|
|
599
|
+
# scheduled changes. It also takes into account overrides on the contract.
|
|
600
|
+
#
|
|
601
|
+
# For example, if you want to show your customer a summary of the prices they are
|
|
602
|
+
# paying, inclusive of any negotiated discounts or promotions, use this endpoint.
|
|
603
|
+
# This endpoint only returns rates that are entitled.
|
|
392
604
|
sig do
|
|
393
605
|
params(
|
|
394
606
|
contract_id: String,
|
|
@@ -425,8 +637,16 @@ module MetronomeSDK
|
|
|
425
637
|
)
|
|
426
638
|
end
|
|
427
639
|
|
|
428
|
-
#
|
|
429
|
-
#
|
|
640
|
+
# Get the history of subscription quantities and prices over time for a given
|
|
641
|
+
# `subscription_id`. This endpoint can be used to power an in-product experience
|
|
642
|
+
# where you show a customer their historical changes to seat count. Future changes
|
|
643
|
+
# are not included in this endpoint - use the `getContract` endpoint to view the
|
|
644
|
+
# future scheduled changes to a subscription's quantity.
|
|
645
|
+
#
|
|
646
|
+
# Subscriptions are used to model fixed recurring fees as well as seat-based
|
|
647
|
+
# recurring fees. To model changes to the number of seats in Metronome, you can
|
|
648
|
+
# increment or decrement the quantity on a subscription at any point in the past
|
|
649
|
+
# or future.
|
|
430
650
|
sig do
|
|
431
651
|
params(
|
|
432
652
|
contract_id: String,
|
|
@@ -478,7 +698,24 @@ module MetronomeSDK
|
|
|
478
698
|
)
|
|
479
699
|
end
|
|
480
700
|
|
|
481
|
-
#
|
|
701
|
+
# If a customer has multiple contracts with overlapping rates, the usage filter
|
|
702
|
+
# routes usage to the appropriate contract based on a predefined group key.
|
|
703
|
+
#
|
|
704
|
+
# As an example, imagine you have a customer associated with two projects. Each
|
|
705
|
+
# project is associated with its own contract. You can create a usage filter with
|
|
706
|
+
# group key `project_id` on each contract, and route usage for `project_1` to the
|
|
707
|
+
# first contract and `project_2` to the second contract.
|
|
708
|
+
#
|
|
709
|
+
# ### Use this endpoint to:
|
|
710
|
+
#
|
|
711
|
+
# - Support enterprise contracting scenarios where multiple contracts are
|
|
712
|
+
# associated to the same customer with the same rates.
|
|
713
|
+
# - Update the usage filter associated with the contract over time.
|
|
714
|
+
#
|
|
715
|
+
# ### Usage guidelines:
|
|
716
|
+
#
|
|
717
|
+
# To use usage filters, the `group_key` must be defined on the billable metrics
|
|
718
|
+
# underlying the rate card on the contracts.
|
|
482
719
|
sig do
|
|
483
720
|
params(
|
|
484
721
|
contract_id: String,
|
|
@@ -499,7 +736,12 @@ module MetronomeSDK
|
|
|
499
736
|
)
|
|
500
737
|
end
|
|
501
738
|
|
|
502
|
-
# Update
|
|
739
|
+
# Update or add an end date to a contract. Ending a contract early will impact
|
|
740
|
+
# draft usage statements, truncate any terms, and remove upcoming scheduled
|
|
741
|
+
# invoices. Moving the date into the future will only extend the contract length.
|
|
742
|
+
# Terms and scheduled invoices are not extended. In-advance subscriptions will not
|
|
743
|
+
# be extended. Use this if a contract's end date has changed or if a perpetual
|
|
744
|
+
# contract ends.
|
|
503
745
|
sig do
|
|
504
746
|
params(
|
|
505
747
|
contract_id: String,
|
|
@@ -141,7 +141,11 @@ module MetronomeSDK
|
|
|
141
141
|
ending_before: Time,
|
|
142
142
|
starting_on: Time,
|
|
143
143
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
144
|
-
).returns(
|
|
144
|
+
).returns(
|
|
145
|
+
MetronomeSDK::Internal::CursorPageWithoutLimit[
|
|
146
|
+
MetronomeSDK::Models::V1::CreditGrantListEntriesResponse
|
|
147
|
+
]
|
|
148
|
+
)
|
|
145
149
|
end
|
|
146
150
|
def list_entries(
|
|
147
151
|
# Query param: Cursor that indicates where the next page of results should start.
|