Python SDK
from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# List all wallets for a customer
wallets = client.wallets.list("cust-mljp3ra6ffjm")
for wallet in wallets['data']:
print(f"{wallet['name']}: {wallet['balance']} {wallet['credit_unit_plural']}")import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
const wallets = await metrifoxClient.wallets.list("cust-mljp3ra6ffjm");
wallets.data.forEach((w) => {
console.log(`${w.name}: ${w.balance} ${w.credit_unit_plural}`);
});
require 'metrifox-sdk'
METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })
# List all wallets for a customer
response = METRIFOX_SDK.wallets.list("cust-mljp3ra6ffjm")
response["data"].each do |wallet|
puts "#{wallet['name']}: #{wallet['balance']} #{wallet['credit_unit_plural']}"
end
curl --request GET \
--url https://{defaultHost}/api/v1/credit_systems/v2/wallets \
--header 'x-api-key: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/api/v1/credit_systems/v2/wallets",
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"
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")
.header("x-api-key", "<api-key>")
.asString();{
"statusCode": 200,
"message": "Wallets fetched successfully",
"meta": {},
"data": [
{
"id": "b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c",
"name": "Image Credits",
"credit_key": "image_credits",
"credit_system_id": "c17f9a7b-1e49-4f80-9b6e-8d85b4a11f8a",
"credit_unit_singular": "credit",
"credit_unit_plural": "credits",
"balance": 120,
"low_balance_threshold": 20,
"credit_attachment_id": "fb4e18f0-8b9c-4977-9fdd-7a4b76b2e8d3",
"customer_key": "cust-mljp3ra6ffjm",
"allocations": [],
"topup_link": "https://app.metrifox.com/metrifox-inc/wallets/b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c?customer=cust-mljp3ra6ffjm"
}
],
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Wallets
List a customer's wallets
List the credit wallets that belong to a customer, including each walletβs current balance and topup link.
GET
/
api
/
v1
/
credit_systems
/
v2
/
wallets
Python SDK
from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# List all wallets for a customer
wallets = client.wallets.list("cust-mljp3ra6ffjm")
for wallet in wallets['data']:
print(f"{wallet['name']}: {wallet['balance']} {wallet['credit_unit_plural']}")import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
const wallets = await metrifoxClient.wallets.list("cust-mljp3ra6ffjm");
wallets.data.forEach((w) => {
console.log(`${w.name}: ${w.balance} ${w.credit_unit_plural}`);
});
require 'metrifox-sdk'
METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })
# List all wallets for a customer
response = METRIFOX_SDK.wallets.list("cust-mljp3ra6ffjm")
response["data"].each do |wallet|
puts "#{wallet['name']}: #{wallet['balance']} #{wallet['credit_unit_plural']}"
end
curl --request GET \
--url https://{defaultHost}/api/v1/credit_systems/v2/wallets \
--header 'x-api-key: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/api/v1/credit_systems/v2/wallets",
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"
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")
.header("x-api-key", "<api-key>")
.asString();{
"statusCode": 200,
"message": "Wallets fetched successfully",
"meta": {},
"data": [
{
"id": "b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c",
"name": "Image Credits",
"credit_key": "image_credits",
"credit_system_id": "c17f9a7b-1e49-4f80-9b6e-8d85b4a11f8a",
"credit_unit_singular": "credit",
"credit_unit_plural": "credits",
"balance": 120,
"low_balance_threshold": 20,
"credit_attachment_id": "fb4e18f0-8b9c-4977-9fdd-7a4b76b2e8d3",
"customer_key": "cust-mljp3ra6ffjm",
"allocations": [],
"topup_link": "https://app.metrifox.com/metrifox-inc/wallets/b7bf0d46-9f7d-4d58-9bb4-6bfb2d3e6a5c?customer=cust-mljp3ra6ffjm"
}
],
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Authorizations
Query Parameters
The unique identifier of the customer on your platform, saved as customer_key on Metrifox
βI

