Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

List

List customers
client.V1.Customers.List(ctx, query) (*CursorPage[IDstringCreatedAtTimeCustomFieldsmapCustomerConfigCustomerDetailCustomerConfigExternalIDstringIngestAliasesarrayNamestringArchivedAtTimeCurrentBillableStatusCustomerDetailCurrentBillableStatusCustomerDetail], error)
get/v1/customers

List all customers.

Parameters
queryCustomerIDsfieldIngestAliasfieldLimitfieldNextPagefieldOnlyArchivedfieldSalesforceAccountIDsfieldV1CustomerListParams
Hide ParametersShow Parameters
CustomerIDsfield
optional
param.Field[[]string]

Filter the customer list by customer_id. Up to 100 ids can be provided.

IngestAliasfield
optional
param.Field[string]

Filter the customer list by ingest_alias

Limitfield
optional
param.Field[int64]

Max number of results that should be returned

minimum1
maximum100
NextPagefield
optional
param.Field[string]

Cursor that indicates where the next page of results should start.

OnlyArchivedfield
optional
param.Field[bool]

Filter the customer list to only return archived customers. By default, only active customers are returned.

SalesforceAccountIDsfield
optional
param.Field[[]string]

Filter the customer list by salesforce_account_id. Up to 100 ids can be provided.

Returns
IDstringCreatedAtTimeCustomFieldsmapCustomerConfigCustomerDetailCustomerConfigExternalIDstringIngestAliasesarrayNamestringArchivedAtTimeCurrentBillableStatusCustomerDetailCurrentBillableStatusCustomerDetail
package main

import (
  "context"
  "fmt"

  "github.com/Metronome-Industries/metronome-go"
  "github.com/Metronome-Industries/metronome-go/option"
)

func main() {
  client := metronome.NewClient(
    option.WithBearerToken("My Bearer Token"),
  )
  page, err := client.V1.Customers.List(context.TODO(), metronome.V1CustomerListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
200 Example
{
  "data": [
    {
      "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"
      }
    }
  ],
  "next_page": "next_page"
}