List Customers
List customers on a plan
client.v1.plans.listCustomers(PlanListCustomersParamsparams, RequestOptionsoptions?): CursorPage<customer_detailsCustomerDetailplan_detailsPlanDetailsPlanListCustomersResponse>
get/v1/planDetails/{plan_id}/customers
Fetches a list of customers on a specific plan (by default, only currently active plans are included)
Parameters
paramsplan_idstringlimitnumbernext_pagestringstatusunionPlanListCustomersParams
Returns
PlanListCustomersResponse
import Metronome from '@metronome/sdk';
const client = new Metronome({
bearerToken: 'My Bearer Token',
});
// Automatically fetches more pages as needed.
for await (const planListCustomersResponse of client.v1.plans.listCustomers({
plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
})) {
console.log(planListCustomersResponse.customer_details);
}
200 Example
{
"data": [
{
"customer_details": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"created_at": "2019-12-27T18:11:19.117Z",
"custom_fields": {
"foo": "string"
},
"customer_config": {
"salesforce_account_id": "salesforce_account_id"
},
"external_id": "external_id",
"ingest_aliases": [
"string"
],
"name": "name",
"archived_at": "2019-12-27T18:11:19.117Z",
"current_billable_status": {
"value": "billable",
"effective_at": "2019-12-27T18:11:19.117Z"
}
},
"plan_details": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"custom_fields": {
"foo": "string"
},
"customer_plan_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"name": "name",
"starting_on": "2019-12-27T18:11:19.117Z",
"ending_before": "2019-12-27T18:11:19.117Z"
}
}
],
"next_page": "next_page"
}