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

Retrieve

Get a customer
client.V1.Customers.Get(ctx, query) (*DataCustomerDetailV1CustomerGetResponse, error)
get/v1/customers/{customer_id}

Get a customer by Metronome ID.

Parameters
queryCustomerIDfieldV1CustomerGetParams
Hide ParametersShow Parameters
CustomerIDfield
param.Field[string]
formatuuid
Returns
V1CustomerGetResponsestruct
Hide ParametersShow Parameters
DataIDstringCreatedAtTimeCustomFieldsmapCustomerConfigCustomerDetailCustomerConfigExternalIDstringIngestAliasesarrayNamestringArchivedAtTimeCurrentBillableStatusCustomerDetailCurrentBillableStatusCustomerDetail
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"),
  )
  customer, err := client.V1.Customers.Get(context.TODO(), metronome.V1CustomerGetParams{
    CustomerID: metronome.F("d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", customer.Data)
}
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"
    }
  }
}