billable_metrics
Update a billable metric
This endpoint updates an existing billable metric representing a pricing component of your application.
put/billable_metrics/{code}
Request body
Example request
{
"billable_metric": {
"name": "Storage",
"code": "storage",
"description": "GB of storage used in my application",
"expression": "round((ended_at - started_at) * units)",
"rounding_function": "round",
"rounding_precision": 2,
"field_name": "gb",
"aggregation_type": "sum_agg",
"weighted_interval": "seconds",
"filters": [
{
"key": "region",
"values": [
"us-east-1"
]
}
]
}
}Response
Billable metric updated
Example response
{
"billable_metric": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "Storage",
"code": "storage",
"description": "GB of storage used in my application",
"rounding_function": "round",
"rounding_precision": 2,
"created_at": "2022-09-14T16:35:31Z",
"expression": "round((ended_at - started_at) * units)",
"field_name": "gb",
"aggregation_type": "sum_agg",
"weighted_interval": "seconds",
"filters": [
{
"key": "region",
"values": [
"us-east-1"
]
}
]
}
}