Usage
List order usage meters
Returns usage billing meters configured on the order’s package, including current unbilled usage, remaining free allowance, billable quantity, and threshold warnings. The authenticated API key must own the order.
GET
/
meter
/
{customer_id}
/
get
/
{order_id}
List order usage meters
curl --request GET \
--url https://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_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://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_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://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_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://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_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{
"success": true,
"data": [
{
"id": 7,
"name": "Bandwidth",
"unit_label": "GB",
"included_allowance": 100,
"unit_price": "0.050000",
"usage": {
"used": 105,
"remaining_free": 0,
"remaining_free_percent": 0,
"overage_qty": 5,
"billable_qty": 5,
"current_unbilled_amount": "0.2500",
"threshold": {
"level": "warning",
"threshold": 10,
"message": "Free usage is below 10%."
}
}
}
]
}⌘I
List order usage meters
curl --request GET \
--url https://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_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://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_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://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_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://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo.onlinebillingform.com/api/v2/meter/{customer_id}/get/{order_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{
"success": true,
"data": [
{
"id": 7,
"name": "Bandwidth",
"unit_label": "GB",
"included_allowance": 100,
"unit_price": "0.050000",
"usage": {
"used": 105,
"remaining_free": 0,
"remaining_free_percent": 0,
"overage_qty": 5,
"billable_qty": 5,
"current_unbilled_amount": "0.2500",
"threshold": {
"level": "warning",
"threshold": 10,
"message": "Free usage is below 10%."
}
}
}
]
}