List Charges
List plan charges
client.V1.Plans.ListCharges(ctx, params) (*CursorPage[IDstringChargeTypeV1PlanListChargesResponseChargeTypeCreditTypeCreditTypeDataCustomFieldsmapNamestringPricesarrayProductIDstringProductNamestringQuantityfloat64StartPeriodfloat64TierResetFrequencyfloat64UnitConversionV1PlanListChargesResponseUnitConversionV1PlanListChargesResponse], error)
get/v1/planDetails/{plan_id}/charges
Fetches a list of charges of a specific plan.
Parameters
paramsPlanIDfieldLimitfieldNextPagefieldV1PlanListChargesParams
Returns
V1PlanListChargesResponsestruct
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.ListCharges(context.TODO(), metronome.V1PlanListChargesParams{
PlanID: metronome.F("d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
200 Example
{
"data": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"charge_type": "usage",
"credit_type": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"name": "name"
},
"custom_fields": {
"foo": "string"
},
"name": "name",
"prices": [
{
"tier": 0,
"value": 0,
"collection_interval": 0,
"collection_schedule": "collection_schedule",
"quantity": 0
}
],
"product_id": "product_id",
"product_name": "product_name",
"quantity": 0,
"start_period": 0,
"tier_reset_frequency": 0,
"unit_conversion": {
"division_factor": 0,
"rounding_behavior": "floor"
}
}
],
"next_page": "next_page"
}