Python SDK
from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# List credit allocations for a wallet
allocations = client.wallets.list_credit_allocations("b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c")
for alloc in allocations['data']:
available = alloc['amount'] - alloc['consumed']
print(f"{alloc['allocation_type']}: {available} available / {alloc['amount']} granted")
# Filter by status
active = client.wallets.list_credit_allocations(
"b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c",
status="active",
)
import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
const allocations = await metrifoxClient.wallets.listCreditAllocations(
"b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c"
);
allocations.data.forEach((a) => {
const available = a.amount - a.consumed;
console.log(`${a.allocation_type}: ${available} available / ${a.amount} granted`);
});
// Filter by status
const active = await metrifoxClient.wallets.listCreditAllocations(
"b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c",
{ status: "active" }
);
require 'metrifox-sdk'
METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })
# List credit allocations for a wallet
response = METRIFOX_SDK.wallets.list_credit_allocations("b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c")
response["data"].each do |alloc|
available = alloc["amount"] - alloc["consumed"]
puts "#{alloc['allocation_type']}: #{available} available / #{alloc['amount']} granted"
end
# Filter by status
active = METRIFOX_SDK.wallets.list_credit_allocations(
"b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c",
status: "active"
)
curl --request GET \
--url https://{defaultHost}/api/v1/credit_systems/v2/wallets/{id}/credit-allocations \
--header 'x-api-key: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/api/v1/credit_systems/v2/wallets/{id}/credit-allocations",
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/credit_systems/v2/wallets/{id}/credit-allocations"
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/credit_systems/v2/wallets/{id}/credit-allocations")
.header("x-api-key", "<api-key>")
.asString();{
"statusCode": 200,
"message": "Credit allocations fetched successfully",
"meta": {},
"data": [
{
"id": "a3f2b8e0-4d11-4f9a-8c2d-7e1b3a9f0c12",
"amount": 100,
"consumed": 35,
"allocation_type": "subscription",
"invoice_id": "0d9e5a0e-7de4-48c6-b01a-b1759394578b",
"order_id": null,
"order_number": null,
"valid_until": "2026-04-12T16:55:21.847Z",
"created_at": "2026-03-12T16:55:22.014Z"
},
{
"id": "f51c9d3a-2b48-4e10-9c61-71d8b4e2a503",
"amount": 50,
"consumed": 0,
"allocation_type": "topup",
"invoice_id": "762d8b5f-e416-4d88-8461-2a357b91ff25",
"order_id": "ord_01HABCDEFGHIJK",
"order_number": "ORD012",
"valid_until": null,
"created_at": "2026-03-20T11:04:18.221Z"
}
],
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Wallets
List credit allocations for a wallet
List the credit allocations for a wallet, with the granted amount and consumed amount. Fetch the transactions for a wallet via the wallet transactions endpoints.
GET
/
api
/
v1
/
credit_systems
/
v2
/
wallets
/
{id}
/
credit-allocations
Python SDK
from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# List credit allocations for a wallet
allocations = client.wallets.list_credit_allocations("b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c")
for alloc in allocations['data']:
available = alloc['amount'] - alloc['consumed']
print(f"{alloc['allocation_type']}: {available} available / {alloc['amount']} granted")
# Filter by status
active = client.wallets.list_credit_allocations(
"b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c",
status="active",
)
import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
const allocations = await metrifoxClient.wallets.listCreditAllocations(
"b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c"
);
allocations.data.forEach((a) => {
const available = a.amount - a.consumed;
console.log(`${a.allocation_type}: ${available} available / ${a.amount} granted`);
});
// Filter by status
const active = await metrifoxClient.wallets.listCreditAllocations(
"b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c",
{ status: "active" }
);
require 'metrifox-sdk'
METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })
# List credit allocations for a wallet
response = METRIFOX_SDK.wallets.list_credit_allocations("b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c")
response["data"].each do |alloc|
available = alloc["amount"] - alloc["consumed"]
puts "#{alloc['allocation_type']}: #{available} available / #{alloc['amount']} granted"
end
# Filter by status
active = METRIFOX_SDK.wallets.list_credit_allocations(
"b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c",
status: "active"
)
curl --request GET \
--url https://{defaultHost}/api/v1/credit_systems/v2/wallets/{id}/credit-allocations \
--header 'x-api-key: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/api/v1/credit_systems/v2/wallets/{id}/credit-allocations",
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/credit_systems/v2/wallets/{id}/credit-allocations"
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/credit_systems/v2/wallets/{id}/credit-allocations")
.header("x-api-key", "<api-key>")
.asString();{
"statusCode": 200,
"message": "Credit allocations fetched successfully",
"meta": {},
"data": [
{
"id": "a3f2b8e0-4d11-4f9a-8c2d-7e1b3a9f0c12",
"amount": 100,
"consumed": 35,
"allocation_type": "subscription",
"invoice_id": "0d9e5a0e-7de4-48c6-b01a-b1759394578b",
"order_id": null,
"order_number": null,
"valid_until": "2026-04-12T16:55:21.847Z",
"created_at": "2026-03-12T16:55:22.014Z"
},
{
"id": "f51c9d3a-2b48-4e10-9c61-71d8b4e2a503",
"amount": 50,
"consumed": 0,
"allocation_type": "topup",
"invoice_id": "762d8b5f-e416-4d88-8461-2a357b91ff25",
"order_id": "ord_01HABCDEFGHIJK",
"order_number": "ORD012",
"valid_until": null,
"created_at": "2026-03-20T11:04:18.221Z"
}
],
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Authorizations
Path Parameters
The unique wallet identifier
Query Parameters
Optional allocation status filter (e.g. active, expired)
⌘I

