List customer entitlement balances with advanced filtering
curl --request GET \
--url https://api.zenskar.com/entitlements/customers_balances \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/entitlements/customers_balances"
headers = {
"x-api-key": "<api-key>",
"organisation": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>', organisation: '<api-key>'}};
fetch('https://api.zenskar.com/entitlements/customers_balances', 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.zenskar.com/entitlements/customers_balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"organisation: <api-key>",
"x-api-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.zenskar.com/entitlements/customers_balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("organisation", "<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.zenskar.com/entitlements/customers_balances")
.header("x-api-key", "<api-key>")
.header("organisation", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenskar.com/entitlements/customers_balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["organisation"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "API Calls",
"units": "calls",
"type": "Quantity",
"entitlement": "456e7890-e12b-34c5-d678-901234567890",
"customer": {
"id": "789e0123-e45f-67g8-h901-234567890123",
"name": "Acme Corp",
"email": "billing@acme.com"
},
"quantity": 10000,
"quantity_used": 2500,
"quantity_remaining": 7500,
"active_from": "2024-01-01T00:00:00Z",
"expiry_at": "2024-12-31T23:59:59Z",
"created_at": "2024-01-01T10:30:00Z",
"contract_id": "contract-uuid-123",
"contract": {
"id": "contract-uuid-123",
"name": "Enterprise Plan 2024"
},
"product": {
"id": "product-uuid-456",
"name": "API Access Product"
},
"invoice": {
"id": "invoice-uuid-789",
"name": "INV-2024-001"
},
"event": "Invoice",
"invoice_id": "invoice-uuid-789"
},
{
"id": "234e5678-e90b-12d3-a456-426614174001",
"name": "Storage",
"units": "GB",
"type": "Quantity",
"entitlement": "567e8901-e23f-45g6-h789-012345678901",
"customer": {
"id": "890e1234-e56f-78g9-h012-345678901234",
"name": "Tech Solutions Inc",
"email": "accounts@techsolutions.com"
},
"quantity": 100,
"quantity_used": 45.2,
"quantity_remaining": 54.8,
"active_from": "2024-01-15T00:00:00Z",
"expiry_at": "2024-02-14T23:59:59Z",
"created_at": "2024-01-15T14:20:00Z",
"contract_id": "contract-uuid-456",
"event": "Manual"
}
],
"next": "cursor_to_next_page",
"total": 150
}Entitlements
List customer entitlement balances with advanced filtering
Retrieve customer entitlement balances with comprehensive filtering, sorting, and pagination.
Filter by:
- Customer: customer, customer__in (filter by specific customer IDs).
- Entitlement: entitlement, entitlement__in (filter by specific entitlement IDs).
- Contract: contract_id, contract_id__in (filter by contract IDs - useful for contract-specific entitlements).
- Quantities: quantity, quantity_used with range filters (gt, gte, lt, lte, neq).
- Dates: created_at, active_from with range filters for time-based filtering.
- Status: Use quantity__gt=0 to show only active balances, or quantity_used__lt=quantity to show available balances.
Enrichment options (populate parameter):
- customer: Include customer name and email details.
- contract: Include contract name for entitlements granted by contracts.
- product: Include product name for product-specific entitlements.
- invoice: Include invoice number for invoice-generated entitlements.
- Multiple: Use comma-separated values like ‘customer,contract,product,invoice’ for full enrichment.
Pagination & sorting:
- limit: page size (1-100, default 50).
- cursor: pass ‘next’ from previous response to paginate.
- sort_key: field to sort by (id, created_at, quantity, quantity_used, active_from, expiry_at).
- sort_type: ‘asc’ or ‘desc’ (default ‘asc’).
- search: text search across entitlement names and descriptions.
Common use cases:
- Contract entitlements: Use contract_id filter to get all entitlements for a specific contract.
- Customer overview: Use customer filter with populate=contract,product for complete customer entitlement view.
- Low balance alerts: Use quantity__gt=0 and quantity_used__gte with percentage calculations.
- Expiring entitlements: Use expiry_at__lt with future date to find soon-to-expire entitlements.
GET
/
entitlements
/
customers_balances
List customer entitlement balances with advanced filtering
curl --request GET \
--url https://api.zenskar.com/entitlements/customers_balances \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/entitlements/customers_balances"
headers = {
"x-api-key": "<api-key>",
"organisation": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>', organisation: '<api-key>'}};
fetch('https://api.zenskar.com/entitlements/customers_balances', 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.zenskar.com/entitlements/customers_balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"organisation: <api-key>",
"x-api-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.zenskar.com/entitlements/customers_balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("organisation", "<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.zenskar.com/entitlements/customers_balances")
.header("x-api-key", "<api-key>")
.header("organisation", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenskar.com/entitlements/customers_balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["organisation"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "API Calls",
"units": "calls",
"type": "Quantity",
"entitlement": "456e7890-e12b-34c5-d678-901234567890",
"customer": {
"id": "789e0123-e45f-67g8-h901-234567890123",
"name": "Acme Corp",
"email": "billing@acme.com"
},
"quantity": 10000,
"quantity_used": 2500,
"quantity_remaining": 7500,
"active_from": "2024-01-01T00:00:00Z",
"expiry_at": "2024-12-31T23:59:59Z",
"created_at": "2024-01-01T10:30:00Z",
"contract_id": "contract-uuid-123",
"contract": {
"id": "contract-uuid-123",
"name": "Enterprise Plan 2024"
},
"product": {
"id": "product-uuid-456",
"name": "API Access Product"
},
"invoice": {
"id": "invoice-uuid-789",
"name": "INV-2024-001"
},
"event": "Invoice",
"invoice_id": "invoice-uuid-789"
},
{
"id": "234e5678-e90b-12d3-a456-426614174001",
"name": "Storage",
"units": "GB",
"type": "Quantity",
"entitlement": "567e8901-e23f-45g6-h789-012345678901",
"customer": {
"id": "890e1234-e56f-78g9-h012-345678901234",
"name": "Tech Solutions Inc",
"email": "accounts@techsolutions.com"
},
"quantity": 100,
"quantity_used": 45.2,
"quantity_remaining": 54.8,
"active_from": "2024-01-15T00:00:00Z",
"expiry_at": "2024-02-14T23:59:59Z",
"created_at": "2024-01-15T14:20:00Z",
"contract_id": "contract-uuid-456",
"event": "Manual"
}
],
"next": "cursor_to_next_page",
"total": 150
}Authorizations
Query Parameters
Response
Successfully retrieved customer entitlement balances