billable_metrics
Evaluate an expression for a billable metric
Changed onThis endpoint evaluates an expression against a test event. Use it to check an expression before you set it on a billable metric.
post/billable_metrics/evaluate_expression
Request
- Base URLhttps://api.getlago.com/api/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"expression": "round((event.properties.ended_at - event.properties.started_at) * event.properties.units)",
"event": {
"code": "storage",
"properties": {
"gb": 10
}
}
}Response
Billable metric expression evaluation result
Example response
{
"expression_result": {
"value": "2.0"
}
}Changes
- info
the request property
/became optional - info
the request property
/became optional
- info
- info
endpoint added
- info