Billing Events & Usage Metering
Get Billable Metric
GET
/
metrics
/
{id}
Get Billable Metric
curl --request GET \
--url https://api.alguna.io/metrics/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.alguna.io/metrics/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.alguna.io/metrics/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.alguna.io/metrics/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.alguna.io/metrics/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.alguna.io/metrics/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alguna.io/metrics/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "mtr_02zBU3PJ3hJurtFSxDD3Ol",
"description": "No. of Amex Consumer Cards",
"name": "Amex Consumer",
"eventName": "transactions",
"filters": [
{
"operator": "and",
"filters": [
{
"field": "card_scheme",
"operator": "equal",
"value": "amex"
},
{
"field": "card_offering",
"operator": "equal",
"value": "consumer"
}
]
}
],
"aggregation": {
"method": "sum",
"field": "txn_value"
},
"createdAt": "2025-02-24T12:09:05.350876Z",
"updatedAt": "2025-02-24T12:09:05.350877Z",
"organizationID": "8641473c-2d34-46c6-b712-c893934fc8fb"
}
Response
The unique identifier for the metric.
A brief description of what the metric measures.
The name of the metric.
The event that triggers the metric.
An array of filter groups applied to the metric to narrow down the events counted.
Show Filter Group Properties
Show Filter Group Properties
The logical operator (e.g., “and”) used to combine the filters within the group.
The timestamp when the metric was created.
The timestamp when the metric was last updated.
The unique identifier for the organization associated with the metric.
{
"id": "mtr_02zBU3PJ3hJurtFSxDD3Ol",
"description": "No. of Amex Consumer Cards",
"name": "Amex Consumer",
"eventName": "transactions",
"filters": [
{
"operator": "and",
"filters": [
{
"field": "card_scheme",
"operator": "equal",
"value": "amex"
},
{
"field": "card_offering",
"operator": "equal",
"value": "consumer"
}
]
}
],
"aggregation": {
"method": "sum",
"field": "txn_value"
},
"createdAt": "2025-02-24T12:09:05.350876Z",
"updatedAt": "2025-02-24T12:09:05.350877Z",
"organizationID": "8641473c-2d34-46c6-b712-c893934fc8fb"
}
Previous
List Billable MetricsRetrieve a paginated list of billable metrics with optional filtering and sorting
Next
⌘I
Get Billable Metric
curl --request GET \
--url https://api.alguna.io/metrics/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.alguna.io/metrics/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.alguna.io/metrics/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.alguna.io/metrics/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.alguna.io/metrics/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.alguna.io/metrics/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alguna.io/metrics/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "mtr_02zBU3PJ3hJurtFSxDD3Ol",
"description": "No. of Amex Consumer Cards",
"name": "Amex Consumer",
"eventName": "transactions",
"filters": [
{
"operator": "and",
"filters": [
{
"field": "card_scheme",
"operator": "equal",
"value": "amex"
},
{
"field": "card_offering",
"operator": "equal",
"value": "consumer"
}
]
}
],
"aggregation": {
"method": "sum",
"field": "txn_value"
},
"createdAt": "2025-02-24T12:09:05.350876Z",
"updatedAt": "2025-02-24T12:09:05.350877Z",
"organizationID": "8641473c-2d34-46c6-b712-c893934fc8fb"
}