List Billable Metrics
Get billable metrics for a customer
client.v1.customers.listBillableMetrics(CustomerListBillableMetricsParamsparams, RequestOptionsoptions?): CursorPage<idstringnamestringaggregatestringaggregate_keysarrayaggregation_keystringaggregation_typeunionarchived_atstringcustom_fieldsRecord<string, string>event_type_filterEventTypeFilterfilterRecord<string, unknown>group_byarraygroup_keysarrayproperty_filtersarraysqlstringCustomerListBillableMetricsResponse>
get/v1/customers/{customer_id}/billable-metrics
Get all billable metrics for a given customer.
Parameters
paramscustomer_idstringinclude_archivedbooleanlimitnumbernext_pagestringon_current_planbooleanCustomerListBillableMetricsParams
Returns
CustomerListBillableMetricsResponse
import Metronome from '@metronome/sdk';
const client = new Metronome({
bearerToken: 'My Bearer Token',
});
// Automatically fetches more pages as needed.
for await (const customerListBillableMetricsResponse of client.v1.customers.listBillableMetrics({
customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
})) {
console.log(customerListBillableMetricsResponse.id);
}
200 Example
{
"data": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"name": "name",
"aggregate": "aggregate",
"aggregate_keys": [
"string"
],
"aggregation_key": "aggregation_key",
"aggregation_type": "COUNT",
"archived_at": "2019-12-27T18:11:19.117Z",
"custom_fields": {
"foo": "string"
},
"event_type_filter": {
"in_values": [
"string"
],
"not_in_values": [
"string"
]
},
"filter": {
"foo": "bar"
},
"group_by": [
"string"
],
"group_keys": [
[
"string"
]
],
"property_filters": [
{
"name": "name",
"exists": true,
"in_values": [
"string"
],
"not_in_values": [
"string"
]
}
],
"sql": "sql"
}
],
"next_page": "next_page"
}