Class: MetronomeSDK::Resources::V1::Dashboards

Inherits:
Object
  • Object
show all
Defined in:
lib/metronome_sdk/resources/v1/dashboards.rb,
sig/metronome_sdk/resources/v1/dashboards.rbs

Overview

Customers in Metronome represent your users for all billing and reporting. Use these endpoints to create, retrieve, update, and archive customers and their billing configuration.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Dashboards

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Dashboards.

Parameters:



77
78
79
# File 'lib/metronome_sdk/resources/v1/dashboards.rb', line 77

def initialize(client:)
  @client = client
end

Instance Method Details

#get_embeddable_url(customer_id:, dashboard:, bm_group_key_overrides: nil, color_overrides: nil, dashboard_options: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::DashboardGetEmbeddableURLResponse

Generate secure, embeddable dashboard URLs that allow you to seamlessly integrate Metronome's billing visualizations directly into your application. This endpoint creates authenticated iframe-ready URLs for customer-specific dashboards, providing a white-labeled billing experience without building custom UI.

Use this endpoint to:

  • Embed billing dashboards directly in your customer portal or admin interface
  • Provide self-service access to invoices, usage data, and credit balances
  • Build white-labeled billing experiences with minimal development effort

Key response fields:

  • A secure, time-limited URL that can be embedded in an iframe
  • The URL includes authentication tokens and configuration parameters
  • URLs are customer-specific and respect your security settings

Usage guidelines:

  • Dashboard types: Choose from invoices, usage, or commits_and_credits
  • Customization options:
    • dashboard_options: Configure dashboard behavior. For the invoices dashboard, supported keys include: show_zero_usage_line_items ("true"/"false"), hide_voided_invoices ("true"/"false"), contract_id (UUID, filters invoices by contract), invoice_type ("USAGE" or "SCHEDULED", filters by invoice type), invoice_status_filter ("VOID", "FINALIZED", "DRAFT", "FINALIZED_AND_DRAFT", or "ALL"), and billable_status_filter ("BILLABLE", "UNBILLABLE", or "ALL")
    • color_overrides: Match your brand's color palette
    • bm_group_key_overrides: Customize how dimensions are displayed (for the usage embeddable dashboard)
  • Iframe implementation: Embed the returned URL directly in an iframe element
  • Responsive design: Dashboards automatically adapt to container dimensions

Parameters:

Returns:

See Also:



63
64
65
66
67
68
69
70
71
72
# File 'lib/metronome_sdk/resources/v1/dashboards.rb', line 63

def get_embeddable_url(params)
  parsed, options = MetronomeSDK::V1::DashboardGetEmbeddableURLParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/dashboards/getEmbeddableUrl",
    body: parsed,
    model: MetronomeSDK::Models::V1::DashboardGetEmbeddableURLResponse,
    options: options
  )
end