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
|
@@ -5,7 +5,46 @@ module MetronomeSDK
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class Invoices
|
|
8
|
-
#
|
|
8
|
+
# Retrieve detailed information for a specific invoice by its unique identifier.
|
|
9
|
+
# This endpoint returns comprehensive invoice data including line items, applied
|
|
10
|
+
# credits, totals, and billing period details for both finalized and draft
|
|
11
|
+
# invoices.
|
|
12
|
+
#
|
|
13
|
+
# ### Use this endpoint to:
|
|
14
|
+
#
|
|
15
|
+
# - Display historical invoice details in customer-facing dashboards or billing
|
|
16
|
+
# portals.
|
|
17
|
+
# - Retrieve current month draft invoices to show customers their month-to-date
|
|
18
|
+
# spend.
|
|
19
|
+
# - Access finalized invoices for historical billing records and payment
|
|
20
|
+
# reconciliation.
|
|
21
|
+
# - Validate customer pricing and credit applications for customer support
|
|
22
|
+
# queries.
|
|
23
|
+
#
|
|
24
|
+
# ### Key response fields:
|
|
25
|
+
#
|
|
26
|
+
# Invoice status (DRAFT, FINALIZED, VOID) Billing period start and end dates Total
|
|
27
|
+
# amount and amount due after credits Detailed line items broken down by:
|
|
28
|
+
#
|
|
29
|
+
# - Customer and contract information
|
|
30
|
+
# - Invoice line item type
|
|
31
|
+
# - Product/service name and ID
|
|
32
|
+
# - Quantity consumed
|
|
33
|
+
# - Unit and total price
|
|
34
|
+
# - Time period for usage-based charges
|
|
35
|
+
# - Applied credits or prepaid commitments
|
|
36
|
+
#
|
|
37
|
+
# ### Usage guidelines:
|
|
38
|
+
#
|
|
39
|
+
# - Draft invoices update in real-time as usage is reported and may change before
|
|
40
|
+
# finalization
|
|
41
|
+
# - The response includes both usage-based line items (e.g., API calls, data
|
|
42
|
+
# processed) and scheduled charges (e.g., monthly subscriptions, commitment
|
|
43
|
+
# fees)
|
|
44
|
+
# - Credit and commitment applications are shown as separate line items with
|
|
45
|
+
# negative amounts
|
|
46
|
+
# - For voided invoices, the response will indicate VOID status but retain all
|
|
47
|
+
# original line item details
|
|
9
48
|
sig do
|
|
10
49
|
params(
|
|
11
50
|
customer_id: String,
|
|
@@ -28,8 +67,52 @@ module MetronomeSDK
|
|
|
28
67
|
)
|
|
29
68
|
end
|
|
30
69
|
|
|
31
|
-
#
|
|
32
|
-
# range,
|
|
70
|
+
# Retrieves a paginated list of invoices for a specific customer, with flexible
|
|
71
|
+
# filtering options to narrow results by status, date range, credit type, and
|
|
72
|
+
# more. This endpoint provides a comprehensive view of a customer's billing
|
|
73
|
+
# history and current charges, supporting both real-time billing dashboards and
|
|
74
|
+
# historical reporting needs.
|
|
75
|
+
#
|
|
76
|
+
# ### Use this endpoint to:
|
|
77
|
+
#
|
|
78
|
+
# - Display historical invoice details in customer-facing dashboards or billing
|
|
79
|
+
# portals.
|
|
80
|
+
# - Retrieve current month draft invoices to show customers their month-to-date
|
|
81
|
+
# spend.
|
|
82
|
+
# - Access finalized invoices for historical billing records and payment
|
|
83
|
+
# reconciliation.
|
|
84
|
+
# - Validate customer pricing and credit applications for customer support
|
|
85
|
+
# queries.
|
|
86
|
+
# - Generate financial reports by filtering invoices within specific date ranges
|
|
87
|
+
#
|
|
88
|
+
# ### Key response fields:
|
|
89
|
+
#
|
|
90
|
+
# Array of invoice objects containing:
|
|
91
|
+
#
|
|
92
|
+
# - Invoice ID and status (DRAFT, FINALIZED, VOID)
|
|
93
|
+
# - Invoice type (USAGE, SCHEDULED)
|
|
94
|
+
# - Billing period start and end dates
|
|
95
|
+
# - Issue date and due date
|
|
96
|
+
# - Total amount, subtotal, and amount due
|
|
97
|
+
# - Applied credits summary
|
|
98
|
+
# - Contract ID reference
|
|
99
|
+
# - External billing provider status (if integrated with Stripe, etc.)
|
|
100
|
+
# - Pagination metadata `next_page` cursor
|
|
101
|
+
#
|
|
102
|
+
# ### Usage guidelines:
|
|
103
|
+
#
|
|
104
|
+
# - The endpoint returns invoice summaries; use the Get Invoice endpoint for
|
|
105
|
+
# detailed line items
|
|
106
|
+
# - Draft invoices are continuously updated as new usage is reported and will show
|
|
107
|
+
# real-time spend
|
|
108
|
+
# - Results are ordered by creation date descending by default (newest first)
|
|
109
|
+
# - When filtering by date range, the filter applies to the billing period, not
|
|
110
|
+
# the issue date
|
|
111
|
+
# - For customers with many invoices, implement pagination to ensure all results
|
|
112
|
+
# are retrieved External billing provider statuses (like Stripe payment status)
|
|
113
|
+
# are included when applicable
|
|
114
|
+
# - Voided invoices are included in results by default unless filtered out by
|
|
115
|
+
# status
|
|
33
116
|
sig do
|
|
34
117
|
params(
|
|
35
118
|
customer_id: String,
|
|
@@ -113,11 +196,44 @@ module MetronomeSDK
|
|
|
113
196
|
)
|
|
114
197
|
end
|
|
115
198
|
|
|
116
|
-
#
|
|
117
|
-
#
|
|
199
|
+
# Retrieve granular time-series breakdowns of invoice data at hourly or daily
|
|
200
|
+
# intervals. This endpoint transforms standard invoices into detailed timelines,
|
|
201
|
+
# enabling you to track usage patterns, identify consumption spikes, and provide
|
|
202
|
+
# customers with transparency into their billing details throughout the billing
|
|
203
|
+
# period.
|
|
204
|
+
#
|
|
205
|
+
# ### Use this endpoint to:
|
|
206
|
+
#
|
|
207
|
+
# - Build usage analytics dashboards showing daily or hourly consumption trends
|
|
208
|
+
# - Identify peak usage periods for capacity planning and cost optimization
|
|
209
|
+
# - Generate detailed billing reports for finance teams and customer success
|
|
210
|
+
# - Troubleshoot billing disputes by examining usage patterns at specific times
|
|
211
|
+
# - Power real-time cost monitoring and alerting systems
|
|
212
|
+
#
|
|
213
|
+
# ### Key response fields:
|
|
118
214
|
#
|
|
119
|
-
#
|
|
120
|
-
#
|
|
215
|
+
# An array of BreakdownInvoice objects, each containing:
|
|
216
|
+
#
|
|
217
|
+
# - All standard invoice fields (ID, customer, commit, line items, totals, status)
|
|
218
|
+
# - Line items with quantities and costs for that specific period
|
|
219
|
+
# - `breakdown_start_timestamp`: Start of the specific time window
|
|
220
|
+
# - `breakdown_end_timestamp`: End of the specific time window
|
|
221
|
+
# - `next_page`: Pagination cursor for large result sets
|
|
222
|
+
#
|
|
223
|
+
# ### Usage guidelines:
|
|
224
|
+
#
|
|
225
|
+
# - Time granularity: Set `window_size` to hour or day based on your analysis
|
|
226
|
+
# needs
|
|
227
|
+
# - Response limits: Daily breakdowns return up to 35 days; hourly breakdowns
|
|
228
|
+
# return up to 24 hours per request
|
|
229
|
+
# - Date filtering: Use `starting_on` and `ending_before` to focus on specific
|
|
230
|
+
# periods
|
|
231
|
+
# - Performance: For large date ranges, use pagination to retrieve all data
|
|
232
|
+
# efficiently
|
|
233
|
+
# - Backdated usage: If usage events arrive after invoice finalization, breakdowns
|
|
234
|
+
# will reflect the updated usage
|
|
235
|
+
# - Zero quantity filtering: Use `skip_zero_qty_line_items=true` to exclude
|
|
236
|
+
# periods with no usage
|
|
121
237
|
sig do
|
|
122
238
|
params(
|
|
123
239
|
customer_id: String,
|
|
@@ -171,6 +287,42 @@ module MetronomeSDK
|
|
|
171
287
|
)
|
|
172
288
|
end
|
|
173
289
|
|
|
290
|
+
# Retrieve a PDF version of a specific invoice by its unique identifier. This
|
|
291
|
+
# endpoint generates a professionally formatted invoice document suitable for
|
|
292
|
+
# sharing with customers, accounting teams, or for record-keeping purposes.
|
|
293
|
+
#
|
|
294
|
+
# ### Use this endpoint to:
|
|
295
|
+
#
|
|
296
|
+
# - Provide customers with downloadable or emailable copies of their invoices
|
|
297
|
+
# - Support accounting and finance teams with official billing documents
|
|
298
|
+
# - Maintain accurate records of billing transactions for audits and compliance
|
|
299
|
+
#
|
|
300
|
+
# ### Key response details:
|
|
301
|
+
#
|
|
302
|
+
# - The response is a binary PDF file representing the full invoice
|
|
303
|
+
# - The PDF includes all standard invoice information such as line items, totals,
|
|
304
|
+
# billing period, and customer details
|
|
305
|
+
# - The document is formatted for clarity and professionalism, suitable for
|
|
306
|
+
# official use
|
|
307
|
+
#
|
|
308
|
+
# ### Usage guidelines:
|
|
309
|
+
#
|
|
310
|
+
# - Ensure the `invoice_id` corresponds to an existing invoice for the specified
|
|
311
|
+
# `customer_id`
|
|
312
|
+
# - The PDF is generated on-demand; frequent requests for the same invoice may
|
|
313
|
+
# impact performance
|
|
314
|
+
# - Use appropriate headers to handle the binary response in your application
|
|
315
|
+
# (e.g., setting `Content-Type: application/pdf`)
|
|
316
|
+
sig do
|
|
317
|
+
params(
|
|
318
|
+
customer_id: String,
|
|
319
|
+
invoice_id: String,
|
|
320
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
321
|
+
).returns(StringIO)
|
|
322
|
+
end
|
|
323
|
+
def retrieve_pdf(customer_id:, invoice_id:, request_options: {})
|
|
324
|
+
end
|
|
325
|
+
|
|
174
326
|
# @api private
|
|
175
327
|
sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
|
|
176
328
|
def self.new(client:)
|
|
@@ -25,7 +25,40 @@ module MetronomeSDK
|
|
|
25
25
|
sig { returns(MetronomeSDK::Resources::V1::Customers::NamedSchedules) }
|
|
26
26
|
attr_reader :named_schedules
|
|
27
27
|
|
|
28
|
-
# Create a new customer
|
|
28
|
+
# Create a new customer in Metronome and optionally the billing configuration
|
|
29
|
+
# (recommended) which dictates where invoices for the customer will be sent or
|
|
30
|
+
# where payment will be collected.
|
|
31
|
+
#
|
|
32
|
+
# ### Use this endpoint to:
|
|
33
|
+
#
|
|
34
|
+
# Execute your customer provisioning workflows for either PLG motions, where
|
|
35
|
+
# customers originate in your platform, or SLG motions, where customers originate
|
|
36
|
+
# in your sales system.
|
|
37
|
+
#
|
|
38
|
+
# ### Key response fields:
|
|
39
|
+
#
|
|
40
|
+
# This end-point returns the `customer_id` created by the request. This id can be
|
|
41
|
+
# used to fetch relevant billing configurations and create contracts.
|
|
42
|
+
#
|
|
43
|
+
# ### Example workflow:
|
|
44
|
+
#
|
|
45
|
+
# - Generally, Metronome recommends first creating the customer in the downstream
|
|
46
|
+
# payment / ERP system when payment method is collected and then creating the
|
|
47
|
+
# customer in Metronome using the response (i.e. `customer_id`) from the
|
|
48
|
+
# downstream system. If you do not create a billing configuration on customer
|
|
49
|
+
# creation, you can add it later.
|
|
50
|
+
# - Once a customer is created, you can then create a contract for the customer.
|
|
51
|
+
# In the contract creation process, you will need to add the customer billing
|
|
52
|
+
# configuration to the contract to ensure Metronome invoices the customer
|
|
53
|
+
# correctly. This is because a customer can have multiple configurations.
|
|
54
|
+
# - As part of the customer creation process, set the ingest alias for the
|
|
55
|
+
# customer which will ensure usage is accurately mapped to the customer. Ingest
|
|
56
|
+
# aliases can be added or changed after the creation process as well.
|
|
57
|
+
#
|
|
58
|
+
# ### Usage guidelines:
|
|
59
|
+
#
|
|
60
|
+
# For details on different billing configurations for different systems, review
|
|
61
|
+
# the `/setCustomerBillingConfiguration` end-point.
|
|
29
62
|
sig do
|
|
30
63
|
params(
|
|
31
64
|
name: String,
|
|
@@ -45,6 +78,7 @@ module MetronomeSDK
|
|
|
45
78
|
# This will be truncated to 160 characters if the provided name is longer.
|
|
46
79
|
name:,
|
|
47
80
|
billing_config: nil,
|
|
81
|
+
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
48
82
|
custom_fields: nil,
|
|
49
83
|
customer_billing_provider_configurations: nil,
|
|
50
84
|
# (deprecated, use ingest_aliases instead) an alias that can be used to refer to
|
|
@@ -56,7 +90,13 @@ module MetronomeSDK
|
|
|
56
90
|
)
|
|
57
91
|
end
|
|
58
92
|
|
|
59
|
-
# Get a customer by Metronome ID.
|
|
93
|
+
# Get detailed information for a specific customer by their Metronome ID. Returns
|
|
94
|
+
# customer profile data including name, creation date, ingest aliases,
|
|
95
|
+
# configuration settings, and custom fields. Use this endpoint to fetch complete
|
|
96
|
+
# customer details for billing operations or account management.
|
|
97
|
+
#
|
|
98
|
+
# Note: If searching for a customer billing configuration, use the
|
|
99
|
+
# `/getCustomerBillingConfigurations` endpoint.
|
|
60
100
|
sig do
|
|
61
101
|
params(
|
|
62
102
|
customer_id: String,
|
|
@@ -66,7 +106,11 @@ module MetronomeSDK
|
|
|
66
106
|
def retrieve(customer_id:, request_options: {})
|
|
67
107
|
end
|
|
68
108
|
|
|
69
|
-
#
|
|
109
|
+
# Gets a paginated list of all customers in your Metronome account. Use this
|
|
110
|
+
# endpoint to browse your customer base, implement customer search functionality,
|
|
111
|
+
# or sync customer data with external systems. Returns customer details including
|
|
112
|
+
# IDs, names, and configuration settings. Supports filtering and pagination
|
|
113
|
+
# parameters for efficient data retrieval.
|
|
70
114
|
sig do
|
|
71
115
|
params(
|
|
72
116
|
customer_ids: T::Array[String],
|
|
@@ -99,8 +143,20 @@ module MetronomeSDK
|
|
|
99
143
|
)
|
|
100
144
|
end
|
|
101
145
|
|
|
102
|
-
#
|
|
103
|
-
#
|
|
146
|
+
# Use this endpoint to archive a customer while preserving auditability. Archiving
|
|
147
|
+
# a customer will automatically archive all contracts as of the current date and
|
|
148
|
+
# void all corresponding invoices. Use this endpoint if a customer is onboarded by
|
|
149
|
+
# mistake.
|
|
150
|
+
#
|
|
151
|
+
# ### Usage guidelines:
|
|
152
|
+
#
|
|
153
|
+
# - Once a customer is archived, it cannot be unarchived.
|
|
154
|
+
# - Archived customers can still be viewed through the API or the UI for audit
|
|
155
|
+
# purposes.
|
|
156
|
+
# - Ingest aliases remain idempotent for archived customers. In order to reuse an
|
|
157
|
+
# ingest alias, first remove the ingest alias from the customer prior to
|
|
158
|
+
# archiving.
|
|
159
|
+
# - Any notifications associated with the customer will no longer be triggered.
|
|
104
160
|
sig do
|
|
105
161
|
params(
|
|
106
162
|
id: String,
|
|
@@ -110,7 +166,10 @@ module MetronomeSDK
|
|
|
110
166
|
def archive(id:, request_options: {})
|
|
111
167
|
end
|
|
112
168
|
|
|
113
|
-
# Get all billable metrics for a
|
|
169
|
+
# Get all billable metrics available for a specific customer. Supports pagination
|
|
170
|
+
# and filtering by current plan status or archived metrics. Use this endpoint to
|
|
171
|
+
# see which metrics are being tracked for billing calculations for a given
|
|
172
|
+
# customer.
|
|
114
173
|
sig do
|
|
115
174
|
params(
|
|
116
175
|
customer_id: String,
|
|
@@ -173,10 +232,10 @@ module MetronomeSDK
|
|
|
173
232
|
)
|
|
174
233
|
end
|
|
175
234
|
|
|
176
|
-
# Preview how a set of events will affect a customer's
|
|
177
|
-
#
|
|
235
|
+
# Preview how a set of events will affect a customer's invoices. Generates draft
|
|
236
|
+
# invoices for a customer using their current contract configuration and the
|
|
178
237
|
# provided events. This is useful for testing how new events will affect the
|
|
179
|
-
# customer's
|
|
238
|
+
# customer's invoices before they are actually processed.
|
|
180
239
|
sig do
|
|
181
240
|
params(
|
|
182
241
|
customer_id: String,
|
|
@@ -206,9 +265,91 @@ module MetronomeSDK
|
|
|
206
265
|
)
|
|
207
266
|
end
|
|
208
267
|
|
|
209
|
-
#
|
|
210
|
-
#
|
|
211
|
-
#
|
|
268
|
+
# Returns all billing configurations previously set for the customer. Use during
|
|
269
|
+
# the contract provisioning process to fetch the
|
|
270
|
+
# `billing_provider_configuration_id` needed to set the contract billing
|
|
271
|
+
# configuration.
|
|
272
|
+
sig do
|
|
273
|
+
params(
|
|
274
|
+
customer_id: String,
|
|
275
|
+
include_archived: T::Boolean,
|
|
276
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
277
|
+
).returns(
|
|
278
|
+
MetronomeSDK::Models::V1::CustomerRetrieveBillingConfigurationsResponse
|
|
279
|
+
)
|
|
280
|
+
end
|
|
281
|
+
def retrieve_billing_configurations(
|
|
282
|
+
customer_id:,
|
|
283
|
+
include_archived: nil,
|
|
284
|
+
request_options: {}
|
|
285
|
+
)
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Create a billing configuration for a customer. Once created, these
|
|
289
|
+
# configurations are available to associate to a contract and dictates which
|
|
290
|
+
# downstream system to collect payment in or send the invoice to. You can create
|
|
291
|
+
# multiple configurations per customer. The configuration formats are distinct for
|
|
292
|
+
# each downstream provider.
|
|
293
|
+
#
|
|
294
|
+
# ### Use this endpoint to:
|
|
295
|
+
#
|
|
296
|
+
# - Add the initial configuration to an existing customer. Once created, the
|
|
297
|
+
# billing configuration can then be associated to the customer's contract.
|
|
298
|
+
# - Add a new configuration to an existing customer. This might be used as part of
|
|
299
|
+
# an upgrade or downgrade workflow where the customer was previously billed
|
|
300
|
+
# through system A (e.g. Stripe) but will now be billed through system B (e.g.
|
|
301
|
+
# AWS). Once created, the new configuration can then be associated to the
|
|
302
|
+
# customer's contract.
|
|
303
|
+
# - Multiple configurations can be added per destination. For example, you can
|
|
304
|
+
# create two Stripe billing configurations for a Metronome customer that each
|
|
305
|
+
# have a distinct `collection_method`.
|
|
306
|
+
#
|
|
307
|
+
# ### Delivery method options:
|
|
308
|
+
#
|
|
309
|
+
# - `direct_to_billing_provider`: Use when Metronome should send invoices directly
|
|
310
|
+
# to the billing provider's API (e.g., Stripe, NetSuite). This is the most
|
|
311
|
+
# common method for automated billing workflows.
|
|
312
|
+
# - `tackle`: Use specifically for AWS Marketplace transactions that require
|
|
313
|
+
# Tackle's co-selling platform for partner attribution and commission tracking.
|
|
314
|
+
# - `aws_sqs`: Use when you want invoice data delivered to an AWS SQS queue for
|
|
315
|
+
# custom processing before sending to your billing system.
|
|
316
|
+
# - `aws_sns`: Use when you want invoice notifications published to an AWS SNS
|
|
317
|
+
# topic for event-driven billing workflows.
|
|
318
|
+
#
|
|
319
|
+
# ### Key response fields:
|
|
320
|
+
#
|
|
321
|
+
# The id for the customer billing configuration. This id can be used to associate
|
|
322
|
+
# the billing configuration to a contract.
|
|
323
|
+
#
|
|
324
|
+
# ### Usage guidelines:
|
|
325
|
+
#
|
|
326
|
+
# Must use the `delivery_method_id` if you have multiple Stripe accounts connected
|
|
327
|
+
# to Metronome.
|
|
328
|
+
sig do
|
|
329
|
+
params(
|
|
330
|
+
data:
|
|
331
|
+
T::Array[
|
|
332
|
+
MetronomeSDK::V1::CustomerSetBillingConfigurationsParams::Data::OrHash
|
|
333
|
+
],
|
|
334
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
335
|
+
).void
|
|
336
|
+
end
|
|
337
|
+
def set_billing_configurations(data:, request_options: {})
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
# Sets the ingest aliases for a customer. Use this endpoint to associate a
|
|
341
|
+
# Metronome customer with an internal ID for easier tracking between systems.
|
|
342
|
+
# Ingest aliases can be used in the `customer_id` field when sending usage events
|
|
343
|
+
# to Metronome.
|
|
344
|
+
#
|
|
345
|
+
# ### Usage guidelines:
|
|
346
|
+
#
|
|
347
|
+
# - This call is idempotent and fully replaces the set of ingest aliases for the
|
|
348
|
+
# given customer.
|
|
349
|
+
# - Switching an ingest alias from one customer to another will associate all
|
|
350
|
+
# corresponding usage to the new customer.
|
|
351
|
+
# - Use multiple ingest aliases to model child organizations within a single
|
|
352
|
+
# Metronome customer.
|
|
212
353
|
sig do
|
|
213
354
|
params(
|
|
214
355
|
customer_id: String,
|
|
@@ -225,7 +366,11 @@ module MetronomeSDK
|
|
|
225
366
|
)
|
|
226
367
|
end
|
|
227
368
|
|
|
228
|
-
# Updates the
|
|
369
|
+
# Updates the display name for a customer record. Use this to correct customer
|
|
370
|
+
# names, update business names after rebranding, or maintain accurate customer
|
|
371
|
+
# information for invoicing and reporting. Returns the updated customer object
|
|
372
|
+
# with the new name applied immediately across all billing documents and
|
|
373
|
+
# interfaces.
|
|
229
374
|
sig do
|
|
230
375
|
params(
|
|
231
376
|
customer_id: String,
|
|
@@ -243,7 +388,10 @@ module MetronomeSDK
|
|
|
243
388
|
)
|
|
244
389
|
end
|
|
245
390
|
|
|
246
|
-
#
|
|
391
|
+
# Update configuration settings for a specific customer, such as external system
|
|
392
|
+
# integrations (e.g., Salesforce account ID) and other customer-specific billing
|
|
393
|
+
# parameters. Use this endpoint to modify customer configurations without
|
|
394
|
+
# affecting core customer data like name or ingest aliases.
|
|
247
395
|
sig do
|
|
248
396
|
params(
|
|
249
397
|
customer_id: String,
|
|
@@ -4,9 +4,35 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Dashboards
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
7
|
+
# Generate secure, embeddable dashboard URLs that allow you to seamlessly
|
|
8
|
+
# integrate Metronome's billing visualizations directly into your application.
|
|
9
|
+
# This endpoint creates authenticated iframe-ready URLs for customer-specific
|
|
10
|
+
# dashboards, providing a white-labeled billing experience without building custom
|
|
11
|
+
# UI.
|
|
12
|
+
#
|
|
13
|
+
# ### Use this endpoint to:
|
|
14
|
+
#
|
|
15
|
+
# - Embed billing dashboards directly in your customer portal or admin interface
|
|
16
|
+
# - Provide self-service access to invoices, usage data, and credit balances
|
|
17
|
+
# - Build white-labeled billing experiences with minimal development effort
|
|
18
|
+
#
|
|
19
|
+
# ### Key response fields:
|
|
20
|
+
#
|
|
21
|
+
# - A secure, time-limited URL that can be embedded in an iframe
|
|
22
|
+
# - The URL includes authentication tokens and configuration parameters
|
|
23
|
+
# - URLs are customer-specific and respect your security settings
|
|
24
|
+
#
|
|
25
|
+
# ### Usage guidelines:
|
|
26
|
+
#
|
|
27
|
+
# - Dashboard types: Choose from `invoices`, `usage`, or `commits_and_credits`
|
|
28
|
+
# - Customization options:
|
|
29
|
+
# - `dashboard_options`: Configure whether you want invoices to show zero usage
|
|
30
|
+
# line items
|
|
31
|
+
# - `color_overrides`: Match your brand's color palette
|
|
32
|
+
# - `bm_group_key_overrides`: Customize how dimensions are displayed (for the
|
|
33
|
+
# usage embeddable dashboard)
|
|
34
|
+
# - Iframe implementation: Embed the returned URL directly in an iframe element
|
|
35
|
+
# - Responsive design: Dashboards automatically adapt to container dimensions
|
|
10
36
|
sig do
|
|
11
37
|
params(
|
|
12
38
|
customer_id: String,
|
|
@@ -4,7 +4,24 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Invoices
|
|
7
|
-
#
|
|
7
|
+
# This endpoint regenerates a voided invoice and recalculates the invoice based on
|
|
8
|
+
# up-to-date rates, available balances, and other fees regardless of the billing
|
|
9
|
+
# period.
|
|
10
|
+
#
|
|
11
|
+
# ### Use this endpoint to:
|
|
12
|
+
#
|
|
13
|
+
# Recalculate an invoice with updated rate terms, available balance, and fees to
|
|
14
|
+
# correct billing disputes or discrepancies
|
|
15
|
+
#
|
|
16
|
+
# ### Key response fields:
|
|
17
|
+
#
|
|
18
|
+
# The regenerated invoice id, which is distinct from the previously voided
|
|
19
|
+
# invoice.
|
|
20
|
+
#
|
|
21
|
+
# ### Usage guidelines:
|
|
22
|
+
#
|
|
23
|
+
# If an invoice is attached to a contract with a billing provider on it, the
|
|
24
|
+
# regenerated invoice will be distributed based on the configuration.
|
|
8
25
|
sig do
|
|
9
26
|
params(
|
|
10
27
|
id: String,
|
|
@@ -18,7 +35,11 @@ module MetronomeSDK
|
|
|
18
35
|
)
|
|
19
36
|
end
|
|
20
37
|
|
|
21
|
-
#
|
|
38
|
+
# Permanently cancels an invoice by setting its status to voided, preventing
|
|
39
|
+
# collection and removing it from customer billing. Use this to correct billing
|
|
40
|
+
# errors, cancel incorrect charges, or handle disputed invoices that should not be
|
|
41
|
+
# collected. Returns the voided invoice ID with the status change applied
|
|
42
|
+
# immediately to stop any payment processing.
|
|
22
43
|
sig do
|
|
23
44
|
params(
|
|
24
45
|
id: String,
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class V1
|
|
6
|
+
class Payments
|
|
7
|
+
# Fetch all payment attempts for the given invoice.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
customer_id: String,
|
|
11
|
+
invoice_id: String,
|
|
12
|
+
limit: Integer,
|
|
13
|
+
next_page: String,
|
|
14
|
+
statuses: T::Array[MetronomeSDK::V1::PaymentStatus::OrSymbol],
|
|
15
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
16
|
+
).returns(
|
|
17
|
+
MetronomeSDK::Internal::BodyCursorPage[MetronomeSDK::V1::Payment]
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
def list(
|
|
21
|
+
customer_id:,
|
|
22
|
+
invoice_id:,
|
|
23
|
+
# The maximum number of payments to return. Defaults to 25.
|
|
24
|
+
limit: nil,
|
|
25
|
+
# The next page token from a previous response.
|
|
26
|
+
next_page: nil,
|
|
27
|
+
statuses: nil,
|
|
28
|
+
request_options: {}
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Trigger a new attempt by canceling any existing attempts for this invoice and
|
|
33
|
+
# creating a new Payment. This will trigger another attempt to charge the
|
|
34
|
+
# Customer's configured Payment Gateway. Payment can only be attempted if all of
|
|
35
|
+
# the following are true:
|
|
36
|
+
#
|
|
37
|
+
# - The Metronome Invoice is finalized
|
|
38
|
+
# - PLG Invoicing is configured for the Customer
|
|
39
|
+
# - You cannot attempt payments for invoices that have already been `paid` or
|
|
40
|
+
# `voided`.
|
|
41
|
+
#
|
|
42
|
+
# Attempting to payment on an ineligible Invoice or Customer will result in a
|
|
43
|
+
# `400` response.
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
customer_id: String,
|
|
47
|
+
invoice_id: String,
|
|
48
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
49
|
+
).returns(MetronomeSDK::Models::V1::PaymentAttemptResponse)
|
|
50
|
+
end
|
|
51
|
+
def attempt(customer_id:, invoice_id:, request_options: {})
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Cancel an existing payment attempt for an invoice.
|
|
55
|
+
sig do
|
|
56
|
+
params(
|
|
57
|
+
customer_id: String,
|
|
58
|
+
invoice_id: String,
|
|
59
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
60
|
+
).returns(MetronomeSDK::Models::V1::PaymentCancelResponse)
|
|
61
|
+
end
|
|
62
|
+
def cancel(customer_id:, invoice_id:, request_options: {})
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# @api private
|
|
66
|
+
sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
|
|
67
|
+
def self.new(client:)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -4,7 +4,12 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class PricingUnits
|
|
7
|
-
# List all pricing units
|
|
7
|
+
# List all pricing units. All fiat currency types (for example, USD or GBP) will
|
|
8
|
+
# be included, as well as any custom pricing units that were configured. Custom
|
|
9
|
+
# pricing units can be used to charge for usage in a non-fiat pricing unit, for
|
|
10
|
+
# example AI credits.
|
|
11
|
+
#
|
|
12
|
+
# Note: The USD (cents) pricing unit is 2714e483-4ff1-48e4-9e25-ac732e8f24f2.
|
|
8
13
|
sig do
|
|
9
14
|
params(
|
|
10
15
|
limit: Integer,
|
|
@@ -4,10 +4,12 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Services
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
7
|
+
# Gets Metronome's service registry with associated IP addresses for security
|
|
8
|
+
# allowlisting and firewall configuration. Use this endpoint to maintain an
|
|
9
|
+
# up-to-date list of IPs that your systems should trust for Metronome
|
|
10
|
+
# communications. Returns service names and their current IP ranges, with new IPs
|
|
11
|
+
# typically appearing 30+ days before first use to ensure smooth allowlist
|
|
12
|
+
# updates.
|
|
11
13
|
sig do
|
|
12
14
|
params(request_options: MetronomeSDK::RequestOptions::OrHash).returns(
|
|
13
15
|
MetronomeSDK::Models::V1::ServiceListResponse
|