Skip to content

Charges

Charges are billing records attached to service items. They track the cost of provisioned resources — either per-change or as a recurring monthly cost.

Charges cannot be deleted.

Accessed via client.charges.

Charge types

charge_type Description
cost_per_change A one-time charge triggered by a change instance
monthly_cost A recurring monthly charge for an active service item

Model properties

Property Type Description
id int Charge ID
scope str Scope of the charge
total_charge float Charge amount
charge_type str cost_per_change or monthly_cost
start str Start of the billing period (ISO date)
end str End of the billing period (ISO date)
processed bool Whether the charge has been processed

Methods

list(**filters)

Returns a lazy generator of charge records.

# All charges
for charge in client.charges.list():
    print(charge.id, charge.charge_type)
    print(charge.data)  # full API response

filter(**filters)

Same as list() but returns all results as a list.

charges = client.charges.filter()
print(f"{len(charges)} total charges")

get(id)

Retrieves a single charge by ID. Raises NetorcaNotFoundError if not found.

charge = client.charges.get(99)

print(charge.id)
print(charge.scope)
print(charge.total_charge)
print(charge.charge_type)
print(charge.start, charge.end)
print(charge.processed)

get_accumulated(**filters)

Returns accumulated charge totals instead of individual records. Useful for reporting — shows summed charges grouped by service item, team, or period. Returns a list of dicts.

# All accumulated totals
totals = client.charges.get_accumulated()
for entry in totals:
    print(entry)