Skip to main content

Update Billable metric

Route

PUT
/api/v1/billable_metrics/:code

Usage

LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request PUT "$LAGO_URL/api/v1/billable_metrics/:code" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"billable_metric": {
"name": "bm_name",
"code": "bm_code",
"description": "description",
"aggregation_type": "sum_agg",
"field_name": "amount_sum"
}
}'

Arguments

{
"billable_metric": {
"name": "bm_name",
"code": "bm_code",
"description": "description",
"aggregation_type": "sum_agg",
"field_name": "amount_sum"
}
}
AttributesTypeDescription
nameString      OptionalBillable metric name.
codeString      OptionalCode identifying the billable metric.
It won't be updated if billable metric is attached to any subscriptions
descriptionString      OptionalDescription of the billable metric
aggregation_typeString      OptionalAggregation type that is used in event calculations.
It can be count_agg (metered), sum_agg (metered), max_agg (metered), unique_count_agg (metered) or recurring_count_agg (persistent)
It won't be updated if billable metric is attached to any subscriptions
field_nameString      OptionalField name used in events.
It won't be updated if billable metric is attached to any subscriptions

Responses

The billable metric was successfully updated

Returns an billable metric object.