Class: MetronomeSDK::Resources::V1::Dashboards
- Inherits:
-
Object
- Object
- MetronomeSDK::Resources::V1::Dashboards
- Defined in:
- lib/metronome_sdk/resources/v1/dashboards.rb
Overview
[Customers](docs.metronome.com/provisioning/create-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
-
#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.
-
#initialize(client:) ⇒ Dashboards
constructor
private
A new instance of Dashboards.
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.
72 73 74 |
# File 'lib/metronome_sdk/resources/v1/dashboards.rb', line 72 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 whether you want invoices to show zero usage line items
-
‘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
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/metronome_sdk/resources/v1/dashboards.rb', line 58 def (params) parsed, = MetronomeSDK::V1::DashboardGetEmbeddableURLParams.dump_request(params) @client.request( method: :post, path: "v1/dashboards/getEmbeddableUrl", body: parsed, model: MetronomeSDK::Models::V1::DashboardGetEmbeddableURLResponse, options: ) end |