curl --request GET \
--url https://api.staging.glot.com/v1/billing/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.glot.com/v1/billing/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.glot.com/v1/billing/history', 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.staging.glot.com/v1/billing/history",
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.staging.glot.com/v1/billing/history"
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.staging.glot.com/v1/billing/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.glot.com/v1/billing/history")
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{
"items": [
{
"kind": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"delta_cents": 123,
"currency": "<string>",
"room": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"streaming_mode": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"total_connection_minutes": 123,
"total_charged_cents": 123,
"participants": [
{
"id": 123,
"participant_identity": "<string>",
"participant_kind": "<string>",
"languages": [
"<string>"
],
"joined_at": "2023-11-07T05:31:56Z",
"left_at": "2023-11-07T05:31:56Z",
"connection_minutes": 123,
"charged_cents": 123
}
]
},
"provider_reference": "<string>"
}
],
"limit": 123,
"offset": 123,
"next_offset": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}List billing history
One page of your organization’s billing history, newest first.
Every purchase and every call that cost something, as one list. A call’s line carries the room and one entry per participant connection — how long each was connected, how many minutes each was billed, and what each cost — so a spend line can be expanded in place without a request per line.
Switch on kind: room_usage lines carry room, credit lines carry
provider_reference. delta_cents is signed the same way for both, so a page sums
without special-casing.
Use expand to control how much of each call is loaded — drop to room or none when
you are not drawing the breakdown, since each level costs a join the one below does not.
Each connection is billed by the started minute and counted separately — the
translator included — so a short conversation between several people can bill more
minutes than it lasted. room.total_charged_cents is the sum of the breakdown, and a
live room shows only the connections that have already ended.
Use limit and offset to page through it. A room’s breakdown is never split across
pages.
A call is one line here, not one per participant, even though the ledger underneath records a charge per connection. That is the point of this endpoint: the amounts you see sum to the balance exactly once.
curl --request GET \
--url https://api.staging.glot.com/v1/billing/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.glot.com/v1/billing/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.glot.com/v1/billing/history', 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.staging.glot.com/v1/billing/history",
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.staging.glot.com/v1/billing/history"
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.staging.glot.com/v1/billing/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.glot.com/v1/billing/history")
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{
"items": [
{
"kind": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"delta_cents": 123,
"currency": "<string>",
"room": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"streaming_mode": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"total_connection_minutes": 123,
"total_charged_cents": 123,
"participants": [
{
"id": 123,
"participant_identity": "<string>",
"participant_kind": "<string>",
"languages": [
"<string>"
],
"joined_at": "2023-11-07T05:31:56Z",
"left_at": "2023-11-07T05:31:56Z",
"connection_minutes": 123,
"charged_cents": 123
}
]
},
"provider_reference": "<string>"
}
],
"limit": 123,
"offset": 123,
"next_offset": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
How much of each call to include. participants returns the room and one entry per connection; room returns the room without the breakdown, for a list that expands lazily via GET /v1/rooms/{room_id}; none returns the amounts alone, for a total or a chart. Each level costs a join the level below does not.
none, room, participants 1 <= x <= 200x >= 0