Get reseller billing
Return the compact billing snapshot for one reseller. The same shape appears embedded under billing on GET /resellers/{id} and as the return value of POST /resellers/{id}/billing/adjust, so any integration that consumes billing state can share one parser across all three.
active_users is always live. The endpoint recomputes count(active non-trial users) + sum(sub-reseller max_users) on every call, so the value can never be stale relative to the underlying rows.
Endpoint
GET https://<your-panel-domain>/panel-api/v1/resellers/{id}/billing
Authentication
Send the API key in the Authorization: Bearer <your-api-key> header. Only admin keys can call this endpoint.
Required scope
resellers:read
Path parameters
| Name | Type | Description |
|---|---|---|
id |
int | The reg-user ID of the reseller. |
Response
Every response has the five fields below. Which ones are populated depends on mode.
| Field | Type | Description |
|---|---|---|
mode |
string | Either "credits" or "users". |
credits |
float or null | Current credit balance. Populated only in credits mode. null in users mode. |
max_users |
int or null | Slot cap. Populated only in users mode. null in credits mode. |
active_users |
int or null | Slots currently in use (active non-trial users plus slots reserved by sub-resellers). Populated only in users mode. |
billing_expires |
int or null | Unix timestamp in seconds after which the account can no longer create or renew lines. Present in either mode when the admin has set an expiration; null otherwise. |
Response for a credits-mode reseller:
{
"mode": "credits",
"credits": 10,
"max_users": null,
"active_users": null,
"billing_expires": null
}
Response for a users-mode reseller:
{
"mode": "users",
"credits": null,
"max_users": 500,
"active_users": 312,
"billing_expires": 1793308800
}
Examples
cURL
curl -H "Authorization: Bearer <your-api-key>" \
https://<your-panel-domain>/panel-api/v1/resellers/262260/billing
PHP SDK
require __DIR__ . '/api-panel-php-sdk-1.0.0/autoload.php';
use XtreamAI\PanelApi\PanelApiClient;
$client = new PanelApiClient(baseUrl: 'https://<your-panel-domain>', token: '<your-api-key>');
$billing = $client->resellers->billing(262260);
if ($billing->mode === 'credits') {
echo 'credits balance: ', $billing->credits, PHP_EOL;
} else {
echo 'slots: ', $billing->activeUsers, '/', $billing->maxUsers, PHP_EOL;
}
Python SDK
from xtream_ai_panel_api import PanelApiClient
client = PanelApiClient(base_url="https://<your-panel-domain>", token="<your-api-key>")
billing = client.resellers.billing(262260)
if billing.mode == "credits":
print("credits balance:", billing.credits)
else:
print("slots:", billing.active_users, "/", billing.max_users)
Errors
| HTTP | Error slug | When it happens | How to fix |
|---|---|---|---|
| 401 | invalid_key |
Missing, malformed, or unknown API key. | Send a live key in Authorization: Bearer <token>. |
| 403 | insufficient_scope |
The key does not carry resellers:read. |
Use an admin key. |
| 404 | not_found |
No reseller exists with that ID. | Verify the ID with GET /resellers/{id} first. |
| 429 | rate_limited |
The per-key request budget for this minute is spent. | Back off and retry after the minute rolls over. |