lago_id
string
required

Unique identifier of the billable metric created by Lago.

name
string
required

Name of the billable metric.

code
string
required

Unique code used to identify the billable metric associated with the API request. This code associates each event with the correct metric.

recurring
boolean
required

Defines if the billable metric is persisted billing period over billing period.

  • If set to true: the accumulated number of units calculated from the previous billing period is persisted to the next billing period.
  • If set to false: the accumulated number of units is reset to 0 at the end of the billing period.
  • If not defined in the request, default value is false.
created_at
string
required

Creation date of the billable metric.

aggregation_type
enum<string>
required

Aggregation method used to compute usage for this billable metric.

Available options:
count_agg,
sum_agg,
max_agg,
unique_count_agg,
weighted_sum_agg,
latest_agg
active_subscriptions_count
integer
required

Number of active subscriptions using this billable metric.

draft_invoices_count
integer
required

Number of draft invoices for which this billable metric is listed as an invoice item.

plans_count
integer
required

Number of plans using this billable metric.

description
string | null

Internal description of the billable metric.

field_name
string | null

Property of the billable metric used for aggregating usage data. This field is not required for count_agg.

weighted_interval
enum<string> | null

Parameter exclusively utilized in conjunction with the weighted_sum aggregation type. It serves to adjust the aggregation result by assigning weights and proration to the result based on time intervals. When this field is not provided, the default time interval is assumed to be in seconds.

Available options:
seconds
filters
object[]