curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries', 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.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SALESBRICKS-KEY: <api-key>"
],
]);
$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.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
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.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"transaction_id": "<string>",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": 0,
"time": "2023-11-07T05:31:56Z",
"properties": "<unknown>"
}
]{
"error": {
"code": "ERR_NOT_FOUND",
"message": "<string>",
"error_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "Not found — the resource you are looking for does not exist."
}
}List individual usage entries
Returns the individual usage entries (single submitted events) for a brick, newest first, paginated via limit/offset in a envelope. Each entry carries the transaction_id accepted by PATCH /usage and DELETE /usage, enabling per-entry edit and delete.
Only entries with a transaction record are returned — entries ingested without a transaction_id cannot be individually managed.
curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries', 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.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SALESBRICKS-KEY: <api-key>"
],
]);
$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.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
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.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/bricks/{brick_id}/usage/entries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"transaction_id": "<string>",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": 0,
"time": "2023-11-07T05:31:56Z",
"properties": "<unknown>"
}
]{
"error": {
"code": "ERR_NOT_FOUND",
"message": "<string>",
"error_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "Not found — the resource you are looking for does not exist."
}
}Authorizations
API key for authentication
Path Parameters
^([a-zA-Z\d\-]+)$^([a-zA-Z\d\-]+)$Query Parameters
Start of the range (inclusive). ISO 8601 (YYYY-MM-DD or full datetime). Date-only values are interpreted in the subscription's time zone.
Page size. Defaults to 25, max 100.
Number of entries to skip.
Optional free-text filter. Matches (OR) against the transaction_id, the entry's properties JSON (as text), and — when the term parses as a number — the exact recorded value.
End of the range (inclusive). ISO 8601. Date-only values resolve to the end of that day in the subscription's time zone.
Response
The unique identifier of this usage entry. Use it with PATCH /usage and DELETE /usage to update or remove the entry.
The ID of the subscription this usage entry belongs to.
The ID of the metered brick this usage is for.
The recorded usage value. Integer for whole quantities, decimal for fractional.
-100000000000000 < x < 100000000000000The timestamp the usage was recorded against.
Additional properties recorded with this usage entry.