Skip to main content
GET
/
api
/
stats
Get Usage Statistics
curl --request GET \
  --url https://api.e-invoice.be/api/stats \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.e-invoice.be/api/stats"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.e-invoice.be/api/stats', 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.e-invoice.be/api/stats",
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.e-invoice.be/api/stats"

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.e-invoice.be/api/stats")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.e-invoice.be/api/stats")

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
{
  "tenant_id": "<string>",
  "period_start": "2023-12-25",
  "period_end": "2023-12-25",
  "actions": [
    {
      "stat_date": "2023-12-25",
      "count": 1
    }
  ],
  "total_days": 2,
  "average_daily_usage": 1,
  "budget_estimation_days": 0
}
{
"detail": "<string>"
}
{
"detail": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
{
"detail": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

start_date
string<date> | null

Start date in yyyy-mm-dd format. If not provided, queries from earliest available data.

end_date
string<date> | null

End date in yyyy-mm-dd format. If not provided, queries to latest available data.

aggregation
enum<string> | null
default:DAY

Aggregation type: DAY, WEEK, or MONTH. Defaults to DAY.

Available options:
DAY,
WEEK,
MONTH

Response

Successful Response

Statistics response for a tenant.

tenant_id
string
required

Tenant ID

period_start
string<date>
required

Start date of the period

period_end
string<date>
required

End date of the period

aggregation
enum<string>
required

Aggregation type used

Available options:
DAY,
WEEK,
MONTH
actions
ActionStats · object[]
required

List of action statistics, one entry per aggregation period per action

total_days
integer
required

Number of days in the period

Required range: x >= 1
average_daily_usage
number
required

Average daily usage (total actions / total days)

Required range: x >= 0
budget_estimation_days
number
default:0

Estimated days until credits run out (credit_balance / average_daily_usage). 0.0 if average_daily_usage is 0 or credit_balance is None

Required range: x >= 0