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

List

List plans
client.V1.Plans.List(ctx, query) (*CursorPage[IDstringDescriptionstringNamestringCustomFieldsmapV1PlanListResponse], error)
get/v1/plans

List all available plans.

Parameters
queryLimitfieldNextPagefieldV1PlanListParams
Hide ParametersShow Parameters
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.

Returns
V1PlanListResponsestruct
Hide ParametersShow Parameters
IDstring
formatuuid
Descriptionstring
Namestring
CustomFieldsmap
optional
map[string, string]
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.Plans.List(context.TODO(), metronome.V1PlanListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
200 Example
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "description": "description",
      "name": "name",
      "custom_fields": {
        "foo": "string"
      }
    }
  ],
  "next_page": "next_page"
}