Skip to main content
GET
/
api
/
v1
/
subscriptions
/
{subscription_id}
/
v2
/
entitlements-usage
Python SDK
from metrifox_sdk import MetrifoxClient

client = MetrifoxClient(api_key="your_api_key")

# Get entitlements usage for a subscription
subscription_id = "625f5cee-259b-4994-b7eb-416b9e551f2c"
response = client.subscriptions.get_entitlements_usage(subscription_id)

for entitlement in response['data']:
    print(f"Feature: {entitlement['feature_name']} ({entitlement['feature_key']})")
    print(f"  Type: {entitlement['type']}")
    print(f"  Active: {entitlement['active']}")
    if entitlement['purchased_pool']:
        pool = entitlement['purchased_pool']
        print(f"  Purchased: {pool['used']}/{pool['amount']} used, {pool['balance']} remaining")
    if entitlement['rollover_quantity_pool']:
        pool = entitlement['rollover_quantity_pool']
        print(f"  Rollover: {pool['used']}/{pool['amount']} used, {pool['balance']} remaining")
import { init } from "metrifox-js";

const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});

// Get entitlements usage for a subscription
const subscriptionId = "625f5cee-259b-4994-b7eb-416b9e551f2c";
const response = await metrifoxClient.subscriptions.getEntitlementsUsage(subscriptionId);

response.data.forEach(entitlement => {
console.log(`Feature: ${entitlement.feature_name} (${entitlement.feature_key})`);
console.log(` Type: ${entitlement.type}`);
console.log(` Active: ${entitlement.active}`);
if (entitlement.purchased_pool) {
const pool = entitlement.purchased_pool;
console.log(` Purchased: ${pool.used}/${pool.amount} used, ${pool.balance} remaining`);
}
if (entitlement.rollover_quantity_pool) {
const pool = entitlement.rollover_quantity_pool;
console.log(` Rollover: ${pool.used}/${pool.amount} used, ${pool.balance} remaining`);
}
});
require 'metrifox-sdk'

# Initialize with configuration
METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })

# Get entitlements usage for a subscription
subscription_id = "625f5cee-259b-4994-b7eb-416b9e551f2c"
response = METRIFOX_SDK.subscriptions.get_entitlements_usage(subscription_id)

response['data'].each do |entitlement|
puts "Feature: #{entitlement['feature_name']} (#{entitlement['feature_key']})"
puts " Type: #{entitlement['type']}"
puts " Active: #{entitlement['active']}"
if entitlement['purchased_pool']
pool = entitlement['purchased_pool']
puts " Purchased: #{pool['used']}/#{pool['amount']} used, #{pool['balance']} remaining"
end
if entitlement['rollover_quantity_pool']
pool = entitlement['rollover_quantity_pool']
puts " Rollover: #{pool['used']}/#{pool['amount']} used, #{pool['balance']} remaining"
end
end
curl --request GET \
--url https://{defaultHost}/api/v1/subscriptions/{subscription_id}/v2/entitlements-usage \
--header 'x-api-key: <api-key>'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/api/v1/subscriptions/{subscription_id}/v2/entitlements-usage",
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-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://{defaultHost}/api/v1/subscriptions/{subscription_id}/v2/entitlements-usage"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-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://{defaultHost}/api/v1/subscriptions/{subscription_id}/v2/entitlements-usage")
.header("x-api-key", "<api-key>")
.asString();
{
  "statusCode": 200,
  "message": "Entitlements usage fetched successfully",
  "meta": {},
  "data": [
    {
      "id": "120007eb-c6f7-4439-b7a9-75f09d60079e",
      "feature_key": "feature_skills_audit",
      "type": "per_use",
      "included_pool": null,
      "purchased_pool": {
        "balance": "2.0",
        "used": "0.0",
        "amount": "2.0",
        "next_reset_at": "2026-03-12T16:55:21.847Z",
        "active": true
      },
      "pay_as_you_go_pool": null,
      "rollover_quantity_pool": {
        "balance": "4.0",
        "used": "0.0",
        "amount": "4.0",
        "active": true
      },
      "active": true,
      "feature_name": "Skills Audit"
    },
    {
      "id": "2e7f7fd8-c723-4d7c-98e5-b8239ab5226e",
      "feature_key": "feature_seats",
      "type": "persistent_use",
      "included_pool": null,
      "purchased_pool": {
        "balance": "0.0",
        "used": "3.0",
        "amount": "3.0",
        "next_reset_at": "2026-03-12T16:55:21.847Z",
        "active": true
      },
      "pay_as_you_go_pool": null,
      "rollover_quantity_pool": null,
      "active": true,
      "feature_name": "Seats"
    }
  ],
  "errors": {}
}
{
"message": "<string>",
"errors": {}
}
{
"statusCode": 404,
"message": "Subscription not found",
"errors": {
"subscription_id": [
"Subscription with ID '625f5cee-259b-4994-b7eb-416b9e551f2c' does not exist"
]
}
}

Authorizations

x-api-key
string
header
required

Path Parameters

subscription_id
string<uuid>
required

The unique subscription identifier (UUID)

Response

Entitlements usage fetched successfully

statusCode
integer
Example:

200

message
string
Example:

"Entitlements usage fetched successfully"

meta
object

Additional metadata

data
object[]

Array of entitlement usage records

errors
object

Any errors that occurred