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

List Charges

List plan charges
v1.plans.list_charges(PlanListChargesParams**kwargs) -> SyncCursorPage[idstrcharge_typeliteralcredit_typeCreditTypeDatacustom_fieldsDict[str, str]namestrpriceslistproduct_idstrproduct_namestrquantityfloatstart_periodfloattier_reset_frequencyfloatunit_conversionUnitConversionPlanListChargesResponse]
get/v1/planDetails/{plan_id}/charges

Fetches a list of charges of a specific plan.

Parameters
plan_idstr
formatuuid
limitint
optional

Max number of results that should be returned

minimum1
maximum100
next_pagestr
optional

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

Returns
PlanListChargesResponseclass
Hide ParametersShow Parameters
idstr
formatuuid
charge_typeliteral
Literal["usage", "fixed", "composite", 2 more]
Hide ParametersShow Parameters
"usage"
"fixed"
"composite"
"minimum"
"seat"
credit_typeidstrnamestrCreditTypeData
custom_fieldsDict[str, str]
Dict[str, str]
namestr
priceslist
List[Price]
Hide ParametersShow Parameters
tierfloat

Used in pricing tiers. Indicates at what metric value the price applies.

valuefloat
collection_intervalfloat
optional
collection_schedulestr
optional
quantityfloat
optional
product_idstr
product_namestr
quantityfloat
optional
start_periodfloat
optional

Used in price ramps. Indicates how many billing periods pass before the charge applies.

tier_reset_frequencyfloat
optional

Used in pricing tiers. Indicates how often the tier resets. Default is 1 - the tier count resets every billing period.

unit_conversiondivision_factorfloatrounding_behaviorliteralUnitConversion
optional

Specifies how quantities for usage based charges will be converted.

Hide ParametersShow Parameters
division_factorfloat

The conversion factor

rounding_behaviorliteral
optional
Optional[Literal["floor", "ceiling"]]

Whether usage should be rounded down or up to the nearest whole number. If null, quantity will be rounded to 20 decimal places.

Hide ParametersShow Parameters
"floor"
"ceiling"
from metronome import Metronome

client = Metronome(
    bearer_token="My Bearer Token",
)
page = client.v1.plans.list_charges(
    plan_id="d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
)
page = page.data[0]
print(page.id)
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"
}