Billable Metrics
Create a billable metric
Changed onCreate a new billable metric for usage-based billing. Supported aggregation types: COUNT, SUM, MAX, UNIQUE_COUNT, LATEST, WEIGHTED_SUM.
post/api/billable-metrics
Request
- Base URLhttps://api.novabilling.one
- AuthAPI key in header Authorization
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"name": "API Calls",
"code": "api_calls",
"description": "Number of API calls made",
"aggregationType": "COUNT",
"fieldName": "tokens",
"filters": [
{
"key": "region",
"values": [
"us-east",
"eu-west"
]
}
]
}Response
Billable metric created
Example response
{
"id": "clx1234567890",
"name": "API Calls",
"code": "api_calls",
"description": "Number of API calls made",
"aggregationType": "COUNT",
"fieldName": "tokens",
"filters": [
{
"id": "clx1234567890",
"key": "region",
"values": [
"us-east",
"us-west",
"eu"
]
}
]
}Changes
- info
endpoint added
- info