Usage Meters
Deactivate usage meter
Make an existing active usage meter to be inactive
Active Usage Meters with active Pricing Plan attached can also be deactivated.
POST
/
usage_meters
/
{usage_meter_id}
/
deactivate
curl --request POST \
--url https://api.togai.com/usage_meters/{usage_meter_id}/deactivate \
--header 'Authorization: <authorization>'
{
"id": "um.1zlQTBWlkeO.lB7fh",
"name": "Rides",
"description": "Cab rides",
"type": "COUNTER",
"aggregation": "COUNT",
"status": "DRAFT",
"computations": [
{
"matcher": "{\n \"and\": [\n {\"in\": [{\"var\": \"dimension.city\"}, \"chennai\", \"mumbai\"]},\n \"or\": [\n {\">\": [{\"var\": \"attribute.distance\"}, 100]},\n {\"<\": [{\"var\": \"attribute.distance\"}, 20]}\n ]\n ]\n}\n",
"computation": "1"
}
]
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
usage_meter_id
string
requiredResponse
200 - application/json
id
string
requiredIdentifier of the usage meter
name
string
requiredName of the usage meter
billableName
string
Billable name of addon. Billable name takes precedence over name to display in invoice.
description
string
type
enum<string>
requiredType of usage meter
Available options:
COUNTER
status
enum<string>
Status of usage meter
Available options:
DRAFT
, ACTIVE
, INACTIVE
, ARCHIVED
aggregation
enum<string>
requiredAggregation to be applied on usage meter result
Available options:
COUNT
, SUM
computations
object[]
createdAt
string
lastActivatedAt
string
updatedAt
string
curl --request POST \
--url https://api.togai.com/usage_meters/{usage_meter_id}/deactivate \
--header 'Authorization: <authorization>'
{
"id": "um.1zlQTBWlkeO.lB7fh",
"name": "Rides",
"description": "Cab rides",
"type": "COUNTER",
"aggregation": "COUNT",
"status": "DRAFT",
"computations": [
{
"matcher": "{\n \"and\": [\n {\"in\": [{\"var\": \"dimension.city\"}, \"chennai\", \"mumbai\"]},\n \"or\": [\n {\">\": [{\"var\": \"attribute.distance\"}, 100]},\n {\"<\": [{\"var\": \"attribute.distance\"}, 20]}\n ]\n ]\n}\n",
"computation": "1"
}
]
}